public ActionResult Create(Guid OnlineCommentsId) { OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel(); model.OnlineCommentsId = OnlineCommentsId; return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }
public ActionResult Details(Guid id) { OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel(); var info = service.GetById(id); model.UserId = info.UserId; model.OnlineCommentsId = info.OnlineCommentsId; model.UserName = info.UserName; model.Content = info.Content; return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model)); }
public ActionResult Delete(Guid id) { OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel(); var info = service.GetById(id); if (info != null) { service.Delete(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View()); }
public ActionResult Edit(OnlineCommentsOpinionModel model) { if (ModelState.IsValid) { OnlineCommentsOpinion info = service.GetById(model.Id); info.UserId = model.UserId; info.OnlineCommentsId = model.OnlineCommentsId; info.UserName = model.UserName; 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(OnlineCommentsOpinionModel model) { if (ModelState.IsValid) { OnlineCommentsOpinion info = new OnlineCommentsOpinion(); info.Id = Guid.NewGuid(); info.UserId = model.UserId; info.OnlineCommentsId = model.OnlineCommentsId; info.UserName = model.UserName; info.Content = model.Content; service.Add(info); return(Json(new AjaxResult() { Result = Result.Success })); } return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model)); }