yangle
2023-08-31 9dd3335301f79d7462bf4acb41ba6456cd6e74e1
WarM/ÌõÂë´òÓ¡/Sc_ICMOToBarCode.cs
@@ -41,6 +41,7 @@
        public Int64 HInterID_TTM = 0;
        public string HBillNo_TTM = "";
        ClsCN SubCn = new ClsCN();
        Pub_Class.ClsGridViewSum oSumGrid = new Pub_Class.ClsGridViewSum();
        //
        private void initGrid()
        {
@@ -118,8 +119,11 @@
                //把当前单据ID å­˜åˆ°ä¸€ä¸ªæŒ‰é’®é‡Œé¢   åˆ·æ–°æ—¶æ¯æ¬¡å­˜ä¸€é
                if (DSet.Tables[0].Rows.Count > 0)
                {
                    txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
                    txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                    txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["标准装箱"].Value);
                    //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["物料编码"].Value);
                    txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["规格型号"].Value);
                    txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["物料名称"].Value);
                }
                else
                {
@@ -139,7 +143,7 @@
            //    }
            //}
            //冻结
            //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
            //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
            //string s = frmCondition.cmbHComplete.Text;
            //DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol);
            //画线
@@ -216,6 +220,7 @@
        {
            //
            //frmCondition = new frmBillQueryCondition_New();
            oSumGrid.ogrdMain = grdMain;
            this.Text = ModCaption;
            //lblCaption.Text = ModCaption;
            initGrid();
@@ -224,7 +229,7 @@
            string HUserName = "";
            HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName);
            Int64 HUserID = 0;
            HUserID = ClsPub.isInt(DBUtility.ClsPub.CurUserID);
            HUserID = ClsPub.isLong(DBUtility.ClsPub.CurUserID);
            DataSet DSet;
@@ -750,7 +755,6 @@
        private void cmdHSaveBill_Click(object sender, EventArgs e)
        {
            Display();
        }
@@ -777,8 +781,10 @@
                string HTMNumber = "";
                string HOrgNumber = "";
                DataSet Ds;
                int LSH = 0;                //流水号
                Int64 LSH = 0;                //流水号
                string LSH2 = "";           //流水号转换成字符
                double HZXQty = 0;         //装箱数量
                double HDDQty = 0;         //订单数量
                double HBQty = 0;         //箱数
@@ -787,13 +793,160 @@
                string WeiShu = "";         //尾数
                int LSHlen = 6;             //流水号长度
                string TM = "";             //条码
                string sPackBarCode = "";
                string HPrdDate = "";
                string HBC = "";
                string HDate1 = "";
                DataSet Ds99;
                HDate = dtpHBeginDate.Value.ToShortDateString();
                HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                //箱号
                string HXH = "";
                //箱号流水号
                Int64 LSH3 = 0;                //流水号
                string LSH4 = "";           //流水号转换成字符
                //机台
                string HJT = "";
                HDate = DateTime.Now.ToString();
                //判断当前时间是否在工作时间段内
                string _strWorkingDayAM = "07:30";//工作时间上午08:30
                string _strWorkingDayPM = "19:30";
                string _strWorkingDayTM = "00:00";
                string _strWorkingDaySM = "23:59";
                TimeSpan dspWorkingDayAM = DateTime.Parse(_strWorkingDayAM).TimeOfDay;
                TimeSpan dspWorkingDayPM = DateTime.Parse(_strWorkingDayPM).TimeOfDay;
                TimeSpan dspWorkingDayTM = DateTime.Parse(_strWorkingDayTM).TimeOfDay;
                TimeSpan dspWorkingDaySM = DateTime.Parse(_strWorkingDaySM).TimeOfDay;
                //string time1 = "2017-2-17 8:10:00";
                DateTime t1 = Convert.ToDateTime(HDate);
                TimeSpan dspNow = t1.TimeOfDay;
                HDate1 = Convert.ToDateTime(HDate).ToShortDateString();
                //1.正常上班时间 å°±æ˜¯ç™½ç­  å¦‚果不是礼拜天 å°±å¾€å‰æå‰ä¸€å¤©
                if (dspNow > dspWorkingDayAM && dspNow < dspWorkingDayPM)
                {
                    HBC = "白班";
                    DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
                    {
                        HPrdDate = HDate;
                    }
                    else
                    {
                        HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
                    }
                }
                //2.大于19:30  å°äºŽ24:00  å¤œç­
                if (dspNow > dspWorkingDayPM && dspNow < dspWorkingDaySM)
                {
                    HBC = "夜班";
                    DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
                    {
                        HPrdDate = HDate;
                    }
                    else
                    {
                        HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
                    }
                }
                //3.大于00:00  å°äºŽ7:30  ç™½ç­  å…ˆå‡ä¸€å¤©  å†åˆ¤æ–­å‡äº†ä¸€å¤©çš„æ—¥æœŸæ˜¯ä¸æ˜¯åŽ‚ä¼‘æ—¥æœŸ
                if (dspNow > dspWorkingDayTM && dspNow < dspWorkingDayAM)
                {
                    HBC = "夜班";
                    HDate = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(HDate).AddDays(-1));
                    HDate = DBUtility.ClsPub.isDate(HDate).ToShortDateString();
                    DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
                    {
                        HPrdDate = HDate;
                    }
                    else
                    {
                        HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
                    }
                }
                HYear = ClsPub.isDate(HPrdDate).Year.ToString().Substring(2, 2);
                HPeriod = "0" + ClsPub.isDate(HPrdDate).Month.ToString();
                HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                HDay = "0" + ClsPub.isDate(HPrdDate).Day.ToString();
                HDay = HDay.Substring(HDay.Length - 2, 2);
                long HTMaterID = 0;
                HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //外箱码 å‰ç¼€
                //获取处理过的日期跟今天差几天  ç„¶åŽåŠ å‡ ä¸ª+号
                TimeSpan HCY = Convert.ToDateTime(HPrdDate) - Convert.ToDateTime(DateTime.Now.ToString());
                int a = 1;
                while (a <= HCY.Days)  //当a å°äºŽ å·®å¼‚天数  å¾ªçŽ¯åŠ ä¸Š + å·
                {
                    HPrdDate = HPrdDate + "+";
                    a = a + 1;
                }
                DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                sPackBarCode = sPackStr + TTM_LSH.ToString();
                //DataSet DSet3 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                //if (DSet3 == null || DSet3.Tables[0].Rows.Count == 0)
                //{
                //    sPackBarCode = sPackStr + TTM_LSH.ToString() ;
                //}
                //else
                //{
                //    sPackBarCode = sPackStr + TTM_LSH.ToString() + "+";
                //}
                oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                //DataSet DSet1 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                //    //生成首行标题
                //    if (DSet1 == null || DSet1.Tables[0].Rows.Count == 0)
                //    {
                //        HDate = DateTime.Now.ToShortDateString();
                //        HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                //        HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                //        HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                //        HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                //        HDay = HDay.Substring(HDay.Length - 2, 2);
                //        long HTMaterID = 0;
                //        HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                //        string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //外箱码 å‰ç¼€
                //        DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                //        Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                //        sPackBarCode = sPackStr + TTM_LSH.ToString();
                //        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                //    }
                //    else
                //    {
                //        HDate = DBUtility.ClsPub.isStrNull(DSet1.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
                //        HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                //        HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                //        HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                //        HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                //        HDay = HDay.Substring(HDay.Length - 2, 2);
                //        long HTMaterID = 0;
                //        HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                //        string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //外箱码 å‰ç¼€
                //        DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                //        Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                //        sPackBarCode = sPackStr + TTM_LSH.ToString() + "+" ;
                //        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                //    }
                //=============根据界面上已经分配的数据进行条码生成和打印。
                //获取本次生成的 ä¸»å†…码 
