示例#1
0
        /// <summary>
        /// notification is marked as not hidden, checks to make sure notification
        /// isn't in hidden notification table, removes if necessary
        /// </summary>
        /// <param name="Notif">Notification to check</param>
        /// <returns>true if successful</returns>
        public Boolean CheckNotHidden(ClassNotification Notif)
        {
            var  idid = User.Identity.GetUserId();
            User user = db.Users.Where(a => a.IdentityID == idid).FirstOrDefault();

            Boolean rtn    = true;
            Boolean hidden = db.HiddenNotifications.Where(h => h.ClassNotificationID == Notif.ClassNotificationID && h.UsersID == user.UsersID).FirstOrDefault() != null;

            if (hidden)
            {
                HiddenNotification HiddenTemp = db.HiddenNotifications.Where(h => h.ClassNotificationID == Notif.ClassNotificationID && h.UsersID == user.UsersID).FirstOrDefault();
                db.RemoveHiddenNotif(HiddenTemp);
                db.SaveChanges();
            }
            return(rtn);
        }
示例#2
0
 public void RemoveHiddenNotif(HiddenNotification hnotif)
 {
 }
示例#3
0
 public void AddHiddenNotif(HiddenNotification hnotif)
 {
 }
示例#4
0
 public void RemoveHiddenNotif(HiddenNotification hnotif)
 {
     db.HiddenNotifications.Remove(hnotif);
 }
示例#5
0
 public void AddHiddenNotif(HiddenNotification hnotif)
 {
     db.HiddenNotifications.Add(hnotif);
 }