Exemple #1
0
 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);
 }
Exemple #4
0
        public ActionResult Edit(int?id)
        {
            ArticleCategoryDto model = null;

            if (!id.HasValue)  //新建
            {
                model = new ArticleCategoryDto();
            }
            else  //编辑
            {
                model = _articlecategoryService.GetById(id.Value);
            }
            return(View(model));
        }
Exemple #5
0
 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);

        }
Exemple #7
0
 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>());
 }