Ejemplo n.º 1
0
        //
        // GET: /SYSMNotify/
        /// <summary>
        /// 获取公告显示
        /// </summary>
        /// <returns></returns>
        public ActionResult GetTop5()
        {
            List <SYSMNotify> notifys = SYSMNotify.GetTop5BySort();

            if (notifys == null || notifys.Count <= 0)
            {
                return(Json("", JsonRequestBehavior.AllowGet));
            }
            return(Json(notifys, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ContentResult ToEdit(SYSMNotify notify)
        {
            notify.OperEdit = CurrentUser.UserName;
            int rtn = notify.EditByID();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("保存出错"));
        }
Ejemplo n.º 3
0
        public ContentResult ToAdd(SYSMNotify notify)
        {
            if (string.IsNullOrWhiteSpace(notify.Title))
            {
                return(Content("标题不能为空"));
            }
            if (RepeatHelper.NoRepeat("SYSMNotify", "Title", notify.Title, notify.ID) > 0)
            {
                return(Content("标题已存在"));
            }
            notify.OperCreate = CurrentUser.UserName;
            notify.DatCreate  = DateTime.Now;
            notify.DatEdit    = DateTime.Now;
            notify.OperEdit   = CurrentUser.UserName;
            int rtn = notify.InsertAndReturnIdentity();

            if (rtn > 0)
            {
                return(Content("ok"));
            }
            return(Content("添加出错"));
        }
Ejemplo n.º 4
0
        public ActionResult Edit(int id)
        {
            SYSMNotify notify = SYSMNotify.GetEntityByID(id);

            return(View(notify));
        }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            List <SYSMNotify> notify = SYSMNotify.GetBySort();

            return(View(notify));
        }