public ActionResult InventoryDataDetails(int id) { var inventoryData = _inventoryDataService.GetById(id); var model = inventoryData.MapTo <InventoryData, InventoryDataModel>(); return(Json(new JsonResponse <string>(RenderPartialViewToString("InventoryDataPartial", model)))); }
public ActionResult Add(int id = 0) { if (id == 0) { SalesShipmentsDataModel model = new SalesShipmentsDataModel(); model.Date = DateTime.Now; model.ClientDataList = GetClientDataList(); model.WarehouseList = GetWarehouseList(); model.SpecificationList = GetSpecificationList(); model.GoodsTypeList = GetGoodsTypeList(); return(View(model)); } else { InventoryData inventoryData = _inventoryDataService.GetById(id); SalesShipmentsDataModel model = new SalesShipmentsDataModel() { WarehouseID = inventoryData.WarehouseID, WarehouseName = inventoryData.WarehouseName, GoodsID = inventoryData.GoodsID, GoodsName = inventoryData.GoodsName, Unit = inventoryData.Unit, Specification = inventoryData.Specification, GoodsType = inventoryData.GoodsType, Brand = inventoryData.Brand, Cost = inventoryData.CostPrice, InventoryDataID = inventoryData.ID, OldQuantity = inventoryData.InventoryQuantity }; model.Date = DateTime.Now; model.ClientDataList = GetClientDataList(); model.WarehouseList = GetWarehouseList(); model.SpecificationList = GetSpecificationList(); model.GoodsTypeList = GetGoodsTypeList(); return(View(model)); } }