public ActionResult Edit(int? id, UpdateArticleInputDto model) { if (Request["AllowComments"] != null) { model.AllowComments = true; } if (Request["Published"] != null) { model.Published = true; } if (!id.HasValue) { _articleService.Insert(model); return RedirectToAction("Index", "Article"); } else { _articleService.Update(model); return RedirectToAction("Edit", "Article", new { id = model.Id }); } }
public IHttpActionResult Update(UpdateArticleInputDto model) { _articleService.Update(model); return AjaxOk("修改成功"); }