Exemple #1
0
 public ContentResult ToDel(int id)
 {
     if (SYSNotify.DeleteByID(id) > 0)
     {
         return(Content("ok"));
     }
     return(Content("删除出错"));
 }
Exemple #2
0
        public ContentResult ToDels(int[] ids)
        {
            bool rtn = SYSNotify.ToDels(ids);

            if (rtn)
            {
                return(Content("ok"));
            }
            else
            {
                return(Content("操作失败,网络异常"));
            }
        }
Exemple #3
0
        public ContentResult ToEdit(SYSNotify para)
        {
            if (string.IsNullOrWhiteSpace(para.MsgType))
            {
                return(Content("消息类别不能为空"));
            }
            if (string.IsNullOrWhiteSpace(para.MsgCode))
            {
                return(Content("消息代号不能为空"));
            }
            if (RepeatHelper.NoRepeat("SYSNotify", "MsgCode", para.MsgCode, para.ID) > 0)
            {
                return(Content("消息代号已存在"));
            }
            int rtn = para.EditByID();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("保存出错"));
        }
Exemple #4
0
        public ContentResult ToAdd(SYSNotify para)
        {
            if (string.IsNullOrWhiteSpace(para.MsgType))
            {
                return(Content("消息类别不能为空"));
            }
            if (string.IsNullOrWhiteSpace(para.MsgCode))
            {
                return(Content("消息代号不能为空"));
            }
            if (RepeatHelper.NoRepeat("SYSNotify", "MsgCode", para.MsgCode, para.ID) > 0)
            {
                return(Content("消息代号已存在"));
            }
            int rtn = para.InsertAndReturnIdentity();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("添加出错"));
        }
Exemple #5
0
        public ActionResult SubscriberByID(int id, int type)
        {
            int rtn = SYSNotify.SubscriberByID(id, CurrentUser.UserName, type);

            return(Content(rtn > 0 ? "ok" : "订阅失败"));
        }
Exemple #6
0
        public ActionResult Edit(int id)
        {
            SYSNotify para = SYSNotify.GetEntityByID(id);

            return(View(para));
        }