瀏覽代碼

Merge remote-tracking branch 'origin/kenric' into frank

Frank van den Bos 2 年之前
父節點
當前提交
965d140628

+ 6 - 4
prs.classes/Entities/Assignment/Assignment.cs

@@ -74,17 +74,19 @@ namespace Comal.Classes
         public TimeSpan Finish { get; set; }
         
         [EditorSequence(10)]
+        [CoreTimeEditor]
         public CoreTime Booked { get; set; }
-        
-        [EditorSequence("Completion",1)]
+
+        [EditorSequence(11)]
+        [CoreTimeEditor]
         public CoreTime Actual { get; set; }
         
         [TimestampEditor]
-        [EditorSequence("Completion",2)]
+        [EditorSequence(12)]
         public DateTime Completed { get; set; }
 
         [TimestampEditor]
-        [EditorSequence("Completion",3)]
+        [EditorSequence(13)]
         public DateTime Processed { get; set; }
 
         [NullEditor]

+ 13 - 9
prs.desktop/Components/Calendar/Calendar.xaml.cs

@@ -11,6 +11,7 @@ using Comal.Classes;
 using InABox.Clients;
 using InABox.Configuration;
 using InABox.Core;
+using InABox.DynamicGrid;
 using InABox.WPF;
 using Syncfusion.SfSkinManager;
 using Syncfusion.UI.Xaml.Scheduler;
@@ -1094,11 +1095,11 @@ namespace PRSDesktop
                         var comps = emp.Name.Split(' ');
                         var display = emp.Name;
                         if (colwidth < 75)
-                            display = string.Format("{0}{1}", comps.First().Substring(0, 1),
-                                comps.Length > 1 ? comps.Skip(1).First().Substring(0, 1).ToUpper() : "");
+                            display = string.Format("{0}{1}", comps[0].Length > 0 ? comps[0][..1] : "",
+                                comps.Length > 1 ? comps.Skip(1).First()[..1].ToUpper() : "");
                         else if (colwidth < 150)
                             display = string.Format("{0} {1}", comps.First(),
-                                comps.Length > 1 ? comps.Skip(1).First().Substring(0, 1).ToUpper() : "");
+                                comps.Length > 1 ? comps.Skip(1).First()[..1].ToUpper() : "");
                         resource.Name = display;
                     }
                 }
@@ -1125,10 +1126,9 @@ namespace PRSDesktop
                 var comps = emp.Name.Split(' ');
                 var display = emp.Name;
                 if (colwidth < 75)
-                    display = string.Format("{0}{1}", comps.First().Substring(0, 1),
-                        comps.Length > 1 ? comps.Skip(1).First().Substring(0, 1).ToUpper() : "");
+                    display = CoreUtils.Codify(emp.Name);
                 else if (colwidth < 150)
-                    display = string.Format("{0} {1}", comps.First(), comps.Length > 1 ? comps.Skip(1).First().Substring(0, 1).ToUpper() : "");
+                    display = string.Format("{0} {1}", comps.Length > 0 ? comps.First() : "", comps.Length > 1 ? comps.Skip(1).First().Substring(0, 1).ToUpper() : "");
                 resources.Add(new SchedulerResource { Name = display, Id = emp.ID.ToString() });
             }
 
@@ -1322,9 +1322,13 @@ namespace PRSDesktop
                 MessageBox.Show("Please select an entry first!");
                 return;
             }
-            
-            var ass = new Client<Assignment>().Load(new Filter<Assignment>(x => x.ID).IsEqualTo(model.ID)).FirstOrDefault();
-            if (CheckGrid(ref ag).EditItems(new[] { ass }))
+
+            var grid = CheckGrid(ref ag);
+
+
+            var ass = new Client<Assignment>().Query(new Filter<Assignment>(x => x.ID).IsEqualTo(model.ID), grid.LoadEditorColumns())
+                .ToObjects<Assignment>().FirstOrDefault();
+            if (grid.EditItems(new[] { ass }))
             {
                 ItemChanged?.Invoke(this, new CalendarDataDataEventArgs<Assignment>(ass));
                 Refresh();

+ 3 - 3
prs.shared/DatabaseUpdateScripts.cs

@@ -284,7 +284,7 @@ namespace PRS.Shared
                 while (iTimes < unprocessedtimesheets.Length)
                 { 
                     var deletions = unprocessedtimesheets.Skip(iTimes).Take(100).ToArray();
-                    DbFactory.Provider.Delete<TimeSheet>(deletions, "");
+                    DbFactory.Provider.Purge<TimeSheet>(deletions);
                     iTimes += deletions.Length;
                 }
                 //DbFactory.Provider.Delete<TimeSheet>(unprocessedtimesheets,"");
@@ -318,7 +318,7 @@ namespace PRS.Shared
                 while (iRequests < standardleaverequests.Length)
                 { 
                     var deletions = standardleaverequests.Skip(iRequests).Take(100).ToArray();
-                    DbFactory.Provider.Delete<LeaveRequest>(deletions, "");
+                    DbFactory.Provider.Purge<LeaveRequest>(deletions);
                     iRequests += deletions.Length;
                 }
                 
@@ -332,7 +332,7 @@ namespace PRS.Shared
                 while (iAssignments < leaveassignments.Length)
                 { 
                     var deletions = leaveassignments.Skip(iAssignments).Take(100).ToArray();
-                    DbFactory.Provider.Delete<Assignment>(deletions, "");
+                    DbFactory.Provider.Purge<Assignment>(deletions);
                     iAssignments += deletions.Length;
                 }