public JsonResult CreateOrUpdate(ArticleCategoryDto model) { if (model.Id == 0) { this.Create(model); } else { this.Update(model); } return(Json(1, JsonRequestBehavior.AllowGet)); }
public JsonResult CreateOrUpdate(ArticleCategoryDto model) { if (model.Id == 0) { this.Create(model); } else { this.Update(model); } return Json(1, JsonRequestBehavior.AllowGet); }
public ActionResult Edit(int? id) { ArticleCategoryDto model = null; if (!id.HasValue) //新建 { model = new ArticleCategoryDto(); } else //编辑 { model = _articlecategoryService.GetById(id.Value); } return View(model); }
public ActionResult Edit(int?id) { ArticleCategoryDto model = null; if (!id.HasValue) //新建 { model = new ArticleCategoryDto(); } else //编辑 { model = _articlecategoryService.GetById(id.Value); } return(View(model)); }
public ArticleCategory(ArticleCategoryDto articleCategoryDto) { Id = articleCategoryDto.Id; Name = articleCategoryDto.Name; Articles = articleCategoryDto.Articles; }
public JsonResult Update(ArticleCategoryDto model) { _articlecategoryService.Update(model); return Json(1, JsonRequestBehavior.AllowGet); }
public JsonResult Update(ArticleCategoryDto model) { _articlecategoryService.Update(model); return(Json(1, JsonRequestBehavior.AllowGet)); }
public void Update(ArticleCategoryDto model) { var entity = _articlecategoryRepository.GetById(model.Id); _articlecategoryRepository.Update(model.MapTo(entity)); }
public void Create(ArticleCategoryDto model) { _articlecategoryRepository.Insert(model.MapTo<ArticleCategory>()); }