Browse Source

Fix to removal bug on In/Out board.

Kenric Nugteren 5 months ago
parent
commit
7c5a5c88c0
1 changed files with 9 additions and 2 deletions
  1. 9 2
      prs.desktop/Panels/Attendance/AttendancePanel.xaml.cs

+ 9 - 2
prs.desktop/Panels/Attendance/AttendancePanel.xaml.cs

@@ -698,8 +698,15 @@ namespace PRSDesktop
             var row = Employees.Rows.FirstOrDefault(r => r.Get<Employee, Guid>(c => c.ID) == id);
             if (row != null)
             {
-                var emp = new Employee { ID = id, ShowOnInOutBoard = include };
-                Client.Save(emp, include ? "Added To" : "Removed From" + " In/Out Board", (o, e) => { });
+                var emp = row.ToObject<Employee>();
+                emp.ShowOnInOutBoard = include;
+                Client.Save(emp, include ? "Added To" : "Removed From" + " In/Out Board", (o, e) =>
+                {
+                    if(e is not null)
+                    {
+                        CoreUtils.LogException(ClientFactory.UserID, e);
+                    }
+                });
                 row.Set<Employee, bool>(x => x.ShowOnInOutBoard, include);
                 model.Active = include;
             }