diff options
| author | Michael <[email protected]> | 2017-05-18 16:33:27 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-18 16:33:27 -0400 |
| commit | e4a501c0260458e99be9ac557df380a1aaf9e6b2 (patch) | |
| tree | 986cff94ba9e8e8e8c0572474e3d4ea28a67e465 /Project-Unite/Controllers/ManageController.cs | |
| parent | 1d8b307bb5790aa8c0040a76638f57f757cfb782 (diff) | |
| download | project-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.tar.gz project-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.tar.bz2 project-unite-e4a501c0260458e99be9ac557df380a1aaf9e6b2.zip | |
notifications page
Diffstat (limited to 'Project-Unite/Controllers/ManageController.cs')
| -rw-r--r-- | Project-Unite/Controllers/ManageController.cs | 13 |
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(); |
