summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-18 16:33:27 -0400
committerMichael <[email protected]>2017-05-18 16:33:27 -0400
commite4a501c0260458e99be9ac557df380a1aaf9e6b2 (patch)
tree986cff94ba9e8e8e8c0572474e3d4ea28a67e465 /Project-Unite/Controllers
parent1d8b307bb5790aa8c0040a76638f57f757cfb782 (diff)
downloadproject-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.tar.gz
project-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.tar.bz2
project-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.zip
notifications page
Diffstat (limited to 'Project-Unite/Controllers')
-rw-r--r--Project-Unite/Controllers/ManageController.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs
index c3d9921..d80cbcb 100644
--- a/Project-Unite/Controllers/ManageController.cs
+++ b/Project-Unite/Controllers/ManageController.cs
@@ -111,6 +111,19 @@ namespace Project_Unite.Controllers
}
}
+ public ActionResult MarkAllRead()
+ {
+ var db = new ApplicationDbContext();
+ string uid = User.Identity.GetUserId();
+ var unread = db.Notifications.Where(x => x.IsRead == false && x.UserId == uid);
+ foreach(var u in unread.ToArray())
+ {
+ u.IsRead = true;
+ }
+ db.SaveChanges();
+ return Redirect(Url.Action("Index", "Manage") + "#t_notifications");
+ }
+
public ActionResult Notification(string id, string url)
{
var db = new ApplicationDbContext();