public ActionResult _Read([DataSourceRequest] DataSourceRequest request)
        {
            DashboardNotificationsRepository modelRepo = new DashboardNotificationsRepository();
            DataSourceResult result = modelRepo.ReadAll().ToDataSourceResult(request);

            return(Json(result));
        }
Esempio n. 2
0
        public ActionResult DeleteDismissedNotifications(string secret)
        {
            if (secret == "M@nvF@t@123")
            {
                DashboardNotificationsRepository modelRepo = new DashboardNotificationsRepository();
                modelRepo.DeleteDismissedNotifications();

                return(Json("DeleteDismissedNotifications DONE", JsonRequestBehavior.AllowGet));
            }

            return(Json("Wrong Password", JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public ActionResult CreateRecurringNotifications(string secret)
        {
            if (secret == "M@nvF@t@123")
            {
                DashboardNotificationsRepository modelRepo = new DashboardNotificationsRepository();
                modelRepo.CreateRecurringNotifications(this);

                return(Json("CreateRecurringNotifications DONE", JsonRequestBehavior.AllowGet));
            }

            return(Json("Wrong Password", JsonRequestBehavior.AllowGet));
        }
        public ActionResult _Destroy([DataSourceRequest] DataSourceRequest request, DashboardNotificationExt model)
        {
            string Msg = "";


            DashboardNotificationsRepository modelRepo = new DashboardNotificationsRepository();

            if (modelRepo.Delete(model, ref Msg, this) == false)
            {
                return(this.Json(new DataSourceResult {
                    Errors = Msg
                }));
            }

            return(Json(request));
        }
        public ActionResult _Update([DataSourceRequest] DataSourceRequest request, DashboardNotificationExt model)
        {
            if (ModelState.IsValid)
            {
                string Msg = "";

                DashboardNotificationsRepository modelRepo = new DashboardNotificationsRepository();
                if (modelRepo.CreateOrUpdate(model, ref Msg, this) == false)
                {
                    return(this.Json(new DataSourceResult {
                        Errors = Msg
                    }));
                }
            }
            else
            {
                string error = ErrorHandling.HandleModelStateErrors(ModelState);
                return(this.Json(new DataSourceResult {
                    Errors = error
                }));
            }
            return(Json(request));
        }