|  | @@ -36,7 +36,8 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          Guid jobID = Guid.Empty;
 | 
	
		
			
				|  |  |          List<Guid> loadedFolders = new List<Guid>();
 | 
	
		
			
				|  |  |          List<MileStoneShell> mileStoneShells = new List<MileStoneShell>();
 | 
	
		
			
				|  |  | -        List<JobDocSetFileShell> shells = new List<JobDocSetFileShell>();
 | 
	
		
			
				|  |  | +        List<JobDocSetFileShell> fullListShells = new List<JobDocSetFileShell>();
 | 
	
		
			
				|  |  | +        List<JobDocSetFileShell> filteredShells = new List<JobDocSetFileShell>();
 | 
	
		
			
				|  |  |          List<JobDocSetFileShell> searchList = new List<JobDocSetFileShell>();
 | 
	
		
			
				|  |  |          List<MileStoneShell> specificQueryMileStones = new List<MileStoneShell>();
 | 
	
		
			
				|  |  |          List<JobDocSetFileShell> specificQueryFileShells = new List<JobDocSetFileShell>();
 | 
	
	
		
			
				|  | @@ -63,6 +64,38 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              Navigation.PopAsync();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void FilterButton_Tapped(object sender, EventArgs e)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            var page = new JobDocsFilterPage(jobID);
 | 
	
		
			
				|  |  | +            page.OnJobDocFiltersPicked += Page_OnJobDocFiltersPicked;
 | 
	
		
			
				|  |  | +            Navigation.PushAsync(page);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void Page_OnJobDocFiltersPicked(string discipline, string type, string category, string area)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            filterLayout.Children.Clear();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (!string.IsNullOrWhiteSpace(discipline))
 | 
	
		
			
				|  |  | +                AddFilter(discipline, JobDocFilterType.Discipline);
 | 
	
		
			
				|  |  | +            if (!string.IsNullOrWhiteSpace(type))
 | 
	
		
			
				|  |  | +                AddFilter(type, JobDocFilterType.Type);
 | 
	
		
			
				|  |  | +            if (!string.IsNullOrWhiteSpace(discipline))
 | 
	
		
			
				|  |  | +                AddFilter(category, JobDocFilterType.Category);
 | 
	
		
			
				|  |  | +            if (!string.IsNullOrWhiteSpace(area))
 | 
	
		
			
				|  |  | +                AddFilter(area, JobDocFilterType.Area);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void AddFilter(string text, JobDocFilterType type)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            JobDocFilterItem item = new JobDocFilterItem();
 | 
	
		
			
				|  |  | +            item.Init(text, type);
 | 
	
		
			
				|  |  | +            item.OnJobDocFilterClosed += ((filter, type) => 
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                filterLayout.Children.Remove(item);
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +            filterLayout.Children.Add(item);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region TreeView / Folder Interaction
 | 
	
	
		
			
				|  | @@ -79,11 +112,11 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  if (folder.ItemName == "All")
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    AddSearchItems(shells);
 | 
	
		
			
				|  |  | +                    AddSearchItems(fullListShells);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  else
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    var list = shells.Where(x => x.FolderID == folder.ID);
 | 
	
		
			
				|  |  | +                    var list = fullListShells.Where(x => x.FolderID == folder.ID);
 | 
	
		
			
				|  |  |                      AddSearchItems(list);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -215,6 +248,10 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                                  x => x.ID,
 | 
	
		
			
				|  |  |                                  x => x.DocumentSet.Folder.Name,
 | 
	
		
			
				|  |  |                                  x => x.DocumentSet.Folder.ID,
 | 
	
		
			
				|  |  | +                                x => x.DocumentSet.Type.Description,
 | 
	
		
			
				|  |  | +                                x => x.DocumentSet.Category.Description,
 | 
	
		
			
				|  |  | +                                x => x.DocumentSet.Discipline.Description,
 | 
	
		
			
				|  |  | +                                x => x.DocumentSet.Area.Description,
 | 
	
		
			
				|  |  |                                  x => x.Submitted,
 | 
	
		
			
				|  |  |                                  x => x.Employee.Name,
 | 
	
		
			
				|  |  |                                  x => x.Type.Description,
 | 
	
	
		
			
				|  | @@ -242,8 +279,8 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                                  else
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  |                                      filesLoaded = true;
 | 
	
		
			
				|  |  | -                                    displayList.Insert(0, new FolderViewItem { ItemName = "All", Documents = shells.Count });
 | 
	
		
			
				|  |  | -                                    folderList.Insert(0, new FolderViewItem { ItemName = "All", Documents = shells.Count });
 | 
	
		
			
				|  |  | +                                    displayList.Insert(0, new FolderViewItem { ItemName = "All", Documents = fullListShells.Count });
 | 
	
		
			
				|  |  | +                                    folderList.Insert(0, new FolderViewItem { ItemName = "All", Documents = fullListShells.Count });
 | 
	
		
			
				|  |  |                                      treeView.ItemsSource = null;
 | 
	
		
			
				|  |  |                                      treeView.ItemsSource = displayList;
 | 
	
		
			
				|  |  |                                  }
 | 
	
	
		
			
				|  | @@ -289,12 +326,15 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              MileStoneShell shell = new MileStoneShell
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  ID = milestonerow.Get<Guid>("ID"),
 | 
	
		
			
				|  |  | -                FolderName = milestonerow.Get<string>("DocumentSet.Folder.Name"),
 | 
	
		
			
				|  |  | -                FolderID = milestonerow.Get<Guid>("DocumentSet.Folder.ID"),
 | 
	
		
			
				|  |  | -                EmployeeName = milestonerow.Get<string>("Employee.Name"),
 | 
	
		
			
				|  |  | -                Type = milestonerow.Get<string>("Type.Description"),
 | 
	
		
			
				|  |  | -                DocSetDescription = milestonerow.Get<string>("DocumentSet.Description"),
 | 
	
		
			
				|  |  | -                Issued = "Issued: " + milestonerow.Get<DateTime>("Issued").ToString("dd MMM yy")
 | 
	
		
			
				|  |  | +                FolderName = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Folder.Name),
 | 
	
		
			
				|  |  | +                FolderID = milestonerow.Get<JobDocumentSetMileStone, Guid>(x => x.DocumentSet.Folder.ID),
 | 
	
		
			
				|  |  | +                EmployeeName = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.Employee.Name),
 | 
	
		
			
				|  |  | +                Type = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.Type.Description),
 | 
	
		
			
				|  |  | +                DocSetDescription = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Description),
 | 
	
		
			
				|  |  | +                Issued = "Submitted: " + milestonerow.Get<JobDocumentSetMileStone, DateTime>(x => x.Submitted).ToString("dd MMM yy"),
 | 
	
		
			
				|  |  | +                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),
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  |              if (specificQuery)
 | 
	
		
			
				|  |  |                  specificQueryMileStones.Add(shell);
 | 
	
	
		
			
				|  | @@ -319,6 +359,9 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              file.Type = mileStone.Type;
 | 
	
		
			
				|  |  |              file.DocSetDescription = mileStone.DocSetDescription;
 | 
	
		
			
				|  |  |              file.Issued = mileStone.Issued;
 | 
	
		
			
				|  |  | +            file.DocSetCategory = mileStone.DocSetCategory;
 | 
	
		
			
				|  |  | +            file.DocSetType = mileStone.DocSetType;
 | 
	
		
			
				|  |  | +            file.DocSetDiscipline = mileStone.DocSetDiscipline;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              file.TrimmedIssued = TrimWhiteSpace(file.Issued);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -340,7 +383,7 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                  currentQueryFileShells.Add(file);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  | -                shells.Add(file);
 | 
	
		
			
				|  |  | +                fullListShells.Add(file);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void ShowFiles()
 | 
	
	
		
			
				|  | @@ -524,6 +567,10 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          public string Type { get; set; }
 | 
	
		
			
				|  |  |          public string DocSetDescription { get; set; }
 | 
	
		
			
				|  |  |          public string Issued { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetType { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetDiscipline { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetCategory { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetArea { get; set; }
 | 
	
		
			
				|  |  |          public MileStoneShell()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              ID = Guid.Empty;
 | 
	
	
		
			
				|  | @@ -533,6 +580,10 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              Type = "";
 | 
	
		
			
				|  |  |              DocSetDescription = "";
 | 
	
		
			
				|  |  |              Issued = "";
 | 
	
		
			
				|  |  | +            DocSetCategory = "";
 | 
	
		
			
				|  |  | +            DocSetDiscipline = "";
 | 
	
		
			
				|  |  | +            DocSetType = "";
 | 
	
		
			
				|  |  | +            DocSetArea = "";
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -552,6 +603,10 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          public double WidthRequest { get; set; }
 | 
	
		
			
				|  |  |          public byte[] Thumbnail { get; set; }
 | 
	
		
			
				|  |  |          public Guid MileStoneID { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetType { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetDiscipline { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetCategory { get; set; }
 | 
	
		
			
				|  |  | +        public string DocSetArea { get; set; }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public JobDocSetFileShell()
 | 
	
		
			
				|  |  |          {
 | 
	
	
		
			
				|  | @@ -569,7 +624,19 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              Thumbnail = null;
 | 
	
		
			
				|  |  |              MileStoneID = Guid.Empty;
 | 
	
		
			
				|  |  |              FolderID = Guid.Empty;
 | 
	
		
			
				|  |  | +            DocSetCategory = "";
 | 
	
		
			
				|  |  | +            DocSetDiscipline = "";
 | 
	
		
			
				|  |  | +            DocSetType = "";
 | 
	
		
			
				|  |  | +            DocSetArea = "";
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public enum JobDocFilterType
 | 
	
		
			
				|  |  | +    {
 | 
	
		
			
				|  |  | +        Discipline,
 | 
	
		
			
				|  |  | +        Type,
 | 
	
		
			
				|  |  | +        Category,
 | 
	
		
			
				|  |  | +        Area
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      #endregion
 | 
	
		
			
				|  |  |  }
 |