yangle
2025-04-08 b0688c1efd606284fd5bc31f2d60a1fec9aef968
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace BLL
{
    public  class ClsKF_PublicFun
    {
        /// <summary>
        /// ¸ù¾Ýµ¥¾ÝÀàÐÍ·µ»Øµ¥¾ÝÄÚÂëºÍµ¥¾ÝºÅ£¬²¢ÅжÏÊÇ·ñÒѾ­´æÔÚÖØ¸´µÄÊý¾Ý
        /// </summary>
        /// <param name="HTranType"></param>
        /// <param name="HBillNo"></param>
        /// <param name="HInterID"></param>
        /// <param name="sErrMsg"></param>
        /// <returns></returns>
        public bool get_MaxBillNoAndID(string HTranType, ref string HBillNo, ref Int64 HInterID, ref string sErrMsg)
        {
            HInterID = DBUtility.ClsPub.CreateBillID_Prod(HTranType, ref sErrMsg);
            HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HTranType, ref sErrMsg, true);
            //Ô­ÏÈ»ñÈ¡·½·¨
            //HInterID = DBUtility.ClsPub.CreateBillID(HTranType, ref sErrMsg);
            //HBillNo = DBUtility.ClsPub.CreateBillCode(HTranType, ref sErrMsg, true);
            //ÅжÏÊÇ·ñ´æÔÚÏàͬµ¥¾ÝÄÚÂë»òµ¥¾ÝºÅ
            try
            {
                DataSet ds;
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS  " + HInterID + ",'" + HBillNo + "'", "h_p_IF_CheckBillIDExists_WMS");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "´æÔÚÖØ¸´µ¥¾ÝÄÚÂë»òµ¥¾ÝºÅµÄµ¥¾Ý£¬²»ÔÊÐíÐÂÔö£¬ÇëÍ˳öºóÖØÐµÇ¼£¡";
                    return false;
                }
                else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) == "1")
                {
                    sErrMsg = "´æÔÚÖØ¸´µ¥¾ÝÄÚÂë»òµ¥¾ÝºÅµÄµ¥¾Ý£¬²»ÔÊÐíÐÂÔö£¬ÇëÍ˳öºóÖØÐµÇ¼£¡";
                    return false;
                }
                else
                {
                    return true;
                }
            }
            catch (Exception e)
            {
                sErrMsg = "ÖØ¸´µ¥¾ÝÄÚÂëÅжÏʧ°Ü£¡" + e.Message;
                return false;
            } 
        }
 
        /// <summary>
        /// ÅжÏÓû§ÊÇ·ñÓÐȨÏÞ£¬²¢¸ù¾Ýϵͳ²ÎÊýÅжÏWISEÓû§ÊÇ·ñÓаó¶¨
        /// </summary>
        /// <param name="ModRightName"></param>
        /// <param name="sUserName"></param>
        /// <param name="sErrMsg"></param>
        /// <returns></returns>
        public bool CheckModRight(string ModRightName, string sUserName, ref string sErrMsg)
        {
            try
            {
                //»ñȡϵͳ²ÎÊý
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                if (oSystemParameter.ShowBill(ref sErrMsg) == false)
                {
                    sErrMsg = "»ñȡϵͳ²ÎÊýʧ°Ü£¡ " + sErrMsg;
                    return false;
                }
                //ÅжÏȨÏÞ
                if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, sUserName))
                {
                    sErrMsg = "ÄúûÓÐȨÏÞ,ÇëÓë¹ÜÀíÔ±ÁªÏµ£¡";
                    return false;
                }
                //
                if (oSystemParameter.omodel.Kf_MateOutBill_ERPMode.ToUpper() == "WISE") //ÅжÏͬ²½Ä£Ê½ÊǽðµûWISE
                {
                    //ÅжÏÓû§ÊÇ·ñ°ó¶¨½ðµûÕ˺Å
                    DataSet ds;
                    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                    ds = oCN.RunProcReturn("exec h_p_K3_User  '" + sUserName + "'", "K3_User");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        sErrMsg = "ÄúµÄÓû§Ã»Óа󶨽ðµûÕ˺Å,ÇëÓë¹ÜÀíÔ±ÁªÏµ£¡";
                        return false;
                    }
                }
                return true;
            }
            catch (Exception e)
            {
                sErrMsg = "ȨÏÞÅжÏʧ°Ü£¡" + e.Message;
                return false;
            }
        }
 
        /// <summary>
        /// ¸ù¾ÝÓû§ÃûºÍÊäÈëµÄÃÜÂ룬ÑéÖ¤µÇ¼ÊÇ·ñÔÊÐí
        /// </summary>
        /// <param name="sUserName"></param>
        /// <param name="sUserPsd"></param>
        /// <returns></returns>
        public DataSet get_User(string sUserName, string sUserPsd, ref string sErrMsg)
        {
            try
            {
                DAL.ClsUser oUser = new DAL.ClsUser();
                return oUser.CheckMainID(sUserName, DBUtility.ClsPub.StrToPsd(sUserPsd));
            }
            catch (Exception e)
            {
                sErrMsg = "Óû§ÅжÏʧ°Ü£¡" + e.Message;
                return null;
            }
        }
 
        
 
    }
}