Esempio n. 1
0
 public ActionResult Edit(CommoditySource commoditysource)
 {
     if (ModelState.IsValid)
     {
         _commoditySourceService.EditCommoditySource(commoditysource);
         return(Json(new { success = true }));
         //return RedirectToAction("Index");
     }
     return(PartialView(commoditysource));
 }
Esempio n. 2
0
        public ActionResult CommoditySource_Update([DataSourceRequest] DataSourceRequest request, CommoditySourceViewModel commoditySourceViewModel)
        {
            if (commoditySourceViewModel != null && ModelState.IsValid)
            {
                var target          = _commoditySourceService.FindById(commoditySourceViewModel.CommoditySourceID);
                var commoditySource = CommoditySourceViewModelBinder.BindCommoditySource(commoditySourceViewModel, target);
                _commoditySourceService.EditCommoditySource(commoditySource);
            }

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