public void setDeptNotificationStatusAsOld(int notificationID) { List <DeptNotification> nlist = context.DeptNotifications.Where(x => x.notificationID == notificationID).ToList(); if (nlist.Count > 0) { DeptNotification notification = nlist.First(); notification.status = "OLD"; context.SaveChanges(); } }
public void addDeptNotification(string staffID, string message, DateTime date) { DeptNotification notification = new DeptNotification(); notification.staffID = staffID; notification.message = message; notification.date = date; notification.status = "NEW"; context.DeptNotifications.Add(notification); context.SaveChanges(); }