public IHttpActionResult Post([FromBody] NotificationVM model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            if (model == null)
            {
                return(NotFound());
            }
            var Notify = _hrUnitOfWork.NotificationRepository.GetAllNotifications(model.UserName, model.Language, model.CompanyId).AsQueryable();

            return(Ok(Notify));
        }
Esempio n. 2
0
        public IHttpActionResult NotificationCount([FromBody] NotificationVM model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            if (model == null)
            {
                return(NotFound());
            }

            var LetterCount = hrUnitOfWork.NotificationRepository.GetMyLetters(model.CompanyId, model.Language, model.EmpId).Count(l => l.read == false);
            var NotifyCount = hrUnitOfWork.NotificationRepository.GetAllNotifications(model.UserName, model.Language, model.CompanyId).Count(n => n.Read == false);

            return(Ok(new { NotifyCount = NotifyCount, LetterCount = LetterCount }));
        }