Warehousing2.xaml.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using comal.timesheets.CustomControls;
  2. using Comal.Classes;
  3. using InABox.Clients;
  4. using InABox.Core;
  5. using Plugin.Media;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Linq.Expressions;
  11. using System.Text;
  12. using System.Threading;
  13. using System.Threading.Tasks;
  14. using Xamarin.CommunityToolkit.Extensions;
  15. using Xamarin.CommunityToolkit.UI.Views;
  16. using Xamarin.Essentials;
  17. using Xamarin.Forms;
  18. using Xamarin.Forms.Xaml;
  19. using XF.Material.Forms.UI.Dialogs;
  20. using PRSSecurity = InABox.Core.Security;
  21. namespace comal.timesheets
  22. {
  23. [XamlCompilation(XamlCompilationOptions.Compile)]
  24. public partial class Warehousing2 : ContentPage
  25. {
  26. public Warehousing2 ()
  27. {
  28. InitializeComponent ();
  29. descriptionLbl3.Text = "View holdings or movements" + System.Environment.NewLine
  30. + "Use a holding for creating stock movements";
  31. receivalsDescriptionLbl.Text = "From incoming delivery " + System.Environment.NewLine
  32. + "Also receives stock items to PRS";
  33. }
  34. private void Receivals_Tapped(object sender, EventArgs e)
  35. {
  36. PurchaseOrderPage purchaseOrderPage = new PurchaseOrderPage();
  37. Navigation.PushAsync(purchaseOrderPage);
  38. }
  39. private void Frame0_Tapped(object sender, EventArgs e) //issue module
  40. {
  41. RecTrans recTrans = new RecTrans(StockMovementBatchType.Issue);
  42. Navigation.PushAsync(recTrans);
  43. }
  44. private void Frame1_Tapped(object sender, EventArgs e) //transfer module
  45. {
  46. RecTrans recTrans = new RecTrans(StockMovementBatchType.Transfer);
  47. Navigation.PushAsync(recTrans);
  48. }
  49. private void Frame2_Tapped(object sender, EventArgs e) //relocate
  50. {
  51. if (PRSSecurity.CanEdit<StockLocation>())
  52. {
  53. RelocatePage relocatePage = new RelocatePage();
  54. Navigation.PushAsync(relocatePage);
  55. }
  56. else
  57. {
  58. DisplayAlert("Not allowed", "Please check security setting: Can Edit Stock Locations", "OK");
  59. return;
  60. }
  61. }
  62. private void Frame3_Tapped(object sender, EventArgs e)
  63. {
  64. if (GlobalVariables.ProductsLoaded)
  65. {
  66. ProductList products = new ProductList(GlobalVariables.ProductShells);
  67. Navigation.PushAsync(products);
  68. }
  69. else
  70. {
  71. ProductList products = new ProductList();
  72. Navigation.PushAsync(products);
  73. }
  74. //if (ClientFactory.IsAllowed<CanViewStockLocations>())
  75. //{
  76. // if (GlobalVariables.ProductsLoaded)
  77. // {
  78. // ProductList products = new ProductList(GlobalVariables.ProductShells);
  79. // Navigation.PushAsync(products);
  80. // }
  81. // else
  82. // {
  83. // ProductList products = new ProductList();
  84. // Navigation.PushAsync(products);
  85. // }
  86. //}
  87. //else
  88. //{
  89. // DisplayAlert("Alert", "Your current security settings do not allow you to view this module"
  90. // + System.Environment.NewLine + "(Setting - Can View Stock Locations)", "OK");
  91. //}
  92. }
  93. private void Frame4_Tapped(object sender, EventArgs e)
  94. {
  95. WarehouseSelectionPage warehouseSelectionPage = new WarehouseSelectionPage();
  96. Navigation.PushAsync(warehouseSelectionPage);
  97. //if (ClientFactory.IsAllowed<CanViewStockMovements>())
  98. //{
  99. // WarehouseSelectionPage warehouseSelectionPage = new WarehouseSelectionPage();
  100. // Navigation.PushAsync(warehouseSelectionPage);
  101. //}
  102. //else
  103. //{
  104. // DisplayAlert("Alert", "Your current security settings do not allow you to view this module"
  105. // + System.Environment.NewLine + "(Setting - Can View Stock Movements)", "OK");
  106. //}
  107. }
  108. private void Frame5_Tapped(object sender, EventArgs e)
  109. {
  110. StocktakePage stocktakePage = new StocktakePage(Guid.Empty);
  111. Navigation.PushAsync(stocktakePage);
  112. }
  113. }
  114. }