Exemplo n.º 1
0
        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 });
            }
        }
Exemplo n.º 2
0
 public IHttpActionResult Update(UpdateArticleInputDto model)
 {
     _articleService.Update(model);
     return AjaxOk("修改成功");
 }