using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Comal.Classes; using InABox.Configuration; using InABox.Core; using Syncfusion.OfficeChart.Implementation; using Xamarin.Forms; using Xamarin.Forms.Xaml; using XF.Material.Forms; using XF.Material.Forms.UI; using XF.Material.Forms.UI.Dialogs; namespace comal.timesheets { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class DeliveryModule { public DeliveryModule() { InitializeComponent(); } private void DeliveryScanner_OnTapped(ModuleMenuItem sender, ModuleMenuItemTappedArgs args) { var scannerPage = new ScannerPage(); scannerPage.ItemScanned = async (e) => { var model = new DeliveryItemDetailModel(App.Data, () => new Filter(x => x.Barcode).IsEqualTo(e.Text)); using (await MaterialDialog.Instance.LoadingDialogAsync(message: "Checking Code")) model.Load(); if (model.Item != null) Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(new FrameDetailsPage(model))); else await MaterialDialog.Instance.AlertAsync("Code Not Found", "Error"); }; Navigation.PushAsync(scannerPage); } private void DeliveryList_OnTapped(ModuleMenuItem sender, ModuleMenuItemTappedArgs args) { Navigation.PushAsync(new DeliveryList()); } } }