EquipmentTasksList.xaml.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using Comal.Classes;
  2. using InABox.Clients;
  3. using InABox.Core;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Xamarin.Forms;
  10. using Xamarin.Forms.Xaml;
  11. using XF.Material.Forms.UI.Dialogs;
  12. namespace comal.timesheets
  13. {
  14. [XamlCompilation(XamlCompilationOptions.Compile)]
  15. public partial class EquipmentTasksList : BasePage
  16. {
  17. private EquipmentDetailModel _equipment;
  18. public EquipmentDetailModel Equipment
  19. {
  20. get => _equipment;
  21. set
  22. {
  23. _equipment = value;
  24. listView.ItemsSource = _equipment.Kanbans.Where(x => !x.Completed.IsEmpty());
  25. }
  26. }
  27. public EquipmentTasksList()
  28. {
  29. InitializeComponent();
  30. }
  31. private async void Kanban_Tapped(object sender, EventArgs e)
  32. {
  33. await MaterialDialog.Instance.AlertAsync("FV: To be replaced with full Task Viewer");
  34. // if ((listView.SelectedItem is EquipmentKanbanShell item) && (item.Attachments != 0))
  35. // {
  36. // CoreTable table = new Client<KanbanDocument>().Query(
  37. // new Filter<KanbanDocument>(x => x.EntityLink.ID).IsEqualTo(item.KanbanID),
  38. // new Columns<KanbanDocument>(x => x.DocumentLink.FileName, x => x.DocumentLink.ID));
  39. // if (table.Rows.Any())
  40. // {
  41. // Dictionary<string, Guid> filenameIDS = new Dictionary<string, Guid>();
  42. // foreach (CoreRow row in table.Rows)
  43. // {
  44. // List<object> list = row.Values;
  45. // if (list[0] != null && list[1] != null)
  46. // {
  47. // filenameIDS.Add(list[0].ToString(), Guid.Parse(list[1].ToString()));
  48. // }
  49. // }
  50. //
  51. // if (filenameIDS.Count > 0)
  52. // {
  53. // PDFList pdflist = new PDFList(filenameIDS, true);
  54. // Navigation.PushAsync(pdflist);
  55. // }
  56. // }
  57. // }
  58. }
  59. }
  60. }