yxj
2021-10-13 977834430d3c53ad0237b696631909a0048ee743
条码档案列表批删调用方法修改
2个文件已修改
77 ■■■■■ 已修改文件
SCM/公用类/ClsPub1.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/条码打印/Gy_BarCodeBillList.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/¹«ÓÃÀà/ClsPub1.cs
@@ -15,11 +15,11 @@
        //public static string WEBSURL = "http://122.227.199.62:5050/WMSWEBS/WebService1.asmx";     //韩电    å¤–网              ï¼ˆä½œåºŸï¼‰
        //public static string WEBSURL = "http://192.168.10.60/WMSWEBS/WebService1.asmx";           //韩电    å†…网宁波(车间)(作废)
        //public static string WEBSURL = "http://192.168.2.16/WEBS-WMS/WebService1.asmx";           //颜本地电脑
        public static string WEBSURL = "http://192.168.2.16/WEBS-WMS/WebService1.asmx";           //颜本地电脑
        //public static string WEBSURL = "http://192.168.2.56/WEBS-WMS/WebService1.asmx";           //颜本地电脑(云络)
        //public static string WEBSURL = "http://192.168.10.61/WEB-WMS/WebService1.asmx";           //韩电    å†…网测试
        //public static string WEBSURL = "http://192.168.10.222/WMSWEBS/WebService1.asmx";          //韩电    MES服务器(内网)
        public static string WEBSURL = "http://122.227.199.62:5058/WMSWEBS/WebService1.asmx";     //韩电    MES服务器(外网)
        //public static string WEBSURL = "http://122.227.199.62:5058/WMSWEBS/WebService1.asmx";     //韩电    MES服务器(外网)
        public static long HOrgID = 0;
        public static string HOrgNumber = "";
        public static long HPersonL = 2;   // ä»“库人员为1,车间人员为2
SCM/ÌõÂë´òÓ¡/Gy_BarCodeBillList.cs
@@ -276,6 +276,7 @@
            }
            string HItemID = "";
            string HBarCode = "";
            string HBarCode2 = "";
            string HRemark = "";
            if (grdMain.CurrentRow == null)
                return;
@@ -285,8 +286,15 @@
                for (int i = 0; i < grdMain.SelectedRows.Count; i++)
                {
                    HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
                    HBarCode = HBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value);
                    HBarCode2 = HBarCode2 + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value);
                    if (i!=0 && i % 100 == 0)
                    {
                        HBarCode = HBarCode + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value);
                    }
                    else
                    {
                        HBarCode = HBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value);
                    }
                    if (DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("成品入库日期")].Value)!=""
                        || DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("生产汇报日期")].Value) != "")
                    {
@@ -301,11 +309,22 @@
                }
                try
                {
                    HItemID = HItemID.Remove(0, 1);
                    HItemID = HItemID.Remove(0, 1);     //去掉字符串第一个字符
                    HBarCode = HBarCode.Remove(0, 1);
                    oWeb.getRunProc("Delete from Gy_BarCodeBill where HItemID in (" + HItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                    oWeb.getRunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','批量删除条码:" + HBarCode + "','WMS系统-条码档案列表模块','" + DBUtility.ClsPub.IPAddress + "','删除'", ref DBUtility.ClsPub.sExeReturnInfo);
                    MessageBox.Show("条码编号:" + HBarCode + ",批量删除成功!");
                    HBarCode2 = HBarCode2.Remove(0, 1);
                    string[] NewBarCode;
                    NewBarCode = HBarCode.Split(Convert.ToChar("#"));
                    string[] sSQLMul = new string[grdMain.SelectedRows.Count];
                    sSQLMul[0] = "Delete from Gy_BarCodeBill where HItemID in (" + HItemID + ")";
                    for (int i = 0; i <= NewBarCode.Length-1; i++)
                    {
                        sSQLMul[i + 1] = "Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','批量删除条码:" + NewBarCode[i] + "','WMS系统-条码档案列表模块','" + DBUtility.ClsPub.IPAddress + "','删除'";
                    }
                    oWeb.getRunProcByMul(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo);
                    MessageBox.Show("条码编号:" + HBarCode2 + ",批量删除成功!");
                    Display();
                }
                catch (Exception e)
@@ -315,28 +334,28 @@
            }
            ////原先批量删除条码方法
            //DataSet DS;
            //DataSet DS2;
            //bool sBool = true;
            //Int64 lngBillKey = 0;
            //if (grdMain.SelectedRows == null)
            //    return;
            //if (MessageBox.Show("确定要批量删除所选单据?删除后不能恢复,请谨慎操作", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            //{
            //    string[] sSQLMul = new string[grdMain.SelectedRows.Count];
            //    for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
            //    {
            //        lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value);
            //        sSQLMul[i] = " Delete from Gy_BarCodeBill where HItemID= " + lngBillKey ;
            //        sSQLMul[i] = sSQLMul[i] + "  " + "insert into System_log values(GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.CurUserName + "','删除条码:" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value) + "' ,'WMS系统','','删除')";
            //    }
        ////原先批量删除条码方法
        //DataSet DS;
        //DataSet DS2;
        //bool sBool = true;
        //Int64 lngBillKey = 0;
        //if (grdMain.SelectedRows == null)
        //    return;
        //if (MessageBox.Show("确定要批量删除所选单据?删除后不能恢复,请谨慎操作", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
        //{
        //    string[] sSQLMul = new string[grdMain.SelectedRows.Count];
        //    for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
        //    {
        //        lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value);
        //        sSQLMul[i] = " Delete from Gy_BarCodeBill where HItemID= " + lngBillKey ;
        //        sSQLMul[i] = sSQLMul[i] + "  " + "insert into System_log values(GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.CurUserName + "','删除条码:" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value) + "' ,'WMS系统','','删除')";
        //    }
            //    oWeb.getRunProcByMul(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo);
            //}
            //MessageBox.Show("批量删除成功!", "提示");
            //Display();
        }
        //    oWeb.getRunProcByMul(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo);
        //}
        //MessageBox.Show("批量删除成功!", "提示");
        //Display();
    }
        private void timer2_Tick(object sender, EventArgs e)
        {