| | |
| | | using System.Drawing.Printing; |
| | | using System.Linq.Expressions; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IRecordService; |
| | | |
| | | namespace WIDESEA_StorageBasicService; |
| | | |
| | | public class VV_StockInfoService : ServiceBase<VV_StockInfo, IVV_StockInfoRepository>, IVV_StockInfoService |
| | | { |
| | | public VV_StockInfoService(IVV_StockInfoRepository BaseDal) : base(BaseDal) |
| | | private readonly IDt_PalletStockInfoRepository _repository; |
| | | private readonly IStockQuantityChangeRecordService _stockQuantityChangeRecord; |
| | | public VV_StockInfoService(IVV_StockInfoRepository BaseDal, IDt_PalletStockInfoRepository repository, IStockQuantityChangeRecordService stockQuantityChangeRecord) : base(BaseDal) |
| | | { |
| | | _repository = repository; |
| | | _stockQuantityChangeRecord = stockQuantityChangeRecord; |
| | | } |
| | | |
| | | public WebResponseContent stockLock(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | foreach (var item in keys) |
| | | { |
| | | var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item)); |
| | | if (stock.LockOrder != 1){ |
| | | stock.StockStatus = 1; |
| | | _repository.UpdateData(stock); |
| | | } |
| | | |
| | | } |
| | | return content.OK("閿佸畾鎴愬姛!"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return content.Error(e.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | public WebResponseContent stockUnLock(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | foreach (var item in keys) |
| | | { |
| | | var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item)); |
| | | stock.StockStatus = 0; |
| | | _repository.UpdateData(stock); |
| | | |
| | | } |
| | | return content.OK("瑙i攣鎴愬姛!"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return content.Error(e.Message); |
| | | } |
| | | |
| | | } |
| | | } |