Bläddra i källkod

Moved Design Management and Renamed Site Requis to Picking Lists
Fixed Description and FormStarted columns in DigitalFormDashboard
Tweaked DigitalFormDashboad "SaveToFile" code

frogsoftware 1 år sedan
förälder
incheckning
4348802b94

+ 4 - 0
prs.classes/Entities/Manufacturing/ManufacturingPacket/ManufacturingPacketStage.cs

@@ -61,6 +61,10 @@ namespace Comal.Classes
         [EditorSequence(1)]
         [CodeEditor(Editable = Editable.Disabled)]
         public String Number { get; set; }
+        
+        [EditorSequence(2)]
+        [TextBoxEditor(Editable = Editable.Disabled)]
+        public String Description { get; set; }
 
         [EntityRelationship(DeleteAction.Cascade)]
         public ManufacturingSectionLink ManufacturingSectionLink { get; set; }

+ 22 - 26
prs.desktop/Dashboards/Common/DigitalFormsDashboard.xaml.cs

@@ -704,7 +704,7 @@ namespace PRSDesktop
 
         private void SaveToFolder_Click()
         {
-            if(Form is null || FormType is null)
+            if (Form is null || FormType is null)
             {
                 MessageWindow.ShowMessage("Please select a form first.", "Select form");
                 return;
@@ -715,23 +715,21 @@ namespace PRSDesktop
 
             var method = typeof(DigitalFormsDashboard).GetMethod("SaveToFolder", BindingFlags.Instance | BindingFlags.NonPublic)!.MakeGenericMethod(FormType);
 
-            var menu = new ContextMenu();
-            if(reports.Count == 1)
+            if (reports.Count == 0)
             {
-                method.Invoke(this, new object[] { reports[0] });
+                MessageWindow.ShowMessage("No reports are currently defined for this Digital Form!", "No report found");
                 return;
             }
-            else if(reports.Count > 1)
-            {
-                foreach (var report in reports)
-                {
-                    menu.AddItem(report.Name, null, report, r => method.Invoke(this, new[] { r }));
-                }
-            }
-            if(menu.Items.Count == 0)
+            
+            if(reports.Count == 1)
             {
-                menu.AddItem("No reports", null, null, enabled: false);
+                method.Invoke(this, new object[] { reports[0] });
+                return;
             }
+
+            var menu = new ContextMenu();
+            foreach (var report in reports)
+                menu.AddItem(report.Name, null, report, r => method.Invoke(this, new[] { r }));
             menu.IsOpen = true;
         }
 
@@ -1114,10 +1112,12 @@ namespace PRSDesktop
 
             var columns = new Columns<T>(x => x.ID)
                 .Add(x => x.Number)
+                .Add(x => x.Description)
                 .Add(x => x.CreatedBy)
                 .Add(x => x.Created)
                 .Add(x => x.Form.ID)
                 .Add(x => x.FormData)
+                .Add(x => x.FormStarted)
                 .Add(x => x.FormCompleted)
                 .Add(x => x.FormCompletedBy.UserID)
                 .Add(x => x.Location.Timestamp)
@@ -1157,12 +1157,8 @@ namespace PRSDesktop
             data.Columns.Add("Location_Longitude", typeof(double));
             data.Columns.Add("FormData", typeof(string));
             data.Columns.Add("Number", typeof(string));
-
-            if (IsEntityForm)
-            {
-                data.Columns.Add("Description", typeof(string));
-            }
-
+            data.Columns.Add("Description", typeof(string));
+            
             if (ParentType == typeof(JobITP))
             {
                 data.Columns.Add("Job No", typeof(string));
@@ -1236,10 +1232,8 @@ namespace PRSDesktop
                     dataRow["Location_Longitude"] = form.Location.Longitude;
                     dataRow["FormData"] = form.FormData;
                     dataRow["Number"] = form.Number;
-                    if (IsEntityForm && form is IEntityForm eForm)
-                    {
-                        dataRow["Description"] = eForm.Description;
-                    }
+                    dataRow["Description"] = form.Description;
+                    
 
                     var desc = new List<string>();
                     foreach (var col in additionalColumns)
@@ -1251,7 +1245,9 @@ namespace PRSDesktop
 
                     dataRow["Parent_Description"] = string.Join(" : ", desc);
 
-                    dataRow["Created"] = (form as Entity)!.Created;
+                    dataRow["Created"] = (form as Entity)!.Created.IsEmpty()
+                        ? form.FormStarted
+                        : (form as Entity)!.Created;
                     dataRow["Created By"] = (form as Entity)!.CreatedBy;
                     dataRow["Completed"] = form.FormCompleted;
                     dataRow["Completed By"] = form.FormCompletedBy.UserID;
@@ -1405,7 +1401,7 @@ namespace PRSDesktop
             }
             else if (value.Path.Path.Equals("Description"))
             {
-                e.Column.Width = 100;
+                e.Column.Width = 250;
                 e.Column.HeaderStyle = Application.Current.Resources["TemplateHeaderStyle"] as Style;
                 e.Column.TextAlignment = TextAlignment.Left;
                 e.Column.HorizontalHeaderContentAlignment = HorizontalAlignment.Left;
@@ -1439,7 +1435,7 @@ namespace PRSDesktop
                 e.Column.HeaderText = Categories.FirstOrDefault(x => x.Item2 == FormType)?.Item3 ?? "Parent";
                 e.Column.TextAlignment = TextAlignment.Left;
                 e.Column.HorizontalHeaderContentAlignment = HorizontalAlignment.Left;
-                e.Column.Width = 450;
+                e.Column.Width = 250;
                 e.Column.HeaderStyle = Application.Current.Resources["TemplateHeaderStyle"] as Style;
             }
             else if (value.Path.Path.Equals("Completed"))

+ 10 - 6
prs.desktop/MainWindow.xaml

@@ -272,9 +272,6 @@
                     <fluent:Button x:Name="ProjectPlannerButton" Header="Project Planner"
                                    LargeIcon="pack://application:,,,/Resources/calendar.png"
                                    Click="ProjectPlanner_Checked" MinWidth="60" />
-                    <fluent:Button x:Name="DesignManagementButton" Header="Design Management"
-                                   LargeIcon="pack://application:,,,/Resources/design.png"
-                                   Click="DesignManagement_Checked" MinWidth="60" />
                 </fluent:RibbonGroupBox>
 
                 <fluent:RibbonGroupBox x:Name="ProjectReports" Width="Auto" MinWidth="60" Header="Print" Visibility="Collapsed"/>
@@ -288,7 +285,8 @@
                     <fluent:Button Header="Refresh"
                                    LargeIcon="pack://application:,,,/Resources/refresh.png"
                                    Click="RefreshMenu_Click" MinWidth="60"/>
-                    <syncfusion:RibbonSeparator />
+
+                    <syncfusion:RibbonSeparator x:Name="ManufacturingTaskSeparator" />
                     <fluent:Button x:Name="ManufacturingDashboardButton" Header="Dashboards"
                                    LargeIcon="pack://application:,,,/Resources/kpi.png"
                                    Click="Dashboards_Checked" MinWidth="60" />
@@ -310,7 +308,13 @@
                                    Header="Daily Report"
                                    LargeIcon="pack://application:,,,/Resources/report.png"
                                    Click="DailyReport_Checked" MinWidth="60" />
-                    <syncfusion:RibbonSeparator x:Name="ManufacturingTaskSeparator" />
+                    
+                    <syncfusion:RibbonSeparator x:Name="ManufacturingDesignSeparator" />
+                    <fluent:Button x:Name="DesignManagementButton" Header="Design Management"
+                                   LargeIcon="pack://application:,,,/Resources/design.png"
+                                   Click="DesignManagement_Checked" MinWidth="60" />
+                    
+                    <syncfusion:RibbonSeparator x:Name="ManufacturingActionSeparator" />
                     <fluent:Button x:Name="FactoryStatusButton" Header="Manufacturing Status"
                                    LargeIcon="pack://application:,,,/Resources/factory.png"
                                    Click="ManufacturingMenu_Checked" MinWidth="60" />
@@ -383,7 +387,7 @@
                     <fluent:Button x:Name="DispatchButton" Header="Rack List"
                                    LargeIcon="pack://application:,,,/Resources/barcode.png"
                                    Click="DispatchMenu_Checked" MinWidth="60" />
-                    <fluent:Button x:Name="RequisitionsButton" Header="Site Requisitions"
+                    <fluent:Button x:Name="RequisitionsButton" Header="Picking Lists"
                                    LargeIcon="pack://application:,,,/Resources/box.png"
                                    Click="Requisitions_Checked" MinWidth="60" />
                     <fluent:Button x:Name="DeliveriesButton" Header="Deliveries"

+ 17 - 7
prs.desktop/MainWindow.xaml.cs

@@ -1055,7 +1055,17 @@ public partial class MainWindow : IPanelHostControl
         SetVisibility(ManufacturingMapButton, bMaps);
         SetVisibility(ManufacturingDailyReportButton,
             ClientFactory.IsSupported<TimeSheet, Assignment>() && Security.IsAllowed<CanViewDailyReports>());
-
+        
+        SetVisibleIfAny(ManufacturingTaskSeparator,
+            new FrameworkElement[]
+            {
+                ManufacturingDashboardButton, ManufacturingMessagesButton, ManufacturingTaskButton, ManufacturingAttendanceButton,
+                ManufacturingMapButton, ManufacturingDailyReportButton
+            });
+        
+        SetVisibility(DesignManagementButton, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopDesignManagementScreen>());
+        SetVisibility(ManufacturingDesignSeparator, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopDesignManagementScreen>());
+        
         SetVisibility(FactoryStatusButton,
             ClientFactory.IsSupported<ManufacturingFactory, ManufacturingPacket>()
             && Security.IsAllowed<CanViewFactoryStatus>()
@@ -1072,13 +1082,14 @@ public partial class MainWindow : IPanelHostControl
             && Security.IsAllowed<CanViewFactoryFloor>()
             && Security.IsAllowed<ViewDesktopFactoryFloorScreen>());
         //SetVisibility(FactoryReadyButton, ClientFactory.IsSupported<ManufacturingPacket>() && Security.IsAllowed<CanViewFactoryReadyToGo>());
-
-        SetVisibleIfEither(ManufacturingTaskSeparator,
+        
+        SetVisibleIfAny(ManufacturingActionSeparator,
             new FrameworkElement[]
             {
-                            ManufacturingDashboardButton, ManufacturingMessagesButton, ManufacturingTaskButton, ManufacturingAttendanceButton,
-                            ManufacturingMapButton, ManufacturingDailyReportButton
-            }, new FrameworkElement[] { FactoryStatusButton, FactoryAllocationButton, FactoryFloorButton /* , FactoryReadyButton */ });
+                FactoryStatusButton, FactoryAllocationButton, FactoryFloorButton
+            });
+        
+        
         SetVisibleIfAny(ManufacturingActions, ManufacturingDashboardButton, ManufacturingMessagesButton, ManufacturingTaskButton,
             ManufacturingAttendanceButton, ManufacturingDailyReportButton, FactoryStatusButton, FactoryAllocationButton,
             FactoryFloorButton);
@@ -1103,7 +1114,6 @@ public partial class MainWindow : IPanelHostControl
         SetVisibility(ProjectsButton, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopProjectsScreen>());
         SetVisibility(ServiceButton, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopServiceScreen>());
         SetVisibility(ProjectPlannerButton, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopProjectPlannerScreen>());
-        SetVisibility(DesignManagementButton, Security.CanView<Job>() && Security.IsAllowed<ViewDesktopDesignManagementScreen>());
 
         SetVisibleIfEither(ProjectTaskSeparator,
             new FrameworkElement[]

+ 0 - 1
prs.server/PRSServer.csproj

@@ -83,7 +83,6 @@
         <PackageReference Include="Syncfusion.Licensing" Version="23.2.7" />
         <PackageReference Include="Syncfusion.Pdf.Wpf" Version="23.2.7" />
         <PackageReference Include="Syncfusion.Shared.WPF.Classic" Version="19.4.0.56" />
-        <PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
         <PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
     </ItemGroup>
 

+ 1 - 0
prs.stores/EntityForms/EntityFormStore.cs

@@ -139,5 +139,6 @@ namespace Comal.Stores
         {
             
         }
+        
     }
 }