public ActionResult Create() { SystemMessageInfoModel model = new SystemMessageInfoModel(); return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }
public ActionResult Details(Guid id) { SystemMessageInfoModel model = new SystemMessageInfoModel(); var info = service.GetById(id); model.Content = info.Content; model.Title = info.Title; return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model)); }
public ActionResult Delete(Guid id) { SystemMessageInfoModel model = new SystemMessageInfoModel(); var info = service.GetById(id); if (info != null) { service.Delete(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View()); }
public ActionResult Edit(SystemMessageInfoModel model) { if (ModelState.IsValid) { SystemMessageInfo info = service.GetById(model.Id); info.Title = model.Title; info.Content = model.Content; service.Update(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model)); }
public ActionResult Create(SystemMessageInfoModel model) { if (ModelState.IsValid) { SystemMessageInfo info = new SystemMessageInfo(); info.Id = Guid.NewGuid(); info.Title = model.Title; info.Content = model.Content; service.Add(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }