Exemplo n.º 1
0
 public ActionResult Add(GoodsDataModel model)
 {
     if (ModelState.IsValid)
     {
         GoodsData Goods = model.MapTo <GoodsDataModel, GoodsData>();
         _goodsDataService.Insert(Goods);
         return(RedirectToAction("Index"));
     }
     model.WarehouseList = GetWarehouseList();
     model.GoodTypeList  = _commonController.GetGoodsTypeList();
     return(View(model));
 }
Exemplo n.º 2
0
 public ActionResult Edit(GoodsDataModel model)
 {
     if (ModelState.IsValid)
     {
         GoodsData goodsData = model.MapTo <GoodsDataModel, GoodsData>();
         _goodsDataService.Update(goodsData);
         SuccessNotification($"{_localizationService.GetResource("UpdateSuccess") + model.GoodsName}");
         return(RedirectToAction("Index"));
     }
     model.WarehouseList = GetWarehouseList();
     model.GoodTypeList  = _commonController.GetGoodsTypeList();
     return(View(model));
 }