| | |
| | | { |
| | | private readonly IMapper _mapper; |
| | | public IInventoryBatchRepository Repository => BaseDal; |
| | | public IInventoryInfoRepository _inventoryInfoRepository; |
| | | |
| | | public InventoryBatchService(IInventoryBatchRepository BaseDal, IMapper mapper) : base(BaseDal) |
| | | public InventoryBatchService(IInventoryBatchRepository BaseDal, IInventoryInfoRepository inventoryInfoRepository, IMapper mapper) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _inventoryInfoRepository = inventoryInfoRepository; |
| | | } |
| | | public List<Dt_Inventory_Batch> GetInventoryBatch(string materielCode) |
| | | { |
| | | List<Dt_Inventory_Batch> dt_Inventories = BaseDal.QueryData(x => x.MaterielCode == materielCode); |
| | | return dt_Inventories; |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | var productStatus = saveModel.MainData["productStatus"].ObjToInt(); |
| | | var batchNo = saveModel.MainData["batchNo"].ToString(); |
| | | List<Dt_InventoryInfo> inventoryInfos = _inventoryInfoRepository.QueryData(x => x.BatchNo == batchNo); |
| | | inventoryInfos.ForEach(x => |
| | | { |
| | | x.ProductStatus = productStatus; |
| | | }); |
| | | _inventoryInfoRepository.UpdateData(inventoryInfos); |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | } |
| | | } |