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)); }
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)); }