using Comal.Classes; using InABox.Clients; using InABox.Core; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using Xamarin.Forms.Xaml; using XF.Material.Forms.UI.Dialogs; namespace comal.timesheets { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class EquipmentTasksList : BasePage { private EquipmentDetailModel _equipment; public EquipmentDetailModel Equipment { get => _equipment; set { _equipment = value; listView.ItemsSource = _equipment.Kanbans.Where(x => !x.Completed.IsEmpty()); } } public EquipmentTasksList() { InitializeComponent(); } private async void Kanban_Tapped(object sender, EventArgs e) { await MaterialDialog.Instance.AlertAsync("FV: To be replaced with full Task Viewer"); // if ((listView.SelectedItem is EquipmentKanbanShell item) && (item.Attachments != 0)) // { // CoreTable table = new Client().Query( // new Filter(x => x.EntityLink.ID).IsEqualTo(item.KanbanID), // new Columns(x => x.DocumentLink.FileName, x => x.DocumentLink.ID)); // if (table.Rows.Any()) // { // Dictionary filenameIDS = new Dictionary(); // foreach (CoreRow row in table.Rows) // { // List list = row.Values; // if (list[0] != null && list[1] != null) // { // filenameIDS.Add(list[0].ToString(), Guid.Parse(list[1].ToString())); // } // } // // if (filenameIDS.Count > 0) // { // PDFList pdflist = new PDFList(filenameIDS, true); // Navigation.PushAsync(pdflist); // } // } // } } } }