/// <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); }
public void RemoveHiddenNotif(HiddenNotification hnotif) { }
public void AddHiddenNotif(HiddenNotification hnotif) { }
public void RemoveHiddenNotif(HiddenNotification hnotif) { db.HiddenNotifications.Remove(hnotif); }
public void AddHiddenNotif(HiddenNotification hnotif) { db.HiddenNotifications.Add(hnotif); }