summaryrefslogtreecommitdiff
path: root/Project-Unite/ACL.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-24 12:49:56 -0400
committerMichael <[email protected]>2017-03-24 12:49:56 -0400
commit016128611cf66501e811dca74f43a35d5385679c (patch)
tree7349c14acbbb4e4aa38677fcff03d2ae4345081d /Project-Unite/ACL.cs
parentf7767a660c1ab2f5e98d7bf8ad0a7bc9eb801ddf (diff)
downloadproject-unite-016128611cf66501e811dca74f43a35d5385679c.tar.gz
project-unite-016128611cf66501e811dca74f43a35d5385679c.tar.bz2
project-unite-016128611cf66501e811dca74f43a35d5385679c.zip
Add notification button and db column
Diffstat (limited to 'Project-Unite/ACL.cs')
-rw-r--r--Project-Unite/ACL.cs9
1 files changed, 9 insertions, 0 deletions
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();