From 016128611cf66501e811dca74f43a35d5385679c Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 24 Mar 2017 12:49:56 -0400 Subject: Add notification button and db column --- Project-Unite/ACL.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Project-Unite/ACL.cs') diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index 73636c7..77e6f1d 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -13,6 +13,15 @@ namespace Project_Unite { public static class ACL { + public static IHtmlString NotificationCount(this HtmlHelper hpr, string uid) + { + var db = new ApplicationDbContext(); + var usr = db.Users.FirstOrDefault(x => x.Id == uid); + if (usr == null) + return hpr.Raw("N/A"); + return hpr.Raw(usr.UnreadNotifications.ToString()); + } + public static IHtmlString NewestUser(this HtmlHelper hpr) { var db = new ApplicationDbContext(); -- cgit v1.2.3