Beispiel #1
0
        //NEW 2019 10-03 ------------------------------------------------------------------
        //判断标志位
        public void CheckFlag(PurchaseOrder purchaseOrder, MachineTypeStock machineTypeStock, StockStorage stockStorage)
        {
            try
            {
                int    flag    = GetFlag(purchaseOrder);
                int    already = GetAlready(purchaseOrder);
                object check   = GetTypeNumber(purchaseOrder);

                if (check == null)//机型库不存在此机型
                {
                    if (flag == 0)
                    {
                        AddStock(machineTypeStock, purchaseOrder);
                        flag++;
                        UpdateFlag(flag, purchaseOrder);
                        UpdateAlready(purchaseOrder);

                        //订货数量和到货数量相等
                        if (purchaseOrder.QuantityReceivedVal == purchaseOrder.QuantityVal)
                        {
                            UpdateState(purchaseOrder);//更改状态为"已入库"
                        }

                        func.MessageBox_StockStorage(stockStorage, true);
                    }
                    else if (flag > 0)
                    {
                        //订货数量和到货数量不等
                        if (purchaseOrder.QuantityReceivedVal != purchaseOrder.QuantityVal)
                        {
                            int result = purchaseOrder.QuantityReceivedVal - already;//到货数量减去已入库数量
                            UpdateStock(result, purchaseOrder);
                            UpdateAlready(result, purchaseOrder);
                            func.MessageBox_StockStorage(stockStorage, true);
                        }
                        else if (purchaseOrder.QuantityReceivedVal == purchaseOrder.QuantityVal) //订货数量和到货数量相等
                        {
                            int result = purchaseOrder.QuantityReceivedVal - already;            //到货数量减去已入库数量
                            UpdateStock(result, purchaseOrder);
                            UpdateAlready(result, purchaseOrder);
                            UpdateState(purchaseOrder);//更改状态为"已入库"
                            func.MessageBox_StockStorage(stockStorage, true);
                        }
                        flag++;
                        UpdateFlag(flag, purchaseOrder);//更新flag
                    }
                }
                else
                {
                    if (flag == 0)
                    {
                        UpdateStock(purchaseOrder.QuantityReceivedVal, purchaseOrder);//更改数量
                        flag++;
                        UpdateFlag(flag, purchaseOrder);
                        UpdateAlready(purchaseOrder);

                        //订货数量和到货数量相等
                        if (purchaseOrder.QuantityReceivedVal == purchaseOrder.QuantityVal)
                        {
                            UpdateState(purchaseOrder);//更改状态为"已入库"
                        }
                        func.MessageBox_StockStorage(stockStorage, true);
                    }
                    else if (flag > 0)
                    {
                        //订货数量和到货数量不等
                        if (purchaseOrder.QuantityReceivedVal != purchaseOrder.QuantityVal)
                        {
                            int result = purchaseOrder.QuantityReceivedVal - already;//到货数量减去已入库数量
                            UpdateStock(result, purchaseOrder);
                            UpdateAlready(result, purchaseOrder);
                            func.MessageBox_StockStorage(stockStorage, true);
                        }
                        else if (purchaseOrder.QuantityReceivedVal == purchaseOrder.QuantityVal) //订货数量和到货数量相等
                        {
                            int result = purchaseOrder.QuantityReceivedVal - already;            //到货数量减去已入库数量
                            UpdateStock(result, purchaseOrder);
                            UpdateAlready(result, purchaseOrder);
                            UpdateState(purchaseOrder);//更改状态为"已入库"
                            func.MessageBox_StockStorage(stockStorage, true);
                        }
                        flag++;
                        UpdateFlag(flag, purchaseOrder);//更新flag
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("未知型号或未选择行,请您核对", "错误提示", MessageBoxButton.OK);
            }
        }
Beispiel #2
0
 //StockStorage
 public void MessageBox_StockStorage(StockStorage stock, bool state)
 {
     stock.message.IsActive = state;
 }
Beispiel #3
0
 public StockRoomChangesService(StockStorage storage)
 {
     _storage = storage;
 }
Beispiel #4
0
 public StockArrivalChangesService(StockStorage storage)
 {
     _storage = storage;
 }
 public StockBalanceChangesService(StockStorage storage)
 {
     _storage = storage;
 }
 public StockConsumptionChangesService(StockStorage storage)
 {
     _storage = storage;
 }