yangle
2023-04-14 d1cfe6ed4a9ea812f7b3f1c1094be54ffb11cd73
WarM/ÌõÂë´òÓ¡/Sc_ICMOToBarCode.cs
@@ -119,7 +119,7 @@
                //把当前单据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);
@@ -143,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);
            //画线
@@ -229,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;
@@ -781,7 +781,7 @@
                string HTMNumber = "";
                string HOrgNumber = "";
                DataSet Ds;
                int LSH = 0;                //流水号
                Int64 LSH = 0;                //流水号
                string LSH2 = "";           //流水号转换成字符
@@ -802,7 +802,7 @@
                //箱号
                string HXH = "";
                //箱号流水号
                int LSH3 = 0;                //流水号
                Int64 LSH3 = 0;                //流水号
                string LSH4 = "";           //流水号转换成字符
                //机台
                string HJT = "";
@@ -888,7 +888,7 @@
                    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.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
                Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                sPackBarCode = sPackStr + TTM_LSH.ToString();
@@ -923,7 +923,7 @@
                //        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.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
                //        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 + "'");
                //    }
@@ -943,7 +943,7 @@
                //        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.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
                //        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 + "'");
                //    }
@@ -964,7 +964,7 @@
                //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.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
                //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 + "'");
@@ -995,19 +995,19 @@
                        HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("设备")].Value);
                        HXH = HYear + HPeriod + HDay + HBC + HJT + HMaterNumber;
                        Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH3 = ClsPub.isInt(Ds99.Tables[0].Rows[0][0]) + 1;
                        LSH3 = ClsPub.isLong(Ds99.Tables[0].Rows[0][0]) + 1;
                        LSH4 = LSH3.ToString();
                        //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
                        //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
@@ -1086,7 +1086,7 @@
                        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 " +
@@ -1327,7 +1327,7 @@
            string HTMNumber = "";
            string HOrgNumber = "";
            DataSet Ds;
            int LSH = 0;                //流水号
            Int64 LSH = 0;                //流水号
            string LSH2 = "";           //流水号转换成字符
            double HZXQty = 0;         //装箱数量
            double HDDQty = 0;         //订单数量
@@ -1350,7 +1350,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);
@@ -1359,7 +1359,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 == "批次条码")
                {
@@ -1490,7 +1490,7 @@
            string HTMNumber = "";
            string HOrgNumber = "";
            DataSet Ds;
            int LSH = 0;                //流水号
            Int64 LSH = 0;                //流水号
            string LSH2 = "";           //流水号转换成字符
            double HZXQty = 0;         //装箱数量
            double HDDQty = 0;         //订单数量
@@ -1513,7 +1513,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);
@@ -1522,7 +1522,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 == "批次条码")
                {
@@ -1552,7 +1552,7 @@
                        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.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        TM = HTMNumber + LSH2;
                    }
                    else
@@ -1565,7 +1565,7 @@
                        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.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        TM = HTMNumber + LSH2 + "+"; 
                    }
                    //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
@@ -1575,7 +1575,7 @@
                    //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.isInt(Ds.Tables[0].Rows[0][0]);
                    //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                }
                //if (cmbHBarCodeType.Text == "唯一条码")
                //{
@@ -1701,7 +1701,7 @@
        private void DisplayTM()
        {
            //HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
            //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)
@@ -1861,7 +1861,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);
            //画线
@@ -2109,13 +2109,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
            //{
@@ -2130,7 +2130,7 @@
            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);
@@ -2144,8 +2144,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)
@@ -2157,7 +2157,7 @@
            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);