Esempio n. 1
0
        public JsonResult Deletes(long [] ids)
        {
            var result = new JsonResultModel {
                ResultState = Notifys.DeleteNotifys(ids) > 0
            };

            return(Json(result));
        }
Esempio n. 2
0
        public JsonResult Delete(long id)
        {
            var result = new JsonResultModel {
                ResultState = Notifys.DeleteNotify(id) > 0
            };

            return(Json(result));
        }
Esempio n. 3
0
        public ActionResult Index(int?page)
        {
            int pageIndex = page.HasValue ? page.Value : 1;
            int pageSize = PageConfig.BackstagePageSize;
            int count, pageCount;
            var result = Notifys.NotifyInfosToVModels(Notifys.GetNotifyPageList(pageIndex, pageSize, null, null, out pageCount, out count));
            PagedList <NotifyVModel> pl = result.ToPagedList(pageIndex, pageSize);

            pl.TotalItemCount   = count;
            pl.CurrentPageIndex = pageIndex;
            return(View(pl));
        }
Esempio n. 4
0
        public JsonResult Add(NotifyVModel model)
        {
            var result = new JsonResultModel();

            if (ModelState.IsValid)
            {
                //add
                result.ResultState = Notifys.AddNotify(Notifys.NotifyVModelToInfo(model)) > 0;
            }
            else
            {
                result.ResultState = false;
                result.Message     = ModelStateHelper.GetAllErrorMessage(ModelState);
            }

            return(Json(result));
        }
Esempio n. 5
0
        protected void Page_Init(object sender, EventArgs e)
        {
            notifications = new List<Notifys>();
            NumUnread = 0;
            var nis = Lib.Data.NotificationInstance.FindNewForUser(Framework.Security.Manager.GetUser());

            foreach (var ni in nis)
            {
                var t = new Notifys
                {
                    notification = ni.Notification,
                    read = ni.Read.HasValue
                };

                if (!t.read)
                    NumUnread++;

                notifications.Add(t);
            }
        }
Esempio n. 6
0
        public ActionResult Edit(int id)
        {
            var model = Notifys.NotifyInfoToVModel(Notifys.GetNotifyInfo(id));

            return(View(model));
        }
Esempio n. 7
0
 void Start()
 {
     dataPath   = DataRader.GetPath() + "com." + Application.companyName + "." + Application.productName + "." + Notication.GetType().ToString() + "";
     Notication = DataRader.Load <Notifys>(dataPath);
 }