// // 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)); }
public ContentResult ToEdit(SYSMNotify notify) { notify.OperEdit = CurrentUser.UserName; int rtn = notify.EditByID(); if (rtn > 0) { return(Content("ok")); } return(Content("保存出错")); }
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("添加出错")); }
public ActionResult Edit(int id) { SYSMNotify notify = SYSMNotify.GetEntityByID(id); return(View(notify)); }
public ActionResult Index() { List <SYSMNotify> notify = SYSMNotify.GetBySort(); return(View(notify)); }