Exemplo n.º 1
0
        public IActionResult Index()
        {
            var idUser = _userTable.GetUserId(HttpContext.User.Identity.Name);
            var model  = new NotificationViewModel()
            {
                ProjectRequests     = _projectTable.GetUserProjectRequestsByUserId(idUser),
                ReadNotifications   = _notificationTable.GetReadNotifiactionsByUserId(idUser).OrderByDescending(n => n.IdNotification),
                UnreadNotifications = _notificationTable.GetUnreadNotifiactionsByUserId(idUser).OrderByDescending(n => n.IdNotification),
                NotificationSetting = _userTable.GetSettingsbyUserId(_userTable.GetUserId(HttpContext.User.Identity.Name)).Notifications == "1"
            };

            return(View(model));
        }