Forráskód Böngészése

Fix to KanbanStore

Kenric Nugteren 2 éve
szülő
commit
65751d5acc
1 módosított fájl, 15 hozzáadás és 8 törlés
  1. 15 8
      prs.stores/KanbanStore.cs

+ 15 - 8
prs.stores/KanbanStore.cs

@@ -53,14 +53,21 @@ namespace Comal.Stores
             }
             if (emps.Rows.Count == 0)
             {
-                Notification notification = new Notification();
-                notification.Employee.ID = entity.EmployeeLink.ID;
-                notification.Sender.ID = entity.ManagerLink.ID;
-                notification.Title = Subject;
-                notification.EntityType = typeof(Kanban).EntityName();
-                notification.EntityID = entity.ID;
-                notification.Description = BuildDescription(entity);
-                notifications.Add(notification);
+                var userID = Provider.Query(
+                    new Filter<Employee>(x => x.ID).IsEqualTo(entity.EmployeeLink.ID),
+                    new Columns<Employee>(x => x.UserLink.ID)
+                    ).Rows.FirstOrDefault()?.Get<Employee, Guid>(x => x.UserLink.ID);
+                if(userID != UserGuid)
+                {
+                    Notification notification = new Notification();
+                    notification.Employee.ID = entity.EmployeeLink.ID;
+                    notification.Sender.ID = entity.ManagerLink.ID;
+                    notification.Title = Subject;
+                    notification.EntityType = typeof(Kanban).EntityName();
+                    notification.EntityID = entity.ID;
+                    notification.Description = BuildDescription(entity);
+                    notifications.Add(notification);
+                }
             }
             if (notifications.Any())
                 FindSubStore<Notification>().Save(notifications, "");