杨乐
2022-01-06 c81eef52f7c2099ba0bbf8e6f32d0dcfc87c91a4
DAL/WMS/ClsGy_BarCodeBill_Ctl.cs
@@ -11,6 +11,10 @@
        //原代码 用于 替换子项目
        public string HOldNumber;
        public Model.ClsGy_BarCodeBill_WMS_Model oModel = new Model.ClsGy_BarCodeBill_WMS_Model();
        public const string ModRightName = "Gy_BarCodeBillList";
        public const string ModRightNameEdit = ModRightName + "_Edit";      //删除
        public const string ModRightNameDelete = ModRightName + "_Delete";  //作废
        public const string ModRightNamePrint = ModRightName + "_Print";    //打印
        //新增
        public override bool AddNew()
        {
@@ -220,6 +224,114 @@
            }
        }
        //删除条码
        public bool DeleteBill(long sHItemID, string sHBarCode, string CurUserName, ref string sReturn)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName))
            {
                sReturn = "您没有删除权限!";
                return true;
            }
            try
            {
                DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_Delete " + sHItemID + ",'" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_Delete", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS == null || DS.Tables[0].Rows.Count <= 0)
                {
                    oCn.CnClose();
                    oCn.CnDispose();
                    sReturn = "删除条码时发生错误!";
                    return true;
                }
                else
                {
                    //删除失败
                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
                    {
                        oCn.CnClose();
                        oCn.CnDispose();
                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                        return true;
                    }
                    else
                    //删除成功
                    {
                        oCn.CnClose();
                        oCn.CnDispose();
                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                        return false;
                    }
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //批量删除条码
        public bool MulDeleteBill(string sHItemID, string sHBarCode, string CurUserName, ref string sReturn)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName))
            {
                sReturn = "您没有删除权限!";
                return true;
            }
            try
            {
                DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete '" + sHItemID + "','" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_MulDelete", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS == null || DS.Tables[0].Rows.Count <= 0)
                {
                    oCn.CnClose();
                    oCn.CnDispose();
                    sReturn = "批量删除条码时发生错误!";
                    return true;
                }
                else
                {
                    //批量删除失败
                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
                    {
                        oCn.CnClose();
                        oCn.CnDispose();
                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                        return true;
                    }
                    else
                    //批量删除成功
                    {
                        oCn.CnClose();
                        oCn.CnDispose();
                        sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                        return false;
                    }
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //构造函数
        public ClsGy_BarCodeBill_Ctl()
        {