public ActionResult SaveForm(string keyValue, string strEntity, string strmes_BackSupplyDetailList) { if (!string.IsNullOrEmpty(keyValue)) { var entityTemp = mes_BackSupplyIBLL.GetMes_BackSupplyHeadEntity(keyValue); if (entityTemp.B_Status == ErpEnums.BackSupplyStatusEnum.Audit) { return(Fail("该单据已审核,不能修改!")); } } Mes_BackSupplyHeadEntity entity = strEntity.ToObject <Mes_BackSupplyHeadEntity>(); List <Mes_BackSupplyDetailEntity> mes_BackSupplyDetailList = strmes_BackSupplyDetailList.ToObject <List <Mes_BackSupplyDetailEntity> >(); foreach (Mes_BackSupplyDetailEntity item in mes_BackSupplyDetailList) { var itemEntity = inventorySeachBll.GetEntityBy(item.B_GoodsCode, entity.B_StockCode, item.B_Batch); if (item.B_Qty > itemEntity.I_Qty) { return(Fail("商品【" + item.B_GoodsName + "】的库存数量不足!")); } if (string.IsNullOrEmpty(item.B_Batch)) { return(Fail("商品【" + item.B_GoodsName + "】的批次不能为空!")); } } mes_BackSupplyIBLL.SaveEntity(keyValue, entity, mes_BackSupplyDetailList); return(Success("保存成功!")); }
public ActionResult SaveForm(string keyValue, string strEntity, string strmes_BackSupplyDetailList) { Mes_BackSupplyHeadEntity entity = strEntity.ToObject <Mes_BackSupplyHeadEntity>(); List <Mes_BackSupplyDetailEntity> mes_BackSupplyDetailList = strmes_BackSupplyDetailList.ToObject <List <Mes_BackSupplyDetailEntity> >(); mes_BackSupplyQueryIBLL.SaveEntity(keyValue, entity, mes_BackSupplyDetailList); return(Success("保存成功!")); }