yxj
2022-05-27 cfedb44b75f0ab526b80f06857a6b097f19c8489
WarM/ÌõÂë´òÓ¡/Sc_ICMOToBarCode.cs
@@ -107,12 +107,27 @@
            DSet = SubCn.RunProcReturn("exec h_p_KSTMSC '" + HSeOrderBillNo + "' ,'" + HICMOBillNo + "' , '" + HMaterName + "' , '" + HSourceName + "' ,'" + HEmpName + "' ,'" + HBeginDate + "'", "h_p_KSTMSC", ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
                //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("没有返回任何结果,请在过滤框中点击【恢复】按钮,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            else
            {
                grdMain.DataSource = DSet.Tables[0].DefaultView;
                //把当前单据ID å­˜åˆ°ä¸€ä¸ªæŒ‰é’®é‡Œé¢   åˆ·æ–°æ—¶æ¯æ¬¡å­˜ä¸€é
                if (DSet.Tables[0].Rows.Count > 0)
                {
                    txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
                    txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["标准装箱"].Value);
                }
                else
                {
                }
            }
            //
            grdMain.DataSource = DSet.Tables[0].DefaultView;
            //标准装箱
            //for (int i = 0; i < grdMain.SelectedRows.Count; i++)
@@ -206,6 +221,38 @@
            initGrid();
            cmbHBarCodeType.SelectedIndex = 0;
            dtpHBeginDate.Value = DateTime.Today;
            string HUserName = "";
            HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName);
            Int64 HUserID = 0;
            HUserID = ClsPub.isInt(DBUtility.ClsPub.CurUserID);
            DataSet DSet;
            DSet = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
            if (DSet == null)
            //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("没有返回任何结果,请在过滤框中点击【恢复】按钮,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            else
            {
                //grdMain.DataSource = DSet.Tables[0].DefaultView;
                //把当前单据ID å­˜åˆ°ä¸€ä¸ªæŒ‰é’®é‡Œé¢   åˆ·æ–°æ—¶æ¯æ¬¡å­˜ä¸€é
                if (DSet.Tables[0].Rows.Count > 0)
                {
                    txtHEmpID.Tag = DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["HEmpID"]);
                }
                else
                {
                }
            }
        }
        private void grdMain_DblClick(object sender, EventArgs e)
@@ -482,14 +529,14 @@
        private void Sub_SetReport(string sOpenTmp)
        {
            //判断行数
            for (int i = 0; i < grdMain.Rows.Count; i++)
            {
                grdMain.Rows[i].Cells[0].Value = "";
            }
            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
            {
                grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*";
            }
            //for (int i = 0; i < grdList.Rows.Count; i++)
            //{
            //    grdList.Rows[i].Cells[0].Value = "";
            //}
            //for (int i = 0; i < grdList.SelectedRows.Count; i++)
            //{
            //    grdList.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*";
            //}
            //
            Report = new GridppReport();
            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
@@ -529,7 +576,7 @@
            try
            {
                DataTable ds = new DataTable();
                BLL.Utility.FillRecordToReport_Sel(Report, grdMain, ds, Fun_GetCol("选择"));
                BLL.Utility.FillRecordToReport_Sel(Report, grdList, ds, Fun_GetCol("选择"));
            }
            catch (Exception e)
            {
@@ -701,62 +748,6 @@
            }
        }
        private void zf_Click(object sender, EventArgs e)
        {
            //Sub_AbandonCheck();
            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            if (grdMain.CurrentRow == null)
                return;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
            if (MessageBox.Show("确定要作废所选条码?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
            {
                return;
            }
            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
            {
                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
                {
                    if (!oBar.Cancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value)))
                    {
                        MessageBox.Show("作废失败!", "提示");
                        return;
                    }
                }
            }
            MessageBox.Show("作废成功!", "提示");
        }
        private void fzf_Click(object sender, EventArgs e)
        {
            //this.Sub_CheckBill();
            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            if (grdMain.CurrentRow == null)
                return;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
            if (MessageBox.Show("确定要反作废所选条码?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
            {
                return;
            }
            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
            {
                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
                {
                    if (!oBar.UnCancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value)))
                    {
                        MessageBox.Show("反作废失败!", "提示");
                        return;
                    }
                }
            }
            MessageBox.Show("反作废成功!", "提示");
        }
        private void cmdHSaveBill_Click(object sender, EventArgs e)
        {
@@ -797,7 +788,7 @@
                int LSHlen = 6;             //流水号长度
                string TM = "";             //条码
                HDate = DateTime.Now.ToShortDateString();
                HDate = dtpHBeginDate.Value.ToShortDateString();
                HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
                HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
                HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
@@ -818,13 +809,24 @@
                //生成一个外箱码
                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.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                string sPackBarCode = sPackStr + LSH.ToString();
                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 + "'");
                //MessageBox.Show("11");
                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 + "'"
                                   + ", '" + sPackBarCode.ToString() + "',1,'','" + sPackBarCode.ToString() + "',0,0,0"
                                   + ",0,1,0,0,0,0,'','')");
                //MessageBox.Show("12");
                //1.循环网格,根据 æœ¬æ¬¡æ•°é‡ åˆ—  ç”Ÿæˆ å”¯ä¸€ç 
                for (int j = 0; j < grdMain.Rows.Count; j++)
            for (int j = 0; j < grdMain.Rows.Count; j++)
                {
                    if (DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("本次数量")].Value) > 0)
                    {
@@ -836,7 +838,7 @@
                        //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
                        HZXQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("本次数量")].Value);
                        HDDQty = 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;
