public void AddStockList(long gsID, string boxCodeList) { GoodsSiteModel gsm = bllGs.GetModel(gsID); if (gsm == null) { return; } if (gsm.GoodsSiteStatus == EnumCellStatus.空料框.ToString()) { this.view.ShowMessage("空料框状态不允许修改库存信息,若需求更改库存请更改货位状态为非空料框状态!"); return; } List <View_StockModel> stockView = bllViewStock.GetModelListByGSID(gsID); char[] splitArr = { ',', ',' }; string[] stockListStr = boxCodeList.Split(splitArr); long stockID = 0; if (stockView == null || stockView.Count == 0)//没有增加stock { StockModel stock = new StockModel(); stock.GoodsSiteID = gsID; stock.IsFull = true; stockID = bllStock.Add(stock); } else//更新原有stock { stockID = stockView[0].StockID; } for (int i = 0; i < stockListStr.Length; i++) { StockListModel slm = new StockListModel(); slm.StockID = stockID; slm.MeterialboxCode = stockListStr[i]; slm.InHouseTime = DateTime.Now; bllStockList.Add(slm); } string reStr = ""; this.iStorageManage.AddGSOperRecord(this.currHouseName, new CellCoordModel(gsm.GoodsSiteRow, gsm.GoodsSiteColumn, gsm.GoodsSiteLayer), EnumGSOperateType.手动增加库存, "手动增加或者修改库存信息!", ref reStr); GetGSDetail(gsID); }
public void AddStockList(string stockID, string boxCodeList) { char[] splitArr = { ',', ',' }; string[] stockList = boxCodeList.Split(splitArr); StockModel sm = bllStock.GetModel(long.Parse(stockID)); if (sm == null)//没有库存信息 { return; } for (int i = 0; i < stockList.Length; i++) { StockListModel slm = new StockListModel(); slm.StockID = long.Parse(stockID); slm.MeterialboxCode = stockList[i]; slm.InHouseTime = DateTime.Now; bllStockList.Add(slm); } RefreshStockList(long.Parse(stockID)); }
public void AddStockList(long gsID, string boxCodeList) { List <View_StockModel> stockView = bllViewStock.GetModelListByGSID(gsID); if (stockView == null || stockView.Count == 0) { return; } char[] splitArr = { ',', ',' }; string[] stockListStr = boxCodeList.Split(splitArr); for (int i = 0; i < stockListStr.Length; i++) { StockListModel slm = new StockListModel(); slm.StockID = stockView[0].StockID; slm.MeterialboxCode = stockListStr[i]; slm.InHouseTime = DateTime.Now; bllStockList.Add(slm); } GetGSDetail(gsID); }
/// <summary> /// 添加库存 /// </summary> /// <param name="houseName">库房名称</param> /// <param name="cellCoord">货位位置</param> /// <param name="goodsInfo">库存信息</param> /// <param name="reStr">执行状态描述</param> /// <returns>执行状态结果</returns> public bool AddStack(string houseName, CellCoordModel cellCoord, string proBatch, string[] goodsInfo, ref string reStr) { StoreHouseModel houseModel = bllStoreHouse.GetModelByName(houseName); if (houseModel == null) { reStr = "不存在此库房!"; return(false); } GoodsSiteModel gsm = bllGoodsSite.GetModelByRCL(houseModel.StoreHouseID, cellCoord.Row, cellCoord.Col, cellCoord.Layer); if (gsm == null) { reStr = "不存在此库存!"; return(false); } if (goodsInfo == null) { reStr = "传入空货位信息!"; return(false); } StockModel sm = new StockModel(); sm.GoodsSiteID = gsm.GoodsSiteID; sm.IsFull = true; sm.TrayID = "12345678";//测试 long stockID = bllStock.Add(sm); for (int i = 0; i < goodsInfo.Length; i++) { StockListModel slm = new StockListModel(); slm.StockID = stockID; slm.InHouseTime = DateTime.Now; slm.MeterialBatch = proBatch; //暂时没有 slm.MeterialboxCode = goodsInfo[i]; slm.MeterialStatus = ""; //暂时没有赋值,若有库存详细应在此增加 long stockListID = bllStockList.Add(slm); StockDetailModel sdm = new StockDetailModel(); sdm.StockListID = stockListID; sdm.MeterialName = "电芯"; bllStockDetail.Add(sdm); } string goodsInforStr = ""; for (int i = 0; i < goodsInfo.Length; i++) { if (i == 0) { goodsInforStr += goodsInfo[i]; } else { goodsInforStr += "," + goodsInfo[i]; } } //string operateStr = "库房:" + houseName + ",货位:" + cellCoord.Row + "排" + cellCoord.Col + "列" // + cellCoord.Layer + "层," + "添加库存:" + goodsInforStr; //AddGSOperRecord(houseName, cellCoord, EnumGSOperateType.系统添加库存, operateStr, ref reStr); return(true); }