Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Декларации: исправлены ошибки #124

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/RevitDeclarations/Models/Apartment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,5 @@ public void CalculateUtp(UtpCalculator calculator) {
_utpPantry = calculator.CalculatePantry(this);
_utpLaundry = calculator.CalculateLaundry(this);
}

public int GetIntFullNumber() {
if(string.IsNullOrEmpty(FullNumber)) {
return 0;
} else {
string resultString = Regex.Match(FullNumber, @"\d+").Value;
int.TryParse(resultString, out int result);
return result;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace RevitDeclarations.Models {
internal class CsvExporter : ITableExporter {
public void Export(string path, DeclarationDataTable table) {
path = Path.ChangeExtension(path, "scv");
path = Path.ChangeExtension(path, "csv");

string strData = ConvertDataTableToString(table);

Expand Down
5 changes: 4 additions & 1 deletion src/RevitDeclarations/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

using dosymep.Revit.Comparators;
using dosymep.WPF.Commands;
using dosymep.WPF.ViewModels;

Expand Down Expand Up @@ -48,6 +49,7 @@ public MainViewModel(RevitRepository revitRepository, DeclarationSettings settin
_settings = settings;

_phases = _revitRepository.GetPhases();
_selectedPhase = _phases[_phases.Count - 1];

_excelExportViewModel =
new ExcelExportViewModel("Excel", new Guid("01EE33B6-69E1-4364-92FD-A2F94F115A9E"), _settings);
Expand Down Expand Up @@ -252,10 +254,11 @@ public void ExportDeclaration(object obj) {
}
}

LogicalStringComparer comparer = new LogicalStringComparer();
List<Apartment> apartments = projects
.SelectMany(x => x.Apartments)
.OrderBy(x => x.Section)
.ThenBy(x => x.GetIntFullNumber())
.ThenBy(x => x.FullNumber, comparer)
.ToList();

try {
Expand Down
Loading