@@ -807,11 +960,13 @@
                //00 å…ˆç”Ÿæˆ å”¯ä¸€çš„ æ‰˜æ¡ç 
                //生成一个外箱码
                string sPackStr = "ZXM" + HYear + HPeriod + HDay; //外箱码 å‰ç¼€
                DataSet  DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
                string sPackBarCode = sPackStr + TTM_LSH.ToString();
                oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                //long HTMaterID = 0;
                //HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                //string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //外箱码 å‰ç¼€
                //DataSet  DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                //Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                //string sPackBarCode = sPackStr + TTM_LSH.ToString();
                //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                //MessageBox.Show("11");
@@ -836,14 +991,32 @@
                        HOrgNumber = ClsPub.HOrgNumber;
                        //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
                        //箱号生成规则  æ—¥æœŸ +  æœºå° + ç­æ¬¡ +  ç‰©æ–™   åªè¦èŽ·å–æœ€å¤§çš„æµæ°´å·
                        string sBoxYear;
                        string sBoxPeriod;
                        string sBoxDay;
                        DateTime HBoxDate = DBUtility.ClsPub.isDate(DBUtility.ClsPub.GetServerDate(0));
                        sBoxYear = HBoxDate.Year.ToString().Substring(2, 2);
                        sBoxPeriod = "0" +  HBoxDate.Month.ToString();
                        sBoxPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                        sBoxDay = "0" + HBoxDate.Day.ToString();
                        sBoxDay = HDay.Substring(HDay.Length - 2, 2);
                        HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("设备")].Value);
                        HXH = sBoxYear + sBoxPeriod + sBoxDay + HBC + HJT + HMaterNumber;
                        Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH3 = ClsPub.isLong(Ds99.Tables[0].Rows[0][0]) + 1;
                        LSH4 = LSH3.ToString();
                        //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                        HZXQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("本次数量")].Value);
                        HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("生产订单数量")].Value);
                        HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("生产订单号")].Value);
                        HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        n = 0;
                        LSH2 = LSH.ToString();
                        while (LSH2.Length < LSHlen)  //如果流水号小于6位数前面补0
