DeliveryModule.xaml.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Comal.Classes;
  6. using InABox.Configuration;
  7. using InABox.Core;
  8. using InABox.Mobile;
  9. using Syncfusion.OfficeChart.Implementation;
  10. using Xamarin.Forms;
  11. using Xamarin.Forms.Xaml;
  12. using XF.Material.Forms;
  13. using XF.Material.Forms.UI;
  14. using XF.Material.Forms.UI.Dialogs;
  15. namespace PRS.Mobile
  16. {
  17. [XamlCompilation(XamlCompilationOptions.Compile)]
  18. public partial class DeliveryModule
  19. {
  20. private DeliveryItemBarcodeModel _deliveryitems;
  21. private Task _cache;
  22. public DeliveryModule()
  23. {
  24. InitializeComponent();
  25. _deliveryitems = new DeliveryItemBarcodeModel(App.Data, null);
  26. _cache = Task.Run(() => _deliveryitems.Refresh(false));
  27. }
  28. private void DeliveryScanner_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
  29. {
  30. Navigation.PushAsync(new FrameScanner(CoreUtils.FullGuid));
  31. // var scannerPage = new ScannerPage();
  32. // scannerPage.ItemScanned = async (e) =>
  33. // {
  34. // Device.BeginInvokeOnMainThread(() =>
  35. // {
  36. // ProgressVisible = true;
  37. // _cache.Wait();
  38. // var barcode = _deliveryitems.FirstOrDefault(x => String.Equals(x.Barcode, e.Text));
  39. // if (barcode != null)
  40. // Navigation.PushAsync(new FrameDetailsPage(barcode.ID));
  41. // else
  42. // DisplayAlert("ERROR", "Barcode not found!", "OK");
  43. // ProgressVisible = false;
  44. // });
  45. // };
  46. // Navigation.PushAsync(scannerPage);
  47. }
  48. private void DeliveryList_OnTapped(MobileModuleItem sender, ModuleMenuItemTappedArgs args)
  49. {
  50. Navigation.PushAsync(new DeliveryList());
  51. }
  52. }
  53. }