Пример #1
0
        public JsonResult Get(PagerModel pager, AlertModel filters)
        {
            AlertServices service = new AlertServices();

            filters.To = SessionWeb.User.PersonId;
            var collection = service.Get(pager, filters);

            return(Json(collection, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult Total()
        {
            AlertServices alertServices = new AlertServices();
            PagerModel    pager         = new PagerModel(0, 1, "", "");
            AlertModel    filter        = new AlertModel();

            filter.Status = (int)AlertStatus.New;
            filter.To     = SessionWeb.User.PersonId;
            alertServices.Get(pager, filter);
            string res = pager.TotalRecords == 0 ? string.Format("<span id='alertTotal' class='badge badge-pink noti-icon-badge'>{0}</span>", pager.TotalRecords)
                : string.Format("<span id='alertTotal' class='badge badge-pink noti-icon-badge'>{0}</span>", pager.TotalRecords);

            return(Content(res));
        }
Пример #3
0
        public JsonResult GetTable(DatatableModel dt, AlertModel filters)
        {
            filters.To = SessionWeb.User.PersonId;
            AlertServices services = new AlertServices();
            PagerModel    pager    = dt.ToPager();

            filters.Body = dt.sSearch;

            var collection = services.Get(pager, filters);

            return(Json(new
            {
                status = UI.Status.Success,
                sEcho = dt.sEcho,
                iTotalRecords = pager.TotalRecords,
                iTotalDisplayRecords = pager.TotalRecords,
                aaData = collection
            }, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult LastAlerts()
        {
            AlertServices alertServices = new AlertServices();
            PagerModel    pager         = new PagerModel(0, 8, "CreatedAt", "desc");
            AlertModel    filter        = new AlertModel();

            filter.Status = (int)AlertStatus.New;
            filter.To     = SessionWeb.User.PersonId;

            List <AlertModel> lstAlert = alertServices.Get(pager, filter);
            string            resp     = "";

            foreach (AlertModel alert in lstAlert)
            {
                resp += string.Format("<a href='javascript:Main.MarkAsReaded({3});' id='alert_{3}' class='dropdown-item notify-item alert-item'>"
                                      + "<div class='notify-icon bg-info'><i class='mdi {1}'></i></div>"
                                      + "<p class='notify-details' style='white-space: normal'><small>{0}</small><small class='text-muted'>{2}</small></p>"
                                      + "</a>", alert.Body, alert.Icon, alert.TimeAgo, alert.AlertId);
            }

            return(Content(resp));
        }