@@ -922,14 +1095,14 @@
                        HWorkLineName = "";
                        HSeOrderBillNo = "";
                        HInnerBillNo = sPackBarCode;
                        HSourceID = ClsPub.isInt(txtHSourceID.Tag);
                        HSourceID = ClsPub.isLong(txtHSourceID.Tag);
                        oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HMaterialMQty" +
                                            ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                            ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                            ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                            ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                            ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HSourceID,HInterID " +
                                            ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                            ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HPrdDate,HBC,HXH,HInnerBillNo " +
                                            ") values ("
                                            + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ", " + HMZQty.ToString()
                                            + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -937,22 +1110,23 @@
                                            + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
                                            + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + HDate + "'"
                                            + ", " + ClsPub.HOrgID.ToString() + "," + ClsPub.HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HSourceID.ToString() + "," + HInterID.ToString()
                                            + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
                                            + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HPrdDate + "','" + HBC + "','" + LSH4 + "','" + HInnerBillNo + "')");
                        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HTMNumber + "'");
                        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HXH + "'");
                        DisplayTM();
                    }
                }
                //2.循环结束后,根据 æœ¬æ¬¡ç”Ÿæˆçš„ ä¸»å†…码,从后台数据库获取 æ¡ç åˆ—表,生成 ç»„托单 å’Œ æ‰˜æ¡ç ï¼Œ ç›´æŽ¥è°ƒç”¨å­˜å‚¨è¿‡ç¨‹ 
                 //根据外箱码 å†™å…¥ ç»„托单主表,组托单子表,SUM,外箱码档案,SUM档案
                oCn.RunProc("exec  h_p_WMS_PackUnionBill_AddNew  '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //根据箱条码,写入 ä¸»è¡¨ï¼Œå­è¡¨ ï¼Œç®±æ¡ç æ¡£æ¡ˆ
                oCn.RunProc("exec  h_p_WMS_PackUnionBill_AddNew_test  '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //根据箱条码,写入 ä¸»è¡¨ï¼Œå­è¡¨ ï¼Œç®±æ¡ç æ¡£æ¡ˆ
                oCn.RunProc("exec  h_p_WMS_PackUnionBill_SumSubBill  " + HInterID_TTM.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //根据箱条码,写入 SUM表,SUM条码档案
                sPackBarCode = "";
                DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS Where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»åž‹ = '托盘条码'", "h_v_IF_BarCodeBillList_CS", ref DBUtility.ClsPub.sExeReturnInfo);
                DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS_Test Where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»åž‹ = '托盘条码'", "h_v_IF_BarCodeBillList_CS_Test", ref DBUtility.ClsPub.sExeReturnInfo);
                //生成首行标题
                if (DSet == null)
                {
@@ -995,191 +1169,159 @@
        private void button4_Click(object sender, EventArgs e)
        {
            //根据本箱数量 æ¥ åˆ†é…åˆ° æ¯ä¸ªç”Ÿäº§è®¢å•上(分配时 è¦è€ƒè™‘ è®¢å•剩余数量已经是 è´Ÿæ•°çš„æƒ…况)
            //如果有标准装箱数量 å…ˆé»˜è®¤å–标准装箱数量  æ²¡æœ‰å†å–手输的本箱数量
            //1.判断本箱数量 å¿…须大于0
            double HZXQty = 0;//整箱数量
            if (txtHZXQty.Text.Trim() != "")
            {
                HZXQty = ClsPub.isDoule(txtHZXQty.Text);
            }
            else
            {
                HZXQty = ClsPub.isDoule(txtHMiniQty.Text);
            }
            if (HZXQty <= 0)
            {
                MessageBox.Show("请输入整箱数量!");
                return;
            }
            //2.刷新网格
            //Display();
            //3.把整箱数量 åˆ†é…åˆ° ç½‘格下面的每一个 ç”Ÿäº§è®¢å•上去。  å¾ªçŽ¯ç½‘æ ¼
            for(int i =0;i<grdMain.Rows.Count;i++)
            {
                if (HZXQty > 0)
                {
                    if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value))
                    {
                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //MessageBox.Show("请点击超额生产按钮生成条码!");
                        //return;
                    }
                    else
                    {
                        grdMain.Rows[i].Cells["本次数量"].Value = HZXQty;
                        //
                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                    }
                }
                else
                {
                    break;
                }
            }
            Sub_SaveBarCode();
            //
            ////1.获取界面上面整箱数量框输入的数量 èµ‹å€¼ç»™å˜é‡  å¹¶åˆ·æ–°ç½‘æ ¼
            //double HBarCodeQty = 0;
            //double HZXQty = 0;
            //HZXQty = ClsPub.isDoule(txtHZXQty.Text);
            //if (HZXQty ==0)
            ////根据本箱数量 æ¥ åˆ†é…åˆ° æ¯ä¸ªç”Ÿäº§è®¢å•上(分配时 è¦è€ƒè™‘ è®¢å•剩余数量已经是 è´Ÿæ•°çš„æƒ…况)
            ////如果有标准装箱数量 å…ˆé»˜è®¤å–标准装箱数量  æ²¡æœ‰å†å–手输的本箱数量
            ////1.判断本箱数量 å¿…须大于0
            //double HZXQty = 0;//整箱数量
            //if (txtHZXQty.Text.Trim() != "")
            //{
            //    HZXQty = ClsPub.isDoule(txtHZXQty.Text);
            //}
            //else
            //{
            //    HZXQty = ClsPub.isDoule(txtHMiniQty.Text);
            //}
            //if (HZXQty <= 0)
            //{
            //    MessageBox.Show("请输入整箱数量!");
            //    return;
            //}
            //Display();
            ////2.获取网格选中行物料ID
            ////int a = grdMain.CurrentRow.Index;
            ////long HMaterID = 0;
            //////HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[a].Cells[Fun_GetCol("HMaterID")].Value);
            ////    if (HMaterID == 0)
            ////    {
            ////        MessageBox.Show("没有选中任何记录!");
            ////        return;
            ////    }
            ////3.定义是否组托的变量
            //int Mul = 0;
            ////4.根据单据类型获取本次条码主内码HInterID
            //HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo);
            //for (int i = 0; i < grdMain.Rows.Count; i++)
            ////2.刷新网格
            ////Display();
            ////3.把整箱数量 åˆ†é…åˆ° ç½‘格下面的每一个 ç”Ÿäº§è®¢å•上去。  å¾ªçŽ¯ç½‘æ ¼
            //for(int i =0;i<grdMain.Rows.Count;i++)
            //{
            //    //获取网格里面每一行订单对应的订单数量
            //    double HDDQty = 0;
            //    HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("订单数量")].Value);
            //    //获取当前系统登陆组织代码
            //    HOrgNumber = ClsPub.HOrgNumber;
            //    //自动匹配逻辑  åˆ¤æ–­è®¢å•数量是否大于整箱数量   å¦‚果订单数量大于整箱数量  ç›´æŽ¥ç”Ÿæˆå”¯ä¸€ç 
            //    //如果订单数量小于整箱数量  åˆ™å¾ªçŽ¯ç”Ÿæˆå”¯ä¸€ç    ç”Ÿæˆå¯¹åº”的托条码
            //        if (HDDQty >= HZXQty)
            //    if (HZXQty > 0)
            //    {
            //        if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value))
            //        {
            //            HBarCodeQty = HZXQty;
            //            this.Sub_SaveBill_TTM();
            //            Display();
            //            Mul = Mul + 1;
            //            HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
            //            grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
            //            //MessageBox.Show("请点击超额生产按钮生成条码!");
            //            //return;
            //        }
            //        else if (HZXQty == 0)
            //        {
            //            return;
            //        }
            //        else
            //        {
            //            grdMain.Rows[i].Cells["本次数量"].Value = HZXQty;
            //            //
            //            //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
            //            //grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
            //        }
            //    }
            //    else
            //    {
            //        break;
            //    }
            //}
            //Sub_SaveBarCode();
            ////
            //bool flag = this.txtHZXQty.Text.Trim() != "";
            //double num;
            //double HICMOQty = 0;
            //if (flag)
            //{
            //    num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text);
            //}
            //else
            //{
            //    num = Pub_Class.ClsPub.isDoule(this.txtHMiniQty.Text);
            //}
            //bool flag2 = num <= 0.0;
            //if (flag2)
            //{
            //    MessageBox.Show("请输入整箱数量!");
            //}
            //else
            //{
            //    for (int i = 0; i < this.grdMain.Rows.Count; i++)
            //    {
            //        for (int i1 = 0; i1 < this.grdMain.Rows.Count; i1++)
            //        {
            //            HICMOQty += Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i1].Cells["生产订单数量"].Value);
            //        }
            //        if (HICMOQty < num)
            //        {
            //            MessageBox.Show("请点击超额生产按钮生成条码!");
            //            break;
            //        }
            //        else if(HDDQty < HZXQty)
            //        bool flag3 = num > 0.0;
            //        if (!flag3)
            //        {
            //            HBarCodeQty = HDDQty;
            //            HZXQty = HZXQty - HDDQty;
            //            this.Sub_SaveBill_TTM();
            //            Mul = Mul + 1;
            //            continue;
            //            break;
            //        }
            //        bool flag4 = num > Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
            //        if (!flag4)
            //        {
            //            this.grdMain.Rows[i].Cells["本次数量"].Value = num;
            //            break;
            //        }
            //        num -= Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
            //        this.grdMain.Rows[i].Cells["本次数量"].Value = Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
            //    }
            //    this.Sub_SaveBarCode();
            //    //如果Mul>1 æ–°å¢žç»„托单主表
            //}
            //if (Mul > 1)
            //{
            //    //HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[Fun_GetCol("生产订单号")].Value);
            //    DataSet DS1;
            //    HTTMNumber = HOrgNumber + HICMOBillNo;
            //    DS1 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
            //    TLSH = ClsPub.isInt(DS1.Tables[0].Rows[0][0]);
            //    TLSH2 = TLSH.ToString();
            //    TTM = HTTMNumber + TLSH2;
            //    HInterID_TTM = DBUtility.ClsPub.CreateBillID_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo);
            //    HBillNo_TTM = DBUtility.ClsPub.CreateBillCode_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo, true);//得到新单号
            //    string HDate = "";
            //    string HYear = "";
            //    string HPeriod = "";
            //    string HDay = "";
            //    HDate = DateTime.Now.ToShortDateString();
            //    HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
            //    HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
            //    HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
            //    HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
            //    HDay = HDay.Substring(HDay.Length - 2, 2);
            //    oCn.RunProc("insert into Sc_PackUnionBillMain (HYear,HPeriod,HBillType,HInterID,HDate" +
            //                       ",HBillNo,HBillStatus,HICMOBillNo,HBarCode_Pack,HMaterID,HUnitID,HWeight" +
            //                       ",HPWeight,HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo " +
            //                       ") values ("
            //                       + HYear + "," + HPeriod + ",'3783'," + HInterID_TTM + ",'" + HDate + "'"
            //                       + ", " + HBillNo_TTM.ToString() + ",1,''," + TTM.ToString() + ",0,0,0"
            //                       + ",0,1,0,0,0,0,'','')");
            //}
            ////3.先判断物料是否一致  å¦‚果一致开始循环网格
            //for (int i = 0; i < grdMain.Rows.Count; i++)
            //{
            //    //long HGrdMaterID = 0;
            //    //HGrdMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("HMaterID")].Value);
            //    //if (HGrdMaterID == HMaterID)
            //    //{
            //    //    double HDDQty = 0;
            //    //    HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("订单数量")].Value);
            //    //    //如果循环的该行记录的订单数量已经大于等于本次装箱数量  åˆ™ç›´æŽ¥ç”Ÿæˆå”¯ä¸€ç   å¹¶ä¸”刷新网格  åˆ·æ–°æ¡ç ä¿¡æ¯é¡µ
            //    //    if (HDDQty >= HZXQty)
            //    //    {
            //    //        double HBarCodeQty = 0;
            //    //        HBarCodeQty = HZXQty;
            //    //        this.Sub_SaveBill();
            //    //        Display();
            //    //    }
            //    //    //如果改行记录订单数量小于本次装箱数量 åˆ™ç»§ç»­å¾ªçޝ  èµ°ç”Ÿæˆæ‰˜æ¡ç æ–¹æ³•
            //    //    else
            //    //    {
            //    //        //查出符合条件的选中这条数量跟装箱数量的差异值
            //    //        double HCYQty = 0;
            //    //        HCYQty = HZXQty - DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("订单数量")].Value);
            //    //    }
            //    //}
            //    //else
            //    //{
            //    //}
            //}
            bool flag = this.txtHZXQty.Text.Trim() != "";
            double HICMOQty = 0.0;
            bool flag5 = flag;
            double num;
            if (flag5)
            {
                num = ClsPub.isDoule(this.txtHZXQty.Text);
            }
            else
            {
                num = ClsPub.isDoule(this.txtHMiniQty.Text);
            }
            bool flag2 = num <= 0.0;
            bool flag6 = flag2;
            if (flag6)
            {
                MessageBox.Show("请输入整箱数量!");
            }
            else
            {
                for (int i = 0; i < this.grdMain.Rows.Count; i++)
                {
                    for (int i2 = 0; i2 < this.grdMain.Rows.Count; i2++)
                    {
                        HICMOQty += ClsPub.isDoule(this.grdMain.Rows[i2].Cells["生产订单数量"].Value);
                    }
                    bool flag7 = HICMOQty < num;
                    if (flag7)
                    {
                        MessageBox.Show("请点击超额生产按钮生成条码!");
                        break;
                    }
                    bool flag3 = num > 0.0;
                    bool flag8 = !flag3;
                    if (flag8)
                    {
                        break;
                    }
                    bool flag4 = num > ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
                    bool flag9 = !flag4;
                    if (flag9)
                    {
                        this.grdMain.Rows[i].Cells["本次数量"].Value = num;
                        break;
                    }
                    num -= ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
                    this.grdMain.Rows[i].Cells["本次数量"].Value = ClsPub.isDoule(this.grdMain.Rows[i].Cells["生产订单数量"].Value);
                }
                this.Sub_SaveBarCode();
            }
        }
        private void Sub_SaveBill()
@@ -1194,7 +1336,7 @@
            string HTMNumber = "";
            string HOrgNumber = "";
            DataSet Ds;
            int LSH = 0;                //流水号
            Int64 LSH = 0;                //流水号
            string LSH2 = "";           //流水号转换成字符
            double HZXQty = 0;         //装箱数量
            double HDDQty = 0;         //订单数量
@@ -1217,7 +1359,7 @@
                HOrgNumber = ClsPub.HOrgNumber;
                //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
                //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                HZXQty = ClsPub.isDoule(txtHZXQty.Text);
                HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("订单数量")].Value);
