예제 #1
0
 public ActionResult Edit(CommodityGrade commoditygrade)
 {
     if (ModelState.IsValid)
     {
         _commodityGradeService.EditCommodityGrade(commoditygrade);
         return(Json(new { success = true }));
         //return RedirectToAction("Index");
     }
     return(PartialView(commoditygrade));
 }
예제 #2
0
        public ActionResult CommodityGrade_Update([DataSourceRequest] DataSourceRequest request,
                                                  CommodityGradeViewModel commodityGradeViewModel)
        {
            if (commodityGradeViewModel != null && ModelState.IsValid)
            {
                var target         = _commodityGradeService.FindById(commodityGradeViewModel.CommodityGradeID);
                var commodityGrade = CommodityGradeViewModelBinder.BindCommodityGrade(commodityGradeViewModel, target);
                _commodityGradeService.EditCommodityGrade(commodityGrade);
            }

            return(Json(new[] { commodityGradeViewModel }.ToDataSourceResult(request, ModelState)));
        }