智云外网版WMS\MES\SCM(作废)
jhz
2022-07-31 c45e231e9b180c412f0c81db3b577ca2763b05fa
SCM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -1702,13 +1702,15 @@
                    string HDate = "";          //日期
                    string sCaseNoNumber = "";  //箱号前缀
                    int sCaseNo = 0;            //箱号
                    string sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value);
                    string sAuxItemName = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HAuxPropNameCol].Value);
                    sHGroupID = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HGroupIDCol].Value);
                    sHBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HBatchNoCol].Value);
                    HDate = dtpHDate.Value.ToShortDateString();
                    HDate = SetDateStr(dtpHDate.Value );
                    sCaseNo = ClsPub.isInt(txtHCaseNo.Text) + grdSub.Rows.Count - 1;
                    //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ
                    sCaseNoNumber = sHGroupID + sHBatchNo + HDate;
                    //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ + ç‰©æ–™ä»£ç  + è¾…助属性
                    sCaseNoNumber = sHGroupID + sHBatchNo + HDate + sMaterNumber + sAuxItemName;
                    oWeb.getRunProc("Exec h_p_WMS_SetBarCodeNoByEmp  '" + sCaseNoNumber + "'," + sCaseNo, ref DBUtility.ClsPub.sExeReturnInfo);
                }
@@ -1860,6 +1862,9 @@
                        Application.DoEvents();
                    }
                }
                //
                //
                oWeb.Timeout = 200000;
                if (oWeb.getRunProcByMul_Back(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo))
                {
@@ -1883,6 +1888,10 @@
                    grdSub.RowCount = 0;
                    grdSub.RowCount = 20;
                }
                if (CampanyName == "森楷") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
                {
                    oWeb.getRunProc("exec h_p_WMS_BarCodeBackToOtherInRepuest  " + HInterID.ToString() + "", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                tabControl1.SelectedIndex = 2;
            }
            catch (Exception e)
@@ -1896,6 +1905,17 @@
        #endregion 
        public string SetDateStr(DateTime sDateTime)
        {
            string sDate = sDateTime.ToShortDateString();
            string sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
            string sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
            string sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
            sDay = sDay.Substring(sDay.Length - 2, 2);
            return sYear+ sPeriod+ sDay;
        }
        #region çª—体处理方法
        //初始化GRID
@@ -2866,12 +2886,14 @@
                        string HBatchNo = "";   //批次
                        string HDate = "";      //日期
                        string sCaseNoNumber = "";      //箱号前缀
                        string sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value);
                        string sAuxItemName = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HAuxPropNameCol].Value);
                        HGroupID = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HGroupIDCol].Value);
                        HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HBatchNoCol].Value);
                        HDate = dtpHDate.Value.ToShortDateString();
                        HDate = SetDateStr(dtpHDate.Value);
                        //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ
                        sCaseNoNumber = HGroupID + HBatchNo + HDate;
                        //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ + ç‰©æ–™ä»£ç  + è¾…助属性
                        sCaseNoNumber = HGroupID + HBatchNo + HDate + sMaterNumber + sAuxItemName;
                        Ds = oWeb.getDataSetBySQL("exec h_p_WMS_GetMaxNo  '" + sCaseNoNumber + "'", "h_p_WMS_GetMaxNo", ref DBUtility.ClsPub.sExeReturnInfo);//获取最大流水号
                        txtHCaseNo.Text = (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) + 1).ToString();
                        txtHCaseNo.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]).ToString();
@@ -3760,12 +3782,14 @@
                    string HBatchNo = "";   //批次
                    string HDate = "";      //日期
                    string sCaseNoNumber = "";      //箱号前缀
                    string sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value);
                    string sAuxItemName = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HAuxPropNameCol].Value);
                    HGroupID = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HGroupIDCol].Value);
                    HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HBatchNoCol].Value);
                    HDate = dtpHDate.Value.ToShortDateString();
                    HDate = SetDateStr(dtpHDate.Value);
                    //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ
                    sCaseNoNumber = HGroupID + HBatchNo + HDate;
                    //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ + ç‰©æ–™ä»£ç  +辅助属性
                    sCaseNoNumber = HGroupID + HBatchNo + HDate + sMaterNumber + sAuxItemName;
                    DataSet Ds = oWeb.getDataSetBySQL("exec h_p_WMS_GetMaxNo  '" + sCaseNoNumber + "'", "h_p_WMS_GetMaxNo", ref DBUtility.ClsPub.sExeReturnInfo);//获取最大流水号
                    txtHCaseNo.Text = (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) + 1).ToString();
                    txtHCaseNo.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]).ToString();
@@ -3791,12 +3815,15 @@
                    string HBatchNo = "";   //批次
                    string HDate = "";      //日期
                    string sCaseNoNumber = "";      //箱号前缀
                    string sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value);
                    string sAuxItemName = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HAuxPropNameCol].Value);
                    HGroupID = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HGroupIDCol].Value);
                    HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HBatchNoCol].Value);
                    HDate = dtpHDate.Value.ToShortDateString();
                    HDate = SetDateStr(dtpHDate.Value);
                    //箱号前缀 = ç­ç»„ID + æ‰¹æ¬¡ + æ—¥æœŸ
                    sCaseNoNumber = HGroupID + HBatchNo + HDate;
                    sCaseNoNumber = HGroupID + HBatchNo + HDate + sMaterNumber + sAuxItemName;
                    DataSet Ds = oWeb.getDataSetBySQL("exec h_p_WMS_GetMaxNo  '" + sCaseNoNumber + "'", "h_p_WMS_GetMaxNo", ref DBUtility.ClsPub.sExeReturnInfo);//获取最大流水号
                    txtHCaseNo.Text = (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) + 1).ToString();
                    txtHCaseNo.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]).ToString();
@@ -3812,5 +3839,23 @@
                txtHGroupID.Tag = "0";
            }
        }
        private void clear_Click(object sender, EventArgs e)
        {
            try
            {
                oWeb.getRunProc("exec h_p_Xt_ClearDataBaseProcess ", ref DBUtility.ClsPub.sExeReturnInfo);
                MessageBox.Show("清理数据库堵塞完成!");
            }
            catch (Exception sExeReturnInfo)
            {
                MessageBox.Show("清理数据库堵塞失败!" + sExeReturnInfo.Message);
            }
        }
        private void back_Click(object sender, EventArgs e)
        {
            bc.Enabled = false;
        }
    }
}