@@ -1226,7 +1368,7 @@
                {
                    HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                    Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                    LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                    LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                }
                else if (cmbHBarCodeType.Text == "批次条码")
                {
@@ -1357,7 +1499,7 @@
            string HTMNumber = "";
            string HOrgNumber = "";
            DataSet Ds;
            int LSH = 0;                //流水号
            Int64 LSH = 0;                //流水号
            string LSH2 = "";           //流水号转换成字符
            double HZXQty = 0;         //装箱数量
            double HDDQty = 0;         //订单数量
@@ -1380,7 +1522,7 @@
                HOrgNumber = ClsPub.HOrgNumber;
                //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
                //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                HZXQty = ClsPub.isDoule(txtHZXQty.Text);
                HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("订单数量")].Value);
                HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("生产订单号")].Value);
@@ -1389,7 +1531,7 @@
                {
                    HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                    Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                    LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                    LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                }
                else if (cmbHBarCodeType.Text == "批次条码")
                {
@@ -1406,9 +1548,49 @@
                }
                if (cmbHBarCodeType.Text == "唯一条码")
                {
                    //条码编号 = æ¡ç å‰ç¼€ + æµæ°´å·
                    TM = HTMNumber + LSH2;
                    HDate = DateTime.Now.ToShortDateString();
                    DataSet DSet = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
                    //生成首行标题
                    if (DSet == null || DSet.Tables[0].Rows.Count == 0)
                    {
                        HDate = DateTime.Now.ToShortDateString();
                        HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                        HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                        HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                        HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                        HDay = HDay.Substring(HDay.Length - 2, 2);
                        HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        TM = HTMNumber + LSH2;
                    }
                    else
                    {
                        HDate = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
                        HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                        HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                        HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                        HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                        HDay = HDay.Substring(HDay.Length - 2, 2);
                        HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                        Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        TM = HTMNumber + LSH2 + "+";
                    }
                    //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                    //HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                    //HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
                    //HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
                    //HDay = HDay.Substring(HDay.Length - 2, 2);
                    //HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                    //Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                    //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                }
                //if (cmbHBarCodeType.Text == "唯一条码")
                //{
                //    //条码编号 = æ¡ç å‰ç¼€ + æµæ°´å·
                //    TM = HTMNumber + LSH2;
                //}
                if (TM.Trim() == "")
                {
                    MessageBox.Show("条形码不能为空,不能生成条码!");
@@ -1528,8 +1710,8 @@
        private void DisplayTM()
        {
            //HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
            DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " and æ¡ç ç±»åž‹ = '托盘条码' order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
            //HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
            DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_test Where HinterID=" + HInterID.ToString() + " and æ¡ç ç±»åž‹ = '托盘条码' order by HItemID", "h_v_IF_BarCodeBillList_test", ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
            {
@@ -1688,7 +1870,7 @@
            //
            grdSub.DataSource = DSet.Tables[0].DefaultView;
            //冻结
            //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
            //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
            //string s = frmCondition.cmbHComplete.Text;
            //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol);
            //画线
@@ -1936,13 +2118,13 @@
        {
            //获取网格第一行HInterID的值
            Int64 HInterID = 0;
            HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
            HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
            DataSet DSBefore;
            DSBefore =  SubCn.RunProcReturn("exec h_p_PreviousMater "+ HInterID, "h_p_PreviousMater", ref DBUtility.ClsPub.sExeReturnInfo);
            grdMain.DataSource = DSBefore.Tables[0].DefaultView;
            //if (DSBefore.Tables[0].Rows.Count > 0)
            //{
            //    txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
            //    txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
            //}
            //else
            //{
@@ -1957,8 +2139,10 @@
            else
            {
                grdMain.DataSource = DSBefore.Tables[0].DefaultView;
                txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
                txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["标准装箱"].Value);
                txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["规格型号"].Value);
                txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["物料名称"].Value);
            }
@@ -1969,8 +2153,8 @@
        {
            //根据
            Int64 HInterID = 0;
            //HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
            HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
            //HInterID = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
            HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
            DataSet DSBefore;
            DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo);
            if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0)
@@ -1982,8 +2166,10 @@
            else
            {
                grdMain.DataSource = DSBefore.Tables[0].DefaultView;
                txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
                txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["标准装箱"].Value);
                txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["规格型号"].Value);
                txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["物料名称"].Value);
            }
            //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["HInterID"].Value);
        }
@@ -2087,5 +2273,10 @@
                Thread.Sleep(1000); 
            }
        }
        private void label14_Click(object sender, EventArgs e)
        {
        }
    }
}