JobDocViewer.xaml.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. using comal.timesheets.CustomControls;
  2. using comal.timesheets.Data_Classes;
  3. using Comal.Classes;
  4. using InABox.Clients;
  5. using InABox.Core;
  6. using Syncfusion.TreeView.Engine;
  7. using Syncfusion.XForms.PopupLayout;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Collections.ObjectModel;
  11. using System.ComponentModel;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading;
  16. using System.Threading.Tasks;
  17. using Xamarin.Essentials;
  18. using Xamarin.Forms;
  19. using Xamarin.Forms.Xaml;
  20. using XF.Material.Forms.UI.Dialogs;
  21. using PRSSecurity = InABox.Core.Security;
  22. namespace comal.timesheets
  23. {
  24. public delegate void OnFolderListChanged();
  25. [XamlCompilation(XamlCompilationOptions.Compile)]
  26. public partial class JobDocViewer : ContentPage
  27. {
  28. #region Fields and Constructor / Navigation
  29. ObservableCollection<FolderViewItem> folderList = new ObservableCollection<FolderViewItem>();
  30. ObservableCollection<FolderViewItem> displayList = new ObservableCollection<FolderViewItem>();
  31. DeviceIdiom idiom;
  32. bool foldersLoaded = false;
  33. bool filesLoaded = false;
  34. bool specificQueryLoading = false;
  35. Guid jobID = Guid.Empty;
  36. List<Guid> loadedFolders = new List<Guid>();
  37. List<MileStoneShell> mileStoneShells = new List<MileStoneShell>();
  38. List<JobDocSetFileShell> fullListShells = new List<JobDocSetFileShell>();
  39. List<JobDocSetFileShell> filteredShells = new List<JobDocSetFileShell>();
  40. List<JobDocSetFileShell> searchList = new List<JobDocSetFileShell>();
  41. List<MileStoneShell> specificQueryMileStones = new List<MileStoneShell>();
  42. List<JobDocSetFileShell> specificQueryFileShells = new List<JobDocSetFileShell>();
  43. List<JobDocSetFileShell> currentQueryFileShells = new List<JobDocSetFileShell>();
  44. public JobDocViewer(Job job)
  45. {
  46. InitializeComponent();
  47. NavigationPage.SetHasBackButton(this, false);
  48. titleLbl.Text = "Job " + job.JobNumber;
  49. treeView.QueryNodeSize += TreeView_QueryNodeSize;
  50. idiom = DeviceInfo.Idiom;
  51. if (Device.RuntimePlatform.Equals(Device.iOS))
  52. {
  53. expandImg.HeightRequest = 50;
  54. expandImg.WidthRequest = 50;
  55. collapseImg.HeightRequest = 50;
  56. collapseImg.WidthRequest = 50;
  57. }
  58. jobID = job.ID;
  59. LoadFiles(new Filter<JobDocumentSetMileStone>(x => x.DocumentSet.Job.ID).IsEqualTo(jobID));
  60. LoadFolders(jobID);
  61. }
  62. void ExitBtn_Clicked(object sender, EventArgs e)
  63. {
  64. Navigation.PopAsync();
  65. }
  66. private void FilterButton_Tapped(object sender, EventArgs e)
  67. {
  68. var page = new JobDocsFilterPage(jobID);
  69. page.OnJobDocFiltersPicked += Page_OnJobDocFiltersPicked;
  70. Navigation.PushAsync(page);
  71. }
  72. private void Page_OnJobDocFiltersPicked(string discipline, string type, string category, string area)
  73. {
  74. filterLayout.Children.Clear();
  75. if (!string.IsNullOrWhiteSpace(discipline))
  76. AddFilter(discipline, JobDocFilterType.Discipline);
  77. if (!string.IsNullOrWhiteSpace(type))
  78. AddFilter(type, JobDocFilterType.Type);
  79. if (!string.IsNullOrWhiteSpace(discipline))
  80. AddFilter(category, JobDocFilterType.Category);
  81. if (!string.IsNullOrWhiteSpace(area))
  82. AddFilter(area, JobDocFilterType.Area);
  83. }
  84. private void AddFilter(string text, JobDocFilterType type)
  85. {
  86. JobDocFilterItem item = new JobDocFilterItem();
  87. item.Init(text, type);
  88. item.OnJobDocFilterClosed += ((filter, type) =>
  89. {
  90. filterLayout.Children.Remove(item);
  91. });
  92. filterLayout.Children.Add(item);
  93. }
  94. #endregion
  95. #region TreeView / Folder Interaction
  96. void Folder_Tapped(object sender, EventArgs e)
  97. {
  98. var folder = treeView.SelectedItem as FolderViewItem;
  99. if (folder.Documents == 0)
  100. return;
  101. if (specificQueryLoading)
  102. return;
  103. if (filesLoaded)
  104. {
  105. if (folder.ItemName == "All")
  106. {
  107. AddSearchItems(fullListShells);
  108. }
  109. else
  110. {
  111. var list = fullListShells.Where(x => x.FolderID == folder.ID);
  112. AddSearchItems(list);
  113. }
  114. }
  115. else if (loadedFolders.Contains(folder.ID))
  116. {
  117. var list = specificQueryFileShells.Where(x => x.FolderID == folder.ID);
  118. AddSearchItems(list);
  119. }
  120. else
  121. LoadFilesForFolder(folder.ID);
  122. }
  123. private async void LoadFilesForFolder(Guid folderID)
  124. {
  125. currentQueryFileShells.Clear();
  126. specificQueryLoading = true;
  127. ShowLoading();
  128. LoadFiles(new Filter<JobDocumentSetMileStone>(x => x.DocumentSet.Folder.ID).IsEqualTo(folderID), true, folderID);
  129. }
  130. void Expand_Tapped(object sender, EventArgs e)
  131. {
  132. if (!foldersLoaded)
  133. return;
  134. treeViewFrame.HeightRequest = 28 * folderList.Count;
  135. expandImg.IsVisible = false;
  136. collapseImg.IsVisible = true;
  137. }
  138. void Collapse_Tapped(object sender, EventArgs e)
  139. {
  140. treeViewFrame.HeightRequest = 120;
  141. expandImg.IsVisible = true;
  142. collapseImg.IsVisible = false;
  143. }
  144. #endregion
  145. #region Searching
  146. private void SearchEnt_Changed(object sender, EventArgs e)
  147. {
  148. if (specificQueryLoading)
  149. return;
  150. RunSearch();
  151. }
  152. private void AddSearchItems(IEnumerable<JobDocSetFileShell> list)
  153. {
  154. searchList.Clear();
  155. foreach (var v in list)
  156. {
  157. searchList.Add(v);
  158. }
  159. RunSearch();
  160. }
  161. private void RunSearch()
  162. {
  163. Device.BeginInvokeOnMainThread(() =>
  164. {
  165. listView.ItemsSource = null;
  166. if (string.IsNullOrWhiteSpace(searchEnt.Text))
  167. {
  168. listView.ItemsSource = searchList;
  169. fileCountLbl.Text = "Files (" + searchList.Count() + ")";
  170. }
  171. else
  172. {
  173. var list = searchList.Where
  174. (
  175. x =>
  176. x.FileName.Contains(searchEnt.Text) || x.FileName.Contains(searchEnt.Text.ToLower()) ||
  177. x.FileName.Contains(searchEnt.Text.ToUpper()) || x.FileName.Contains(SearchUtils.UpperCaseFirst(searchEnt.Text)) ||
  178. x.DocSetDescription.Contains(searchEnt.Text) || x.DocSetDescription.Contains(searchEnt.Text.ToLower()) ||
  179. x.DocSetDescription.Contains(searchEnt.Text.ToUpper()) || x.DocSetDescription.Contains(SearchUtils.UpperCaseFirst(searchEnt.Text)) ||
  180. x.Issued.Contains(searchEnt.Text) || x.Issued.Contains(searchEnt.Text.ToLower()) ||
  181. x.Issued.Contains(searchEnt.Text.ToUpper()) || x.Issued.Contains(SearchUtils.UpperCaseFirst(searchEnt.Text)) ||
  182. x.TrimmedIssued.Contains(searchEnt.Text) || x.TrimmedIssued.Contains(searchEnt.Text.ToLower()) ||
  183. x.TrimmedIssued.Contains(searchEnt.Text.ToUpper()) || x.TrimmedIssued.Contains(SearchUtils.UpperCaseFirst(searchEnt.Text)) ||
  184. x.TrimmedIssued.Contains(SearchUtils.UpperCaseSecond(searchEnt.Text)) || x.TrimmedIssued.Contains(SearchUtils.UpperCaseThird(searchEnt.Text)) || x.TrimmedIssued.Contains(SearchUtils.UpperCaseFourth(searchEnt.Text))
  185. );
  186. listView.ItemsSource = list;
  187. fileCountLbl.Text = "Files (" + list.Count() + ")";
  188. }
  189. });
  190. }
  191. #endregion
  192. #region Loading
  193. private void TreeView_QueryNodeSize(object sender, Syncfusion.XForms.TreeView.QueryNodeSizeEventArgs e)
  194. {
  195. e.Height = e.GetActualNodeHeight();
  196. e.Handled = true;
  197. }
  198. private void LoadFolders(Guid jobid)
  199. {
  200. CoreTable table = new Client<JobDocumentSetFolder>().Query(new Filter<JobDocumentSetFolder>(x => x.Job.ID).IsEqualTo(jobid),
  201. new Columns<JobDocumentSetFolder>(x => x.ID, x => x.Parent.ID, x => x.Name, x => x.Documents));
  202. foreach (CoreRow row in table.Rows)
  203. {
  204. FolderViewItem folderItem = new FolderViewItem
  205. {
  206. ID = row.Get<Guid>("ID"),
  207. ParentID = row.Get<Guid>("Parent.ID"),
  208. ItemName = row.Get<string>("Name"),
  209. Documents = row.Get<int>("Documents")
  210. };
  211. folderList.Add(folderItem);
  212. }
  213. foreach (var folder in folderList)
  214. {
  215. folder.List = folderList;
  216. if (folder.ParentID == Guid.Empty || folder.ParentID == CoreUtils.FullGuid)
  217. displayList.Add(folder);
  218. }
  219. displayList = new ObservableCollection<FolderViewItem>(displayList.OrderBy(x => x.ItemName));
  220. treeView.ItemsSource = displayList;
  221. foldersLoaded = true;
  222. }
  223. private async void LoadFiles(Filter<JobDocumentSetMileStone> filter, bool specificQuery = false, Guid loadFolder = new Guid())
  224. {
  225. await Task.Run(() =>
  226. {
  227. try
  228. {
  229. filter = filter.And(x => x.Status).IsEqualTo(JobDocumentSetMileStoneStatus.Approved)
  230. .And(x => x.Type.SiteVisible).IsEqualTo(true);
  231. CoreTable milestones = new Client<JobDocumentSetMileStone>().Query(filter,
  232. new Columns<JobDocumentSetMileStone>(
  233. x => x.ID,
  234. x => x.DocumentSet.Folder.Name,
  235. x => x.DocumentSet.Folder.ID,
  236. x => x.DocumentSet.Type.Description,
  237. x => x.DocumentSet.Category.Description,
  238. x => x.DocumentSet.Discipline.Description,
  239. x => x.DocumentSet.Area.Description,
  240. x => x.Submitted,
  241. x => x.Employee.Name,
  242. x => x.Type.Description,
  243. x => x.DocumentSet.Description
  244. )
  245. );
  246. if (milestones.Rows.Any())
  247. {
  248. var table = QueryFiles(milestones, specificQuery);
  249. if (table.Rows.Any())
  250. {
  251. foreach (CoreRow filerow in table.Rows)
  252. {
  253. AddFileShell(filerow, specificQuery);
  254. }
  255. Device.BeginInvokeOnMainThread(() =>
  256. {
  257. if (specificQuery)
  258. {
  259. ShowFiles();
  260. specificQueryLoading = false;
  261. loadedFolders.Add(loadFolder);
  262. AddSearchItems(currentQueryFileShells);
  263. }
  264. else
  265. {
  266. filesLoaded = true;
  267. displayList.Insert(0, new FolderViewItem { ItemName = "All", Documents = fullListShells.Count });
  268. folderList.Insert(0, new FolderViewItem { ItemName = "All", Documents = fullListShells.Count });
  269. treeView.ItemsSource = null;
  270. treeView.ItemsSource = displayList;
  271. }
  272. });
  273. }
  274. }
  275. else
  276. {
  277. specificQueryLoading = false;
  278. ShowFiles();
  279. }
  280. }
  281. catch
  282. {
  283. specificQueryLoading = false;
  284. ShowFiles();
  285. }
  286. });
  287. }
  288. private CoreTable QueryFiles(CoreTable milestones, bool specificQuery = false)
  289. {
  290. Filter<JobDocumentSetMileStoneFile> filter = new Filter<JobDocumentSetMileStoneFile>(x => x.EntityLink.ID).IsEqualTo(milestones.Rows.FirstOrDefault().Get<Guid>("ID"));
  291. foreach (CoreRow milestonerow in milestones.Rows)
  292. {
  293. Guid id = AddMileStoneShell(milestonerow, specificQuery);
  294. filter = filter.Or(x => x.EntityLink.ID).IsEqualTo(milestonerow.Get<Guid>("ID"));
  295. }
  296. CoreTable table = new Client<JobDocumentSetMileStoneFile>().Query(
  297. filter,
  298. new Columns<JobDocumentSetMileStoneFile>(
  299. x => x.DocumentLink.ID,
  300. x => x.Thumbnail,
  301. x => x.DocumentLink.FileName,
  302. x => x.EntityLink.ID
  303. ));
  304. return table;
  305. }
  306. private Guid AddMileStoneShell(CoreRow milestonerow, bool specificQuery = false)
  307. {
  308. Guid id = milestonerow.Get<Guid>("ID");
  309. MileStoneShell shell = new MileStoneShell
  310. {
  311. ID = milestonerow.Get<Guid>("ID"),
  312. FolderName = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Folder.Name),
  313. FolderID = milestonerow.Get<JobDocumentSetMileStone, Guid>(x => x.DocumentSet.Folder.ID),
  314. EmployeeName = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.Employee.Name),
  315. Type = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.Type.Description),
  316. DocSetDescription = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Description),
  317. Issued = "Submitted: " + milestonerow.Get<JobDocumentSetMileStone, DateTime>(x => x.Submitted).ToString("dd MMM yy"),
  318. DocSetType = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Type.Description),
  319. DocSetCategory = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Category.Description),
  320. DocSetDiscipline = milestonerow.Get<JobDocumentSetMileStone, string>(x => x.DocumentSet.Discipline.Description),
  321. };
  322. if (specificQuery)
  323. specificQueryMileStones.Add(shell);
  324. else
  325. mileStoneShells.Add(shell);
  326. return id;
  327. }
  328. private void AddFileShell(CoreRow filerow, bool specificQuery = false)
  329. {
  330. JobDocSetFileShell file = new JobDocSetFileShell
  331. {
  332. DocLinkID = filerow.Get<Guid>("DocumentLink.ID"),
  333. FileName = filerow.Get<string>("DocumentLink.FileName"),
  334. MileStoneID = filerow.Get<Guid>("EntityLink.ID")
  335. };
  336. MileStoneShell mileStone = mileStoneShells.Find(x => x.ID == file.MileStoneID);
  337. file.FolderName = mileStone.FolderName;
  338. file.FolderID = mileStone.FolderID;
  339. file.EmployeeName = mileStone.EmployeeName;
  340. file.Type = mileStone.Type;
  341. file.DocSetDescription = mileStone.DocSetDescription;
  342. file.Issued = mileStone.Issued;
  343. file.DocSetCategory = mileStone.DocSetCategory;
  344. file.DocSetType = mileStone.DocSetType;
  345. file.DocSetDiscipline = mileStone.DocSetDiscipline;
  346. file.TrimmedIssued = TrimWhiteSpace(file.Issued);
  347. byte[] data = filerow.Get<byte[]>("Thumbnail");
  348. if (data != null)
  349. {
  350. file.ImageSource = ImageSource.FromStream(() => new MemoryStream(data));
  351. if (idiom == DeviceIdiom.Tablet)
  352. {
  353. file.HeightRequest = 400;
  354. file.WidthRequest = 500;
  355. }
  356. file.Thumbnail = data;
  357. }
  358. if (specificQuery)
  359. {
  360. specificQueryFileShells.Add(file);
  361. currentQueryFileShells.Add(file);
  362. }
  363. else
  364. fullListShells.Add(file);
  365. }
  366. private void ShowFiles()
  367. {
  368. Device.BeginInvokeOnMainThread(() =>
  369. {
  370. treeView.IsEnabled = true;
  371. loadingLayout.IsVisible = false;
  372. loadingColumn.Width = 0;
  373. filesLayout.IsVisible = true;
  374. filesColumn.Width = new GridLength(1, GridUnitType.Star);
  375. });
  376. }
  377. private void ShowLoading()
  378. {
  379. Device.BeginInvokeOnMainThread(async () =>
  380. {
  381. treeView.IsEnabled = false;
  382. filesLayout.IsVisible = false;
  383. filesColumn.Width = 0;
  384. loadingLayout.IsVisible = true;
  385. loadingColumn.Width = new GridLength(1, GridUnitType.Star);
  386. Random random = new Random();
  387. uint number = (uint)random.Next(500, 3000);
  388. await loadingLbl.TranslateTo(0, 15, 500);
  389. await loadingLbl.TranslateTo(0, 0, 500);
  390. loadingLbl.RotateTo(360, number);
  391. await loadingLbl.TranslateTo(0, 15, 500);
  392. await loadingLbl.TranslateTo(0, 0, 500);
  393. await loadingLbl.TranslateTo(0, 15, 500);
  394. await loadingLbl.TranslateTo(0, 0, 500);
  395. await loadingLbl.TranslateTo(0, 15, 500);
  396. number = (uint)random.Next(500, 3000);
  397. await loadingLbl.TranslateTo(0, 0, 500);
  398. loadingLbl.RotateTo(360, number);
  399. });
  400. }
  401. static string TrimWhiteSpace(string s)
  402. {
  403. s = String.Concat(s.Where(c => !Char.IsWhiteSpace(c)));
  404. return s;
  405. }
  406. #endregion
  407. #region ListView Interaction
  408. void List_Tapped(object sender, EventArgs e)
  409. {
  410. var shell = listView.SelectedItem as JobDocSetFileShell;
  411. if (Device.RuntimePlatform.Equals(Device.Android) && PRSSecurity.IsAllowed<CanOpenMobileNativePDFViewer>())
  412. OpenNativeViewer(shell.DocLinkID);
  413. else
  414. {
  415. PDFViewer viewer = new PDFViewer(shell.DocLinkID);
  416. Navigation.PushAsync(viewer);
  417. }
  418. }
  419. private async void OpenNativeViewer(Guid docID)
  420. {
  421. CoreTable table = new Client<Document>().Query(new Filter<Document>(x => x.ID).IsEqualTo(docID),
  422. new Columns<Document>(x => x.Data, x => x.FileName));
  423. Document doc = table.Rows.First().ToObject<Document>();
  424. var filePath = Path.Combine(FileSystem.AppDataDirectory, doc.FileName);
  425. File.WriteAllBytes(filePath, doc.Data);
  426. await Launcher.OpenAsync(new OpenFileRequest
  427. {
  428. File = new ReadOnlyFile(filePath)
  429. });
  430. }
  431. void Image_Tapped(object sender, EventArgs e)
  432. {
  433. var shell = ((TappedEventArgs)e).Parameter as JobDocSetFileShell;
  434. if (shell == null)
  435. return;
  436. if (shell.Thumbnail != null)
  437. {
  438. Image popupContent = new Image();
  439. popupContent.HeightRequest = 500;
  440. popupContent.WidthRequest = 600;
  441. popupContent.HorizontalOptions = LayoutOptions.FillAndExpand;
  442. popupContent.VerticalOptions = LayoutOptions.FillAndExpand;
  443. popupContent.Aspect = Aspect.AspectFit;
  444. popupContent.Source = ImageSource.FromStream(() => new MemoryStream(shell.Thumbnail));
  445. popupLayout.PopupView.ShowHeader = false;
  446. popupLayout.PopupView.ShowFooter = false;
  447. popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
  448. {
  449. return popupContent;
  450. });
  451. popupLayout.Show();
  452. }
  453. }
  454. #endregion
  455. }
  456. #region Classes
  457. public class FolderViewItem : INotifyPropertyChanged
  458. {
  459. public event OnFolderListChanged OnFolderListChanged;
  460. public event PropertyChangedEventHandler PropertyChanged;
  461. public Guid ID { get; set; }
  462. public Guid ParentID { get; set; }
  463. public ImageSource ImageIcon { get; set; }
  464. private ObservableCollection<FolderViewItem> list;
  465. public ObservableCollection<FolderViewItem> List
  466. {
  467. get
  468. {
  469. return list;
  470. }
  471. set
  472. {
  473. list = value;
  474. OnFolderListChanged?.Invoke();
  475. }
  476. }
  477. private string itemName;
  478. public string ItemName
  479. {
  480. get { return itemName; }
  481. set
  482. {
  483. itemName = value;
  484. RaisedOnPropertyChanged("ItemName");
  485. }
  486. }
  487. public int Documents { get; set; }
  488. public ObservableCollection<FolderViewItem> SubFiles { get; set; }
  489. public Guid DocID { get; set; }
  490. public FolderViewItem()
  491. {
  492. ID = Guid.Empty;
  493. ItemName = "";
  494. ImageIcon = "folder.png";
  495. DocID = Guid.Empty;
  496. ParentID = Guid.Empty;
  497. OnFolderListChanged += FolderViewItem_OnFolderListChanged;
  498. Documents = 0;
  499. }
  500. private void FolderViewItem_OnFolderListChanged()
  501. {
  502. GetChildren();
  503. }
  504. public void RaisedOnPropertyChanged(string _PropertyName)
  505. {
  506. if (PropertyChanged != null)
  507. {
  508. PropertyChanged(this, new PropertyChangedEventArgs(_PropertyName));
  509. }
  510. }
  511. private void GetChildren()
  512. {
  513. SubFiles = new ObservableCollection<FolderViewItem>(list.Where(x => x.ParentID.Equals(ID)));
  514. }
  515. }
  516. public class MileStoneShell
  517. {
  518. public Guid ID { get; set; }
  519. public string FolderName { get; set; }
  520. public Guid FolderID { get; set; }
  521. public string EmployeeName { get; set; }
  522. public string Type { get; set; }
  523. public string DocSetDescription { get; set; }
  524. public string Issued { get; set; }
  525. public string DocSetType { get; set; }
  526. public string DocSetDiscipline { get; set; }
  527. public string DocSetCategory { get; set; }
  528. public string DocSetArea { get; set; }
  529. public MileStoneShell()
  530. {
  531. ID = Guid.Empty;
  532. FolderID = Guid.Empty;
  533. FolderName = "";
  534. EmployeeName = "";
  535. Type = "";
  536. DocSetDescription = "";
  537. Issued = "";
  538. DocSetCategory = "";
  539. DocSetDiscipline = "";
  540. DocSetType = "";
  541. DocSetArea = "";
  542. }
  543. }
  544. public class JobDocSetFileShell
  545. {
  546. public Guid DocLinkID { get; set; }
  547. public string FileName { get; set; }
  548. public string FolderName { get; set; }
  549. public Guid FolderID { get; set; }
  550. public string EmployeeName { get; set; }
  551. public string Type { get; set; }
  552. public string DocSetDescription { get; set; }
  553. public string Issued { get; set; }
  554. public string TrimmedIssued { get; set; }
  555. public ImageSource ImageSource { get; set; }
  556. public double HeightRequest { get; set; }
  557. public double WidthRequest { get; set; }
  558. public byte[] Thumbnail { get; set; }
  559. public Guid MileStoneID { get; set; }
  560. public string DocSetType { get; set; }
  561. public string DocSetDiscipline { get; set; }
  562. public string DocSetCategory { get; set; }
  563. public string DocSetArea { get; set; }
  564. public JobDocSetFileShell()
  565. {
  566. DocLinkID = Guid.Empty;
  567. FileName = "";
  568. FolderName = "";
  569. EmployeeName = "";
  570. Type = "";
  571. DocSetDescription = "";
  572. ImageSource = null;
  573. Issued = "";
  574. TrimmedIssued = "";
  575. HeightRequest = 150;
  576. WidthRequest = 200;
  577. Thumbnail = null;
  578. MileStoneID = Guid.Empty;
  579. FolderID = Guid.Empty;
  580. DocSetCategory = "";
  581. DocSetDiscipline = "";
  582. DocSetType = "";
  583. DocSetArea = "";
  584. }
  585. }
  586. public enum JobDocFilterType
  587. {
  588. Discipline,
  589. Type,
  590. Category,
  591. Area
  592. }
  593. #endregion
  594. }