示例#1
0
        public void AddTrayGoods(string trayCode, int goodsNum, string goodsCode)
        {
            if (trayCode.Trim() == "")
            {
                this.View.ShowMessage("信息提示", "请输入托盘条码!");
                return;
            }
            if (goodsNum == 0)
            {
                this.View.ShowMessage("信息提示", "请输入物料配盘数量!");
                return;
            }
            if (IsExistPalletGoods(goodsCode) == true)
            {
                this.View.ShowMessage("信息提示", "此物料已经在配盘中!");
                return;
            }
            View_GoodsModel goodsModel = bllViewGoods.GetModelByGoodsCode(goodsCode);

            if (goodsModel == null)
            {
                return;
            }
            PalletGoodsListModel tglm = new PalletGoodsListModel();

            tglm.单位   = goodsModel.Goods_Unit;
            tglm.规格型号 = goodsModel.Goods_Model;
            tglm.托盘条码 = trayCode;
            //tglm.生产日期 = createDatetime;
            tglm.数量   = goodsNum;
            tglm.物料编码 = goodsCode;

            ViewDataManager.PALLETMANAGEDATA.PalletInforData.Add(tglm);
        }
示例#2
0
        //private void IniPalletPos(string houseName)
        //{
        //    WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
        //    if (house == null)
        //    {

        //        return;
        //    }
        //    List<WH_Station_LogicModel> logicStaion = bllStationLogic.GetAllStation(house.WareHouse_ID);
        //    this.View.IniPalletPos(logicStaion);
        //}
        public void QueryPalletInfo(string palletCode, string palletCellName)
        {
            List <View_StockListModel> stockList = bllViewStockList.GetPalletStock(palletCode, palletCellName);

            ViewDataManager.PALLETMANAGEDATA.PalletInforData.Clear();
            if (stockList == null)
            {
                return;
            }
            foreach (View_StockListModel stock in stockList)
            {
                PalletGoodsListModel pallet = new PalletGoodsListModel();
                //pallet.保质期 = stock.Goods_Shelf_Life.ToString();
                pallet.单位   = stock.Goods_Unit;
                pallet.规格型号 = stock.Goods_Model;
                pallet.托盘条码 = stock.Stock_Tray_Barcode;
                //pallet.生产日期 = (DateTime)stock.Goods_ProduceDate;
                pallet.数量   = int.Parse(stock.Stock_List_Quantity);
                pallet.物料编码 = stock.Goods_Code;
                //pallet.计划列表编号 = stock.Plan_List_ID;

                //Plan_ListModel planListModel = bllPlanList.GetModel(stock.Plan_List_ID);
                //if(planListModel !=null )
                //{
                //    pallet.计划单号 = planListModel.Plan_ID;
                //}
                ViewDataManager.PALLETMANAGEDATA.PalletInforData.Add(pallet);
            }
        }
示例#3
0
 public void DeleteTrayGoods(string goodsCode)
 {
     for (int i = 0; i < ViewDataManager.PALLETMANAGEDATA.PalletInforData.Count; i++)
     {
         PalletGoodsListModel tglm = ViewDataManager.PALLETMANAGEDATA.PalletInforData[i];
         if (tglm.物料编码 == goodsCode)
         {
             ViewDataManager.PALLETMANAGEDATA.PalletInforData.Remove(tglm);
             break;
         }
     }
 }
示例#4
0
        public void TrayConfirm(bool isFull, string palletCode, string recCellName)
        {
            try
            {
                if (ViewDataManager.PALLETMANAGEDATA.PalletInforData.Count == 0)
                {
                    this.View.ShowMessage("信息提示", "请添加配盘物料!");
                    return;
                }
                //WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
                //if (house == null)
                //{

                //    return ;
                //}
                WH_CellModel cell = bllCell.GetStationByName(recCellName);

                //WH_Station_LogicModel cell = bllStationLogic.GetStationByName(house.WareHouse_ID,recCellName);
                if (cell == null)
                {
                    this.View.ShowMessage("信息提示", "配盘地点错误!");
                    return;
                }
                StockModel stockModel = bllStock.GetModelByTrayCode(palletCode);
                if (stockModel == null)
                {
                    this.View.ShowMessage("信息提示", "此托盘条码不在库存中!");
                    return;
                }
                stockModel.Cell_Child_ID      = cell.Cell_ID;
                stockModel.Stock_Tray_Barcode = palletCode;
                if (isFull == true)
                {
                    stockModel.Stock_Full_Flag = "1";
                }
                else
                {
                    stockModel.Stock_Full_Flag = "0";
                }

                bllStock.Update(stockModel);
                Stock_ListModel stockListTemp = bllStockList.GetModelByPalletCode(palletCode);
                if (stockListTemp == null)
                {
                    this.View.ShowMessage("信息提示", "此托盘中没有物料!");
                    return;
                }
                bllStockList.DeleteByStockID(stockModel.Stock_ID);
                for (int i = 0; i < ViewDataManager.PALLETMANAGEDATA.PalletInforData.Count; i++)
                {
                    Stock_ListModel stockList = new Stock_ListModel();
                    stockList.Stock_List_ID = Guid.NewGuid().ToString();
                    stockList.Stock_ID      = stockModel.Stock_ID;
                    PalletGoodsListModel trayGoodsModel = ViewDataManager.PALLETMANAGEDATA.PalletInforData[i];
                    GoodsModel           goods          = bllGoods.GetModelByCode(trayGoodsModel.物料编码);
                    if (goods == null)
                    {
                        continue;
                    }
                    stockList.Goods_ID               = goods.Goods_ID;
                    stockList.Plan_List_ID           = stockListTemp.Plan_List_ID;
                    stockList.Stock_List_Box_Barcode = palletCode;
                    stockList.Stock_List_Entry_Time  = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    stockList.Stock_List_Quantity    = trayGoodsModel.数量.ToString();
                    bllStockList.Add(stockList);
                }
                this.View.ShowMessage("信息提示", "配盘成功!");
                QueryPallet(currPalletPos, currPlanCode);
            }
            catch (Exception ex)
            {
                this.View.ShowMessage("信息提示", "配盘失败!" + ex.Message);
            }
        }