Ejemplo n.º 1
0
        public ActionResult GetNotification()
        {
            NotificationModels model       = new NotificationModels();
            string             currentUser = HttpContext.User.Identity.Name;
            int totalNotif            = notiSrv.Query.Where(p => p.CreateBy == currentUser && p.Status == 0).Count();
            IList <Notification> list = notiSrv.GetbyCurrent(currentUser, 15);

            model.Notifications     = list;
            model.totalNotification = totalNotif;
            return(View(model));
        }
        public ActionResult Create()
        {
            //Get the list category
            var Notification = new Notification();
            var model        = new NotificationModels();

            model.notification = Notification;
            var listype = _TypeNotifyService.GetTypeNotifys().ToSelectListItems(-1);

            model.ListType = listype;
            return(View(model));
        }
 public ActionResult Create(NotificationModels newNotification)
 {
     if (ModelState.IsValid)
     {
         newNotification.notification.IsDelete    = false;
         newNotification.notification.DateCreated = DateTime.Now;
         //Mapping to domain
         //Create Blog
         _NotificationService.CreateNotification(newNotification.notification);
         return(RedirectToAction("Index", "Notification"));
     }
     else
     {
         return(View("Create", newNotification));
     }
 }