Esempio n. 1
0
        private void OpenBill(string strTag)
        {
            DataRow dr;

            switch (strTag)
            {
            case "ApplyStock":
                if (gvApplyStock.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvApplyStock.GetDataRow(gvApplyStock.FocusedRowHandle);
                Stock.frmApplyStock myApplyStock = new Stock.frmApplyStock();
                myApplyStock.strBillID = dr["F_BillID"].ToString();
                myApplyStock.ShowDialog();
                myApplyStock.Dispose();
                break;

            case "StockOrder":
                if (gvStockOrder.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvStockOrder.GetDataRow(gvStockOrder.FocusedRowHandle);
                Stock.frmStockOrder myStockOrder = new Stock.frmStockOrder();
                myStockOrder.strBillID = dr["F_BillID"].ToString();
                myStockOrder.ShowDialog();
                myStockOrder.Dispose();
                break;

            case "StockOrder1":
                if (gvStockOrder1.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvStockOrder1.GetDataRow(gvStockOrder1.FocusedRowHandle);
                Stock.frmStockOrder myStockOrder1 = new Stock.frmStockOrder();
                myStockOrder1.strBillID = dr["F_BillID"].ToString();
                myStockOrder1.ShowDialog();
                myStockOrder1.Dispose();
                break;

            case "StockIn":
                if (gvStockIn.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvStockIn.GetDataRow(gvStockIn.FocusedRowHandle);
                Stock.frmStockIn myStockIn = new Stock.frmStockIn();
                myStockIn.strBillID = dr["F_BillID"].ToString();
                myStockIn.ShowDialog();
                myStockIn.Dispose();
                break;

            case "StockPay":
                if (gvPay.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvPay.GetDataRow(gvPay.FocusedRowHandle);
                Stock.frmStockPay myStockPay = new Stock.frmStockPay();
                myStockPay.strBillID = dr["F_BillID"].ToString();
                myStockPay.ShowDialog();
                myStockPay.Dispose();
                break;

            case "StockBack":
                if (gvStockBack.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvStockBack.GetDataRow(gvStockBack.FocusedRowHandle);
                Stock.frmStockBack myStockBack = new Stock.frmStockBack();
                myStockBack.strBillID = dr["F_BillID"].ToString();
                myStockBack.ShowDialog();
                myStockBack.Dispose();
                break;

            case "AskPrice":
                if (gvAskPrice.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvAskPrice.GetDataRow(gvAskPrice.FocusedRowHandle);
                Sell.frmAskPrice myAskPrice = new Sell.frmAskPrice();
                myAskPrice.strBillID = dr["F_BillID"].ToString();
                myAskPrice.ShowDialog();
                myAskPrice.Dispose();
                break;

            case "SellPrice":
                if (gvSellPrice.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellPrice.GetDataRow(gvSellPrice.FocusedRowHandle);

                Sell.frmSellPrice mySellPrice = new Sell.frmSellPrice();
                mySellPrice.strBillID = dr["F_BillID"].ToString();
                mySellPrice.ShowDialog();
                mySellPrice.Dispose();
                break;

            case "SellOrder":
                if (gvSellOrder.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellOrder.GetDataRow(gvSellOrder.FocusedRowHandle);
                Sell.frmSellOrder mySellOrder = new Sell.frmSellOrder();
                mySellOrder.strBillID = dr["F_BillID"].ToString();
                mySellOrder.ShowDialog();
                mySellOrder.Dispose();
                break;

            case "SellOrder1":
                if (gvSellOrder1.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellOrder1.GetDataRow(gvSellOrder1.FocusedRowHandle);
                Sell.frmSellOrder mySellOrder1 = new Sell.frmSellOrder();
                mySellOrder1.strBillID = dr["F_BillID"].ToString();
                mySellOrder1.ShowDialog();
                mySellOrder1.Dispose();
                break;

            case "SellPre":
                if (gvSellPre.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellPre.GetDataRow(gvSellPre.FocusedRowHandle);
                Sell.frmSellPre mySellPre = new Sell.frmSellPre();
                mySellPre.strBillID = dr["F_BillID"].ToString();
                mySellPre.ShowDialog();
                mySellPre.Dispose();
                break;

            case "SellOut":
                if (gvSellOut.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellOut.GetDataRow(gvSellOut.FocusedRowHandle);
                Sell.frmSellOut mySellOut = new Sell.frmSellOut();
                mySellOut.strBillID = dr["F_BillID"].ToString();
                mySellOut.ShowDialog();
                mySellOut.Dispose();
                break;

            case "Accept":
                if (gvAccept.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvAccept.GetDataRow(gvAccept.FocusedRowHandle);
                Sell.frmSellAccept mySellAccept = new Sell.frmSellAccept();
                mySellAccept.strBillID = dr["F_BillID"].ToString();
                mySellAccept.ShowDialog();
                mySellAccept.Dispose();
                break;

            case "SellBack":
                if (gvSellBack.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvSellBack.GetDataRow(gvSellBack.FocusedRowHandle);
                Sell.frmSellBack mySellBack = new Sell.frmSellBack();
                mySellBack.strBillID = dr["F_BillID"].ToString();
                mySellBack.ShowDialog();
                mySellBack.Dispose();
                break;

            case "Check":
                if (gvCheck.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvCheck.GetDataRow(gvCheck.FocusedRowHandle);
                Storage.frmCheck myCheck = new Storage.frmCheck();
                myCheck.strBillID = dr["F_BillID"].ToString();
                myCheck.ShowDialog();
                myCheck.Dispose();
                break;

            case "Exchange":
                if (gvExchange.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvExchange.GetDataRow(gvExchange.FocusedRowHandle);
                Storage.frmExchange myExchange = new Storage.frmExchange();
                myExchange.strBillID = dr["F_BillID"].ToString();
                myExchange.ShowDialog();
                myExchange.Dispose();
                break;

            case "OtherIn":
                if (gvOtherIn.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOtherIn.GetDataRow(gvOtherIn.FocusedRowHandle);
                Storage.frmOtherIn myOtherIn = new Storage.frmOtherIn();
                myOtherIn.strBillID = dr["F_BillID"].ToString();
                myOtherIn.ShowDialog();
                myOtherIn.Dispose();
                break;

            case "OtherOut":
                if (gvOtherOut.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOtherOut.GetDataRow(gvOtherOut.FocusedRowHandle);
                Storage.frmOtherOut myOtherOut = new Storage.frmOtherOut();
                myOtherOut.strBillID = dr["F_BillID"].ToString();
                myOtherOut.ShowDialog();
                myOtherOut.Dispose();
                break;

            case "install":
                if (gvInstall.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvInstall.GetDataRow(gvInstall.FocusedRowHandle);
                Storage.frmInstall myInstall = new Storage.frmInstall();
                myInstall.strBillID = dr["F_BillID"].ToString();
                myInstall.ShowDialog();
                myInstall.Dispose();
                break;

            case "ProductPlan":
                if (gvProductPlan.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvProductPlan.GetDataRow(gvProductPlan.FocusedRowHandle);
                Product.frmProductPlan myProductPlan = new Product.frmProductPlan();
                myProductPlan.strBillID = dr["F_BillID"].ToString();
                myProductPlan.ShowDialog();
                myProductPlan.Dispose();
                break;

            case "Task":
                if (gvTask.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvTask.GetDataRow(gvTask.FocusedRowHandle);

                Product.frmTask myTask = new Product.frmTask();
                myTask.strBillID = dr["F_BillID"].ToString();
                myTask.ShowDialog();
                myTask.Dispose();
                break;

            case "ProductStatus":
                if (gvProductStatus.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvProductStatus.GetDataRow(gvProductStatus.FocusedRowHandle);
                Product.frmProductStatus myProductStatus = new Product.frmProductStatus();
                myProductStatus.strBillID = dr["F_BillID"].ToString();
                myProductStatus.ShowDialog();
                myProductStatus.Dispose();
                break;

            case "DrawGoods":
                if (gvDrawGoods.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvDrawGoods.GetDataRow(gvDrawGoods.FocusedRowHandle);
                Product.frmDrawGoods myDrawGoods = new Product.frmDrawGoods();
                myDrawGoods.strBillID = dr["F_BillID"].ToString();
                myDrawGoods.ShowDialog();
                myDrawGoods.Dispose();
                break;

            case "PatchGoods":
                if (gvPatchGoods.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvPatchGoods.GetDataRow(gvPatchGoods.FocusedRowHandle);
                Product.frmPatchGoods myPatchGoods = new Product.frmPatchGoods();
                myPatchGoods.strBillID = dr["F_BillID"].ToString();
                myPatchGoods.ShowDialog();
                myPatchGoods.Dispose();
                break;

            case "BackGoods":
                if (gvBackGoods.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvBackGoods.GetDataRow(gvBackGoods.FocusedRowHandle);
                Product.frmBackGoods myBackGoods = new Product.frmBackGoods();
                myBackGoods.strBillID = dr["F_BillID"].ToString();
                myBackGoods.ShowDialog();
                myBackGoods.Dispose();
                break;

            case "ProductIn":
                if (gvProductIn.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvProductIn.GetDataRow(gvProductIn.FocusedRowHandle);
                Product.frmProductIn myProductIn = new Product.frmProductIn();
                myProductIn.strBillID = dr["F_BillID"].ToString();
                myProductIn.ShowDialog();
                myProductIn.Dispose();
                break;

            case "OutBill":
                if (gvOutBill.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutBill.GetDataRow(gvOutBill.FocusedRowHandle);
                OutProduct.frmOutBill myOutBill = new OutProduct.frmOutBill();
                myOutBill.strBillID = dr["F_BillID"].ToString();
                myOutBill.ShowDialog();
                myOutBill.Dispose();
                break;

            case "OutDrawGoods":
                if (gvOutDrawGoods.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutDrawGoods.GetDataRow(gvOutDrawGoods.FocusedRowHandle);
                OutProduct.frmOutDrawGoods myOutDrawGoods = new OutProduct.frmOutDrawGoods();
                myOutDrawGoods.strBillID = dr["F_BillID"].ToString();
                myOutDrawGoods.ShowDialog();
                myOutDrawGoods.Dispose();
                break;

            case "OutBackGoods":
                if (gvOutBackGoods.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutBackGoods.GetDataRow(gvOutBackGoods.FocusedRowHandle);

                OutProduct.frmOutBackGoods myOutBackGoods = new OutProduct.frmOutBackGoods();
                myOutBackGoods.strBillID = dr["F_BillID"].ToString();
                myOutBackGoods.ShowDialog();
                myOutBackGoods.Dispose();
                break;

            case "OutInStore":
                if (gvOutInStore.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutInStore.GetDataRow(gvOutInStore.FocusedRowHandle);

                OutProduct.frmOutInStore myOutInStore = new OutProduct.frmOutInStore();
                myOutInStore.strBillID = dr["F_BillID"].ToString();
                myOutInStore.ShowDialog();
                myOutInStore.Dispose();
                break;

            case "OutBackStore":
                if (gvOutBackStore.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutBackStore.GetDataRow(gvOutBackStore.FocusedRowHandle);
                OutProduct.frmOutBackStore myOutBackStore = new OutProduct.frmOutBackStore();
                myOutBackStore.strBillID = dr["F_BillID"].ToString();
                myOutBackStore.ShowDialog();
                myOutBackStore.Dispose();
                break;

            case "OutPay":
                if (gvOutPay.FocusedRowHandle < 0)
                {
                    return;
                }
                dr = gvOutPay.GetDataRow(gvOutPay.FocusedRowHandle);
                OutProduct.frmOutPay myOutPay = new OutProduct.frmOutPay();
                myOutPay.strBillID = dr["F_BillID"].ToString();
                myOutPay.ShowDialog();
                myOutPay.Dispose();
                break;
            }
        }
Esempio n. 2
0
        private void ShowBill()
        {
            DataRow dr = gvMain.GetDataRow(gvMain.FocusedRowHandle);

            switch (strTable)
            {
            case "t_ApplyStock":
                Stock.frmApplyStock myApplyStock = new Stock.frmApplyStock();
                myApplyStock.strBillID = dr["F_BillID"].ToString();
                myApplyStock.ShowDialog();
                myApplyStock.Dispose();
                break;

            case "t_StockOrder":
                Stock.frmStockOrder myStockOrder = new Stock.frmStockOrder();
                myStockOrder.strBillID = dr["F_BillID"].ToString();
                myStockOrder.ShowDialog();
                myStockOrder.Dispose();
                break;

            case "t_StockIn":
                Stock.frmStockIn myStockIn = new Stock.frmStockIn();
                myStockIn.strBillID = dr["F_BillID"].ToString();
                myStockIn.ShowDialog();
                myStockIn.Dispose();
                break;

            case "t_Pay":
                Stock.frmStockPay myStockPay = new Stock.frmStockPay();
                myStockPay.strBillID = dr["F_BillID"].ToString();
                myStockPay.ShowDialog();
                myStockPay.Dispose();
                break;

            case "t_StockBack":
                Stock.frmStockBack myStockBack = new Stock.frmStockBack();
                myStockBack.strBillID = dr["F_BillID"].ToString();
                myStockBack.ShowDialog();
                myStockBack.Dispose();
                break;

            case "t_AskPrice":
                Sell.frmAskPrice myAskPrice = new Sell.frmAskPrice();
                myAskPrice.strBillID = dr["F_BillID"].ToString();
                myAskPrice.ShowDialog();
                myAskPrice.Dispose();
                break;

            case "t_SellPrice":
                Sell.frmSellPrice mySellPrice = new Sell.frmSellPrice();
                mySellPrice.strBillID = dr["F_BillID"].ToString();
                mySellPrice.ShowDialog();
                mySellPrice.Dispose();
                break;

            case "t_SellOrder":
                Sell.frmSellOrder mySellOrder = new Sell.frmSellOrder();
                mySellOrder.strBillID = dr["F_BillID"].ToString();
                mySellOrder.ShowDialog();
                mySellOrder.Dispose();
                break;

            case "t_SellPre":
                Sell.frmSellPre mySellPre = new Sell.frmSellPre();
                mySellPre.strBillID = dr["F_BillID"].ToString();
                mySellPre.ShowDialog();
                mySellPre.Dispose();
                break;

            case "t_SellOut":
                Sell.frmSellOut mySellOut = new Sell.frmSellOut();
                mySellOut.strBillID = dr["F_BillID"].ToString();
                mySellOut.ShowDialog();
                mySellOut.Dispose();
                break;

            case "t_Accept":
                Sell.frmSellAccept mySellAccept = new Sell.frmSellAccept();
                mySellAccept.strBillID = dr["F_BillID"].ToString();
                mySellAccept.ShowDialog();
                mySellAccept.Dispose();
                break;

            case "t_SellBack":
                Sell.frmSellBack mySellBack = new Sell.frmSellBack();
                mySellBack.strBillID = dr["F_BillID"].ToString();
                mySellBack.ShowDialog();
                mySellBack.Dispose();
                break;

            case "t_Check":
                Storage.frmCheck myCheck = new Storage.frmCheck();
                myCheck.strBillID = dr["F_BillID"].ToString();
                myCheck.ShowDialog();
                myCheck.Dispose();
                break;

            case "t_Exchange":
                Storage.frmExchange myExchange = new Storage.frmExchange();
                myExchange.strBillID = dr["F_BillID"].ToString();
                myExchange.ShowDialog();
                myExchange.Dispose();
                break;

            case "t_InStall":
                Storage.frmInstall myInstall = new Storage.frmInstall();
                myInstall.strBillID = dr["F_BillID"].ToString();
                myInstall.ShowDialog();
                myInstall.Dispose();
                break;

            case "t_Other":
                Storage.frmOtherIn myOtherIn = new Storage.frmOtherIn();
                myOtherIn.strBillID = dr["F_BillID"].ToString();
                myOtherIn.ShowDialog();
                myOtherIn.Dispose();
                break;

            case "t_Task":
                Product.frmTask myTask = new Product.frmTask();
                myTask.strBillID = dr["F_BillID"].ToString();
                myTask.ShowDialog();
                myTask.Dispose();
                break;

            case "t_ProductPlan":
                Product.frmProductPlan myProductPlan = new Product.frmProductPlan();
                myProductPlan.strBillID = dr["F_BillID"].ToString();
                myProductPlan.ShowDialog();
                myProductPlan.Dispose();
                break;

            case "t_ProductStatus":
                Product.frmProductStatus myProductStatus = new Product.frmProductStatus();
                myProductStatus.strBillID = dr["F_BillID"].ToString();
                myProductStatus.ShowDialog();
                myProductStatus.Dispose();
                break;

            case "t_DrawGoods":
                Product.frmDrawGoods myDrawGoods = new Product.frmDrawGoods();
                myDrawGoods.strBillID = dr["F_BillID"].ToString();
                myDrawGoods.ShowDialog();
                myDrawGoods.Dispose();
                break;

            case "t_BackGoods":
                Product.frmBackGoods myBackGoods = new Product.frmBackGoods();
                myBackGoods.strBillID = dr["F_BillID"].ToString();
                myBackGoods.ShowDialog();
                myBackGoods.Dispose();
                break;

            case "t_PatchGoods":
                Product.frmPatchGoods myPatchGoods = new Product.frmPatchGoods();
                myPatchGoods.strBillID = dr["F_BillID"].ToString();
                myPatchGoods.ShowDialog();
                myPatchGoods.Dispose();
                break;

            case "t_ProductIn":
                Product.frmProductIn myProductIn = new Product.frmProductIn();
                myProductIn.strBillID = dr["F_BillID"].ToString();
                myProductIn.ShowDialog();
                myProductIn.Dispose();
                break;

            case "t_OutBill":
                OutProduct.frmOutBill myOutBill = new OutProduct.frmOutBill();
                myOutBill.strBillID = dr["F_BillID"].ToString();
                myOutBill.ShowDialog();
                myOutBill.Dispose();
                break;

            case "t_OutDrawGoods":
                OutProduct.frmOutDrawGoods myOutDrawGoods = new OutProduct.frmOutDrawGoods();
                myOutDrawGoods.strBillID = dr["F_BillID"].ToString();
                myOutDrawGoods.ShowDialog();
                myOutDrawGoods.Dispose();
                break;

            case "t_OutBackGoods":
                OutProduct.frmOutBackGoods myOutBackGoods = new OutProduct.frmOutBackGoods();
                myOutBackGoods.strBillID = dr["F_BillID"].ToString();
                myOutBackGoods.ShowDialog();
                myOutBackGoods.Dispose();
                break;

            case "t_OutInStore":
                OutProduct.frmOutInStore myOutInStore = new OutProduct.frmOutInStore();
                myOutInStore.strBillID = dr["F_BillID"].ToString();
                myOutInStore.ShowDialog();
                myOutInStore.Dispose();
                break;

            case "t_OutBackStore":
                OutProduct.frmOutBackStore myOutBackStore = new OutProduct.frmOutBackStore();
                myOutBackStore.strBillID = dr["F_BillID"].ToString();
                myOutBackStore.ShowDialog();
                myOutBackStore.Dispose();
                break;

            case "t_OutPay":
                OutProduct.frmOutPay myOutPay = new OutProduct.frmOutPay();
                myOutPay.strBillID = dr["F_BillID"].ToString();
                myOutPay.ShowDialog();
                myOutPay.Dispose();
                break;
            }
        }