|
@@ -73,44 +73,37 @@ namespace comal.timesheets
|
|
|
Navigation.PushAsync(page);
|
|
|
}
|
|
|
|
|
|
- private void Page_OnJobDocFiltersPicked(string discipline, string type, string category, string area)
|
|
|
+ private void Page_OnJobDocFiltersPicked(Dictionary<JobDocFilterType, string> newfilters)
|
|
|
{
|
|
|
filterLayout.Children.Clear();
|
|
|
filteredShells.Clear();
|
|
|
filters.Clear();
|
|
|
|
|
|
- if (!string.IsNullOrWhiteSpace(discipline))
|
|
|
- AddFilter(discipline, JobDocFilterType.Discipline);
|
|
|
- if (!string.IsNullOrWhiteSpace(type))
|
|
|
- AddFilter(type, JobDocFilterType.Type);
|
|
|
- if (!string.IsNullOrWhiteSpace(category))
|
|
|
- AddFilter(category, JobDocFilterType.Category);
|
|
|
- if (!string.IsNullOrWhiteSpace(area))
|
|
|
- AddFilter(area, JobDocFilterType.Area);
|
|
|
-
|
|
|
+ filters = new Dictionary<JobDocFilterType, string>(newfilters);
|
|
|
+
|
|
|
+ AddFilters();
|
|
|
+
|
|
|
DisplayFolderContents();
|
|
|
}
|
|
|
|
|
|
- private void AddFilter(string text, JobDocFilterType type)
|
|
|
+ private void AddFilters()
|
|
|
{
|
|
|
- if (!filters.ContainsKey(type))
|
|
|
- filters.Add(type, text);
|
|
|
-
|
|
|
- JobDocFilterItem item = new JobDocFilterItem();
|
|
|
- item.Init(text, type);
|
|
|
- item.OnJobDocFilterClosed += ((filter, type) =>
|
|
|
+ foreach (var filter in filters)
|
|
|
{
|
|
|
- filterLayout.Children.Remove(item);
|
|
|
- filters.Remove(type);
|
|
|
- RemoveShells(filter, type);
|
|
|
- DisplayFolderContents();
|
|
|
- });
|
|
|
- filterLayout.Children.Add(item);
|
|
|
+ JobDocFilterItem item = new JobDocFilterItem();
|
|
|
+ item.Init(filter.Key, filter.Value);
|
|
|
+ item.OnJobDocFilterClosed += ((filter, type) =>
|
|
|
+ {
|
|
|
+ filters.Remove(type);
|
|
|
+ Page_OnJobDocFiltersPicked(new Dictionary<JobDocFilterType, string>(filters));
|
|
|
+ });
|
|
|
+ filterLayout.Children.Add(item);
|
|
|
|
|
|
- FilterList(text, type);
|
|
|
+ FilterList(filter.Key, filter.Value);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- private void FilterList(string text, JobDocFilterType type)
|
|
|
+ private void FilterList(JobDocFilterType type, string text)
|
|
|
{
|
|
|
if (type == JobDocFilterType.Discipline)
|
|
|
{
|
|
@@ -143,43 +136,7 @@ namespace comal.timesheets
|
|
|
var duplicate = filteredShells.FirstOrDefault(x => x.ID == v.ID);
|
|
|
if (duplicate == null)
|
|
|
filteredShells.Add(v);
|
|
|
- }
|
|
|
-
|
|
|
- private void RemoveShells(string filter, JobDocFilterType type)
|
|
|
- {
|
|
|
- if (type == JobDocFilterType.Discipline)
|
|
|
- {
|
|
|
- while (filteredShells.Find(x => x.DocSetDiscipline == filter) != null)
|
|
|
- {
|
|
|
- var shell = filteredShells.FirstOrDefault(x => x.DocSetDiscipline == filter);
|
|
|
- filteredShells.Remove(shell);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (type == JobDocFilterType.Type)
|
|
|
- {
|
|
|
- while (filteredShells.Find(x => x.DocSetType == filter) != null)
|
|
|
- {
|
|
|
- var shell = filteredShells.FirstOrDefault(x => x.DocSetType == filter);
|
|
|
- filteredShells.Remove(shell);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (type == JobDocFilterType.Category)
|
|
|
- {
|
|
|
- while (filteredShells.Find(x => x.DocSetCategory == filter) != null)
|
|
|
- {
|
|
|
- var shell = filteredShells.FirstOrDefault(x => x.DocSetCategory == filter);
|
|
|
- filteredShells.Remove(shell);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (type == JobDocFilterType.Area)
|
|
|
- {
|
|
|
- while (filteredShells.Find(x => x.DocSetArea == filter) != null)
|
|
|
- {
|
|
|
- var shell = filteredShells.FirstOrDefault(x => x.DocSetArea == filter);
|
|
|
- filteredShells.Remove(shell);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region TreeView / Folder Interaction
|
|
@@ -443,6 +400,7 @@ namespace comal.timesheets
|
|
|
DocSetType = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Type.Description),
|
|
|
DocSetCategory = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Category.Description),
|
|
|
DocSetDiscipline = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Discipline.Description),
|
|
|
+ DocSetArea = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Area.Description),
|
|
|
};
|
|
|
if (specificQuery)
|
|
|
specificQueryMileStones.Add(shell);
|
|
@@ -471,6 +429,7 @@ namespace comal.timesheets
|
|
|
file.DocSetCategory = mileStone.DocSetCategory;
|
|
|
file.DocSetType = mileStone.DocSetType;
|
|
|
file.DocSetDiscipline = mileStone.DocSetDiscipline;
|
|
|
+ file.DocSetArea = mileStone.DocSetArea;
|
|
|
|
|
|
file.TrimmedIssued = TrimWhiteSpace(file.Issued);
|
|
|
|