Procházet zdrojové kódy

Cleaned Up Logistics Tab Setup options

frogsoftware před 1 rokem
rodič
revize
7fc43a1b3a

+ 2 - 22
prs.desktop/MainWindow.xaml.cs

@@ -659,6 +659,7 @@ namespace PRSDesktop
         }
         }
         private SetupActionItem AddSetupAction(Fluent.RibbonTabItem tab, string header, Action action, Bitmap? image)
         private SetupActionItem AddSetupAction(Fluent.RibbonTabItem tab, string header, Action action, Bitmap? image)
             => AddSetupAction(GetSetupActionList(tab), header, action, image);
             => AddSetupAction(GetSetupActionList(tab), header, action, image);
+        
         private SetupActionItem? AddSetupAction(Fluent.RibbonTabItem tab, string header, Action action, Bitmap? image, bool canView)
         private SetupActionItem? AddSetupAction(Fluent.RibbonTabItem tab, string header, Action action, Bitmap? image, bool canView)
         {
         {
             if (!canView)
             if (!canView)
@@ -1210,12 +1211,7 @@ namespace PRSDesktop
                 new FrameworkElement[] { ConsignmentButton });
                 new FrameworkElement[] { ConsignmentButton });
 
 
             
             
-            AddSetupAction(LogisticsTab, "Requisition Destinations", RequisitionDestinations_Click, PRSDesktop.Resources.milestone,
-                Security.CanView<RequisitionDestination>());
-            AddSetupAction(LogisticsTab, "Delivery Types", DeliveryTypesButton_Click, PRSDesktop.Resources.truck,
-                Security.CanView<ConsignmentType>());
-            AddSetupAction(LogisticsTab, "Consignment Types", ConsignmentTypesButton_Click, PRSDesktop.Resources.service,
-                Security.CanView<DeliveryType>());
+
 
 
             //LogisticsActions.IsLauncherButtonVisible = Security.IsAllowed<CanCustomiseModules>();
             //LogisticsActions.IsLauncherButtonVisible = Security.IsAllowed<CanCustomiseModules>();
             //LogisticsReports.IsLauncherButtonVisible = Security.IsAllowed<CanDesignReports>();
             //LogisticsReports.IsLauncherButtonVisible = Security.IsAllowed<CanDesignReports>();
@@ -2844,29 +2840,13 @@ namespace PRSDesktop
             LoadWindow<ConsignmentsPanel>((Fluent.Button)sender);
             LoadWindow<ConsignmentsPanel>((Fluent.Button)sender);
         }
         }
 
 
-        private void ConsignmentTypesButton_Click()
-        {
-            var list = new MasterList(typeof(ConsignmentType));
-            list.ShowDialog();
-        }
-
         private void PurchaseOrderCategoriesButton_Click()
         private void PurchaseOrderCategoriesButton_Click()
         {
         {
             var list = new MasterList(typeof(PurchaseOrderCategory));
             var list = new MasterList(typeof(PurchaseOrderCategory));
             list.ShowDialog();
             list.ShowDialog();
         }
         }
         
         
-        private void RequisitionDestinations_Click()
-        {
-            var list = new MasterList(typeof(RequisitionDestination));
-            list.ShowDialog();
-        }
         
         
-        private void DeliveryTypesButton_Click()
-        {
-            var list = new MasterList(typeof(DeliveryType));
-            list.ShowDialog();
-        }
 
 
         private void ConfigureModules_Click(object sender, RoutedEventArgs e)
         private void ConfigureModules_Click(object sender, RoutedEventArgs e)
         {
         {

+ 13 - 0
prs.desktop/Panels/Consignments/ConsignmentsPanel.xaml.cs

@@ -62,6 +62,19 @@ namespace PRSDesktop
 
 
         public void CreateToolbarButtons(IPanelHost host)
         public void CreateToolbarButtons(IPanelHost host)
         {
         {
+            if (Security.CanView<ConsignmentType>())
+            {
+                host.CreateSetupAction(new PanelAction
+                {
+                    Caption = "Consignment Types",
+                    Image = PRSDesktop.Resources.service,
+                    OnExecute = (action) =>
+                    {
+                        var list = new MasterList(typeof(ConsignmentType));
+                        list.ShowDialog();
+                    }
+                });
+            }
         }
         }
 
 
         public string SectionName => "Consignments";
         public string SectionName => "Consignments";

+ 15 - 0
prs.desktop/Panels/Delivery/DeliveryPanel.xaml.cs

@@ -72,6 +72,21 @@ namespace PRSDesktop
 
 
         public void CreateToolbarButtons(IPanelHost host)
         public void CreateToolbarButtons(IPanelHost host)
         {
         {
+            
+            if (Security.CanView<DeliveryType>())
+            {
+                host.CreateSetupAction(new PanelAction
+                {
+                    Caption = "Delivery Types",
+                    Image = PRSDesktop.Resources.truck,
+                    OnExecute = (action) =>
+                    {
+                        var list = new MasterList(typeof(DeliveryType));
+                        list.ShowDialog();
+                    }
+                });
+            }
+            
             if (Security.IsAllowed<CanCompleteDeliveries>())
             if (Security.IsAllowed<CanCompleteDeliveries>())
                 host.CreatePanelAction(new PanelAction
                 host.CreatePanelAction(new PanelAction
                     { Caption = "Mark As Delivered", Image = PRSDesktop.Resources.barcode, OnExecute = MarkAsDelivered });
                     { Caption = "Mark As Delivered", Image = PRSDesktop.Resources.barcode, OnExecute = MarkAsDelivered });

+ 13 - 0
prs.desktop/Panels/Requisitions/RequisitionPanel.xaml.cs

@@ -133,6 +133,19 @@ public partial class RequisitionPanel : UserControl, IPanel<Requisition>
 
 
     public void CreateToolbarButtons(IPanelHost host)
     public void CreateToolbarButtons(IPanelHost host)
     {
     {
+        if (Security.CanView<RequisitionDestination>())
+        {
+            host.CreateSetupAction(new PanelAction
+            {
+                Caption = "Requisition Destinations",
+                Image = PRSDesktop.Resources.truck,
+                OnExecute = (action) =>
+                {
+                    var list = new MasterList(typeof(RequisitionDestination));
+                    list.ShowDialog();
+                }
+            });
+        }
         //host.CreatePanelAction(new PanelAction() { Caption = "Archive Requisition", Image = PRSDesktop.Resources.delete, OnExecute = ArchiveRequisition });
         //host.CreatePanelAction(new PanelAction() { Caption = "Archive Requisition", Image = PRSDesktop.Resources.delete, OnExecute = ArchiveRequisition });
     }
     }