コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
        }