Skip to content

Speed up project loading #48

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

Merged
merged 1 commit into from
Oct 3, 2022
Merged
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
6 changes: 3 additions & 3 deletions BHoMAnalytics_UI/CaptureProjectData.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private void Click_ProjectBtn(object sender, EventArgs e)
ResetForms();
ProjectInputPanel.Visibility = Visibility.Visible;
this.Height = 380;
//ProjectIDInput.Focus();
ProjectComboBox.Focus();
}

Expand Down Expand Up @@ -257,10 +256,11 @@ private void ReadProjectInformation()
var sqlAdapter = new SqlAdapter("SQL-BHoM01", "BuroHappoldData");
TableRequest request = new TableRequest() { Table = "Project" };
var obj = sqlAdapter.Pull(request).Cast<BH.oM.Base.CustomObject>().ToList();
obj = obj.Where(x => x.CustomData["Status"].ToString().ToLower() == "active").ToList();

obj = obj.OrderBy(x => x.CustomData["Status"].ToString()).ThenBy(x => x.CustomData["ProjectId"].ToString()).ToList();

foreach (var item in obj)
Parallel.ForEach(obj, item =>
{
string projectInfo = $"{item.CustomData["ProjectId"].ToString()} - {item.Name}";

Expand All @@ -271,7 +271,7 @@ private void ReadProjectInformation()
projectInfo += " - INACTIVE";

AllProjectData.Add(projectInfo);
}
});

_loadedProjectData = AllProjectData.ToList();
}
Expand Down