@@ -886,6 +888,11 @@
                        string HWorkLineName = "";
                        string HSeOrderBillNo = "";
                        string HInnerBillNo = "";
                        Int64 HSourceID = 0;
                        //毛重
                        Double HMZQty = 0;
                        HMZQty = HZXQty * ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("克重")].Value)/1000;
                        HWei = WeiShu;
                        HBarCode = TM;
                        HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text);
@@ -915,23 +922,25 @@
                        HWorkLineName = "";
                        HSeOrderBillNo = "";
                        HInnerBillNo = sPackBarCode;
                        oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                        HSourceID = ClsPub.isInt(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,HInterID " +
                                            ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HSourceID,HInterID " +
                                            ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                            ") values ("
                                            + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                            + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ", " + HMZQty.ToString()
                                            + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
                                            + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
                                            + ", " + 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 + "'," + HInterID.ToString()
                                            + ", " + ClsPub.HOrgID.ToString() + "," + ClsPub.HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HSourceID.ToString() + "," + HInterID.ToString()
                                            + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
                        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HTMNumber + "'");
                        DisplayTM();
                    }
                }
                //2.循环结束后,根据 æœ¬æ¬¡ç”Ÿæˆçš„ ä¸»å†…码,从后台数据库获取 æ¡ç åˆ—表,生成 ç»„托单 å’Œ æ‰˜æ¡ç ï¼Œ ç›´æŽ¥è°ƒç”¨å­˜å‚¨è¿‡ç¨‹ 
@@ -942,9 +951,23 @@
                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);
                //生成首行标题
                if (DSet == null)
                {
                    MessageBox.Show("没有返回任何结果,条码不存在!" + DBUtility.ClsPub.sExeReturnInfo);
                    return;
                }
                //
                grdList.DataSource = DSet.Tables[0].DefaultView;
                txtHZXQty.Text = "";
                //冻结
                int FrCol = 0;
                string s = "是";
                DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol);
                oCn.Commit();
                //DisplayTM();
                MessageBox.Show("条码生成完毕!");
               
