예제 #1
0
        public ActionResult NotificationDelete2(Guid?id)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            //CHECK PERMISSIONS
            T_OE_USER_NOTIFICATION n = db_EECIP.GetT_OE_USER_NOTIFICATION_byID(id);

            if (n != null)
            {
                if (User.IsInRole("Admins") || UserIDX == n.USER_IDX)
                {
                    int SuccID = db_EECIP.DeleteT_OE_NOTIFICATION(id.ConvertOrDefault <Guid>());
                    if (SuccID > 0)
                    {
                        TempData["Success"] = "Deleted";
                    }
                    else
                    {
                        TempData["Error"] = "Unable to delete notification";
                    }
                }
            }

            return(RedirectToAction("Notifications", "Account"));
        }
예제 #2
0
        public JsonResult NotificationRead(Guid?id)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            //CHECK PERMISSIONS
            T_OE_USER_NOTIFICATION n = db_EECIP.GetT_OE_USER_NOTIFICATION_byID(id);

            if (n != null)
            {
                if (User.IsInRole("Admins") || UserIDX == n.USER_IDX)
                {
                    Guid?SuccID = db_EECIP.InsertUpdateT_OE_USER_NOTIFICATION(n.NOTIFICATION_IDX, n.USER_IDX, null, null, null, null, true, null, true, null, false);
                    if (SuccID != null)
                    {
                        return(Json(new { msg = "Success" }));
                    }
                }
            }

            //return ERROR
            return(Json(new { msg = "Unable to mark read." }));
        }