Beispiel #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dbn">数据库名称</param>
 public DataHandle(DataBaseName dbn)
 {
     //根据不同数据库名称初始化不同数据操作(改变连接字符串)
     switch (dbn)
     {
     //case DataBaseName.SCIC60: DB = WebCommon.GetDB_WJSJZX(); break;
     //case DataBaseName.WebPlat50: DB = WebCommon.GetDB_WEBPLA50(); break;
     //case DataBaseName.DBSZHCACredit: DB = WebCommon.GetDB_DBSZHCACREDIT(); break;
     case DataBaseName.WJSJZX: DB = WebCommon.GetDB_WJSJZX(); break;
     }
     //初始化参数
     spc = DB.CreateSqlParameterCollection();
 }
Beispiel #2
0
        public UserInfo(string loginID)
        {
            DBOperator             db = WebCommon.GetDB_WJSJZX();
            SqlParameterCollection p  = db.CreateSqlParameterCollection();

            string sql = "select * from UserInfo where loginID=@loginID";

            p.Add("@loginID", loginID);
            DataTable dt = db.ExeSqlForDataTable(sql, p, "table");

            if (dt.Rows.Count == 1)
            {
                this.currUserInfo = dt.Rows[0];
            }
        }
Beispiel #3
0
        /// <summary>
        /// 是否需要判断权限
        /// </summary>
        public bool IsUserRight(string module)
        {
            bool                   result = true;
            DBOperator             db     = WebCommon.GetDB_WJSJZX();
            SqlParameterCollection p      = db.CreateSqlParameterCollection();

            p.Add("@loginID", this.LoginID);
            p.Add("@module", module);

            string sql = " select top 1 isRight from d_modules"
                         + " where isRight=0 and moduleNo=@module ";

            if (db.ExeSqlForDataTable(sql, p, "table").Rows.Count > 0)
            {
                result = false;
            }
            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// 管理用户是否具有删除权限
        /// </summary>
        public bool GetUserRight_Delete(string module)
        {
            DBOperator             db = WebCommon.GetDB_WJSJZX();
            SqlParameterCollection p  = db.CreateSqlParameterCollection();

            p.Add("@loginID", this.LoginID);
            p.Add("@module", module);

            if (IsUserRight(module) == false)
            {
                return(true);
            }
            else
            {
                string sql = "select top 1 loginID from V_Scgl_UserRoleRights"
                             + " where loginID=@loginID and (Right_Delete=1) and moduleNo=@module";
                return(db.ExeSqlForDataTable(sql, p, "table").Rows.Count > 0);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 填充 DropDownList
        /// </summary>
        public static void DropDownListDataBind(DBDropDownList dropdonlist, bool addSpaceItem)
        {
            string sql = string.Empty;

            switch (dropdonlist.ToolTip)
            {
            /*2015-3-31 李贯涛 综合监管招标方式*/
            case "zbfs":    //招标方式
                sql = "select CodeInfo,Code from tbTenderTypeDic ";
                break;

            case "PrjType":
                sql = "select CodeInfo,Code from tbPrjTypeDic ";
                break;

            case "Lxjb":
                sql = "select CodeInfo,Code from tbLxjbDic ";
                break;

            case "PrjProperty":
                sql = "select CodeInfo,Code from tbPrjPropertyDic ";
                break;

            case "PrjStructureType":
                sql = "select CodeInfo,Code from tbPrjStructureTypeDic ";
                break;

            case "TenderClass":
                sql = "select CodeInfo,Code from tbTenderClassDic ";
                break;

            case "TenderType":
                sql = "select CodeInfo,Code from tbTenderTypeDic ";
                break;

            case "ContractType":
                sql = "select CodeInfo,Code from tbContractTypeDic order by OrderID ";
                break;

            case "WorkDuty":
                sql = "select CodeInfo,Code from tbWorkDutyDic ";
                break;

            case "IDCardType":
                sql = "select CodeInfo,Code from tbIDCardTypeDic ";
                break;

            case "SpecialtyType":
                sql = "select CodeInfo,Code from tbSpecialtyTypeDic ";
                break;

            case "Xzqdm":
                sql = "select CodeInfo,Code from tbXzqdmDic where parentCode='320200' ";
                break;

            case "ApprovalLevel":
                sql = "select CodeInfo,Code from tbLxjbDic  ";
                break;

            case "xmsd":
                sql = "select CodeInfo,Code from tbXzqdmDic where parentCode='320200' ";
                break;
            }
            if (sql != string.Empty)
            {
                DataTable dt = WebCommon.GetDB_WJSJZX().ExeSqlForDataTable(sql, null, "t");
                UIUtility.ListControlDataBind(dropdonlist, dt, addSpaceItem);
            }
        }