@@ -957,10 +980,11 @@
                //0结束事务
                //
                Display();
                //Display();
            }
            catch(Exception e )
            catch (Exception e )
            {
                //回滚事务
@@ -971,31 +995,45 @@
        private void button4_Click(object sender, EventArgs e)
        {
            //根据本箱数量 æ¥ åˆ†é…åˆ° æ¯ä¸ªç”Ÿäº§è®¢å•上(分配时 è¦è€ƒè™‘ è®¢å•剩余数量已经是 è´Ÿæ•°çš„æƒ…况)
            //1.判断本箱数量 å¿…须大于0
            //如果有标准装箱数量 å…ˆé»˜è®¤å–标准装箱数量  æ²¡æœ‰å†å–手输的本箱数量
            //1.判断本箱数量 å¿…须大于0
            double HZXQty = 0;//整箱数量
            HZXQty = ClsPub.isDoule(txtHZXQty.Text);
            if (txtHZXQty.Text.Trim() != "")
            {
                HZXQty = ClsPub.isDoule(txtHZXQty.Text);
            }
            else
            {
                HZXQty = ClsPub.isDoule(txtHMiniQty.Text);
            }
            if (HZXQty <= 0)
            {
                MessageBox.Show("请输入整箱数量!");
                return;
            }
            //2.刷新网格
            Display();
            //Display();
            //3.把整箱数量 åˆ†é…åˆ° ç½‘格下面的每一个 ç”Ÿäº§è®¢å•上去。  å¾ªçŽ¯ç½‘æ ¼
            for(int i =0;i<grdMain.Rows.Count;i++)
            {
                if(HZXQty>0)
                if (HZXQty > 0)
                {
                    if(HZXQty>DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value))
                    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);
                        //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;
                        break;
                        //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
@@ -1461,10 +1499,21 @@
                                        + ",'3710'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ",0,0,0"
                                        + ", 0,getdate(),'" + HBarCode + "','" + TTM + "',0,0)");
                    DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HInterID=" + HInterID.ToString() + " and HBarCode like '%ZXM&' order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
                    //生成首行标题
                    if (DSet == null)
                    {
                        MessageBox.Show("没有返回任何结果,条码不存在!" + DBUtility.ClsPub.sExeReturnInfo);
                        return;
                    }
                    //
                    grdList.DataSource = DSet.Tables[0].DefaultView;
                    oCn.Commit();
                    MessageBox.Show("条码生成完毕!");
                    //grdSub.RowCount = 0;
                    DisplayTM();
                    //DisplayTM();
                }
                catch (Exception e1)
                {
@@ -1478,7 +1527,8 @@
        private void DisplayTM()
        {
            DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
            //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);
            //生成首行标题
            if (DSet == null)
            {
@@ -1649,19 +1699,62 @@
        private void cmdHSourceID_Click(object sender, EventArgs e)
        {
            DAL.ClsGy_WorkCenter_View oWork = new DAL.ClsGy_WorkCenter_View();
            if (oWork.RefreshView())
            Int64 HEmpID = 0;
            HEmpID = ClsPub.isLong(txtHEmpID.Tag);
            //string HEmpName = "";
            //HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
            DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
            if (HEmpID != 0)
            {
                this.txtHSourceID.Text = oWork.oModel.HName;
                this.txtHSourceID.Tag = oWork.oModel.HItemID.ToString();
                //
                Display();
                //
                if (oSource.GetInfoByID(HEmpID))
                {
                    this.txtHSourceID.Text = oSource.oModel.HName;
                    this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
                    //
                    Display();
                }
                else
                {
                    this.txtHSourceID.Text = "";
                }
            }
            else
            {
                this.txtHSourceID.Text = "";
                if (oSource.RefreshView())
                {
                    this.txtHSourceID.Text = oSource.oModel.HName;
                    this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
                    //
                    Display();
                }
                else
                {
                    this.txtHSourceID.Text = "";
                }
            }
            //if (oSource.RefreshView())
            //{
            //    this.txtHSourceID.Text = oSource.oModel.HName;
            //    this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
            //    //
            //    Display();
            //}
            //DAL.ClsGy_WorkCenter_View oWork = new DAL.ClsGy_WorkCenter_View();
            //if (oWork.RefreshView())
            //{
            //    this.txtHSourceID.Text = oWork.oModel.HName;
            //    this.txtHSourceID.Tag = oWork.oModel.HItemID.ToString();
            //    //
            //    Display();
            //    //
            //}
            //else
            //{
            //    this.txtHSourceID.Text = "";
            //}
        }
        private void cmdHEmpID_Click(object sender, EventArgs e)
@@ -1838,20 +1931,56 @@
        {
            //获取网格第一行HInterID的值
            Int64 HInterID = 0;
            HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
            HInterID = DBUtility.ClsPub.isInt(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);
            //}
            //else
            //{
            //}
            if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0)
            //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("没有上一个物料,如果需要请找机修!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            else
            {
                grdMain.DataSource = DSBefore.Tables[0].DefaultView;
                txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
                txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["标准装箱"].Value);
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            //根据
            Int64 HInterID = 0;
            HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
            //HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
            HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
            DataSet DSBefore;
            DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo);
            grdMain.DataSource = DSBefore.Tables[0].DefaultView;
            if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0)
            //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("没有下一个物料,如果需要请找机修!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            else
            {
                grdMain.DataSource = DSBefore.Tables[0].DefaultView;
                txtHMaterID.Tag = DBUtility.ClsPub.isInt(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["HInterID"].Value);
        }
        //超额打印
@@ -1867,7 +1996,7 @@
                return;
            }
            //2.刷新网格
            Display();
            //Display();
            //3.循环网格,累计全部剩余数量,判断是否 å‰©ä½™æ•°é‡ å°äºŽ æœ¬ç®±æ•°é‡ï¼›å¦‚æžœ å¤§äºŽåˆ™æŠ¥é”™ é€€å‡ºã€‚
            double sumLeftQty = 0;
            for (int i = 0; i < grdMain.Rows.Count; i++)