zzr99
2022-03-28 caf31525f29e659cca49dd6e35b5f13e8e0496d7
DAL/WMS/ClsGy_BarCodeBill_Ctl.cs
@@ -321,7 +321,95 @@
        //条码生成模块调用    条码打印前,条码打印次数控制(是否超过允许可打印次数)
        public bool Set_CheckPrintQty_SD(Int64 HInterID, long PrintQty, ref string sReturn)
        {
            DataSet DS;
            string sBarCode = "";
            DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '唯一条码' and HInterID = " + HInterID + " for xml path('')),1,1,'')", "Gy_BarCodeBill");
            if (DS == null || DS.Tables[0].Rows.Count == 0)
            {
                sReturn = "正常!";
                return false;
            }
            else
            {
                sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]);
                if (sBarCode == "")
                {
                    sReturn = "正常!";
                    return false;
                }
                else
                {
                    sReturn = "条码编号:" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + ",已打印" + PrintQty + " 次,不允许再次预览打印!";
                    return true;
                }
            }
        }
        //条码档案列表模块调用    条码打印前,条码打印次数控制(是否超过允许可打印次数)
        public bool Set_CheckPrintQty(string sBarCodeItemID,long PrintQty, ref string sReturn)
        {
            DataSet DS;
            string sBarCode = "";
            DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '唯一条码' and HItemID in (" + sBarCodeItemID + ") for xml path('')),1,1,'')", "Gy_BarCodeBill");
            if (DS == null || DS.Tables[0].Rows.Count == 0)
            {
                sReturn = "正常!";
                return false;
            }
            else
            {
                sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]);
                if (sBarCode == "")
                {
                    sReturn = "正常!";
                    return false;
                }
                else
                {
                    sReturn = "条码编号:" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + ",已打印" + PrintQty + " 次,不允许再次预览打印!";
                    return true;
                }
            }
        }
        //条码生成模块调用    条码打印后,更新条码打印次数
        public bool Set_UpdatePrintQty_SD(Int64 HInterID)
        {
            try
            {
                oCn.BeginTran();
                //更新 条码打印次数
                oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID = " + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //条码档案列表模块调用    条码打印后,更新条码打印次数
        public bool Set_UpdatePrintQty(string sBarCodeItemID)
        {
            try
            {
                oCn.BeginTran();
                //更新 条码打印次数
                oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HItemID in (" + sBarCodeItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }