Exemplo n.º 1
0
        /// <summary>
        /// 查询所有密保问题
        /// </summary>
        /// <returns></returns>
        public DataSet GetMP_PasswordType()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from P_PasswordType");

            return(DBHelp.DateSet(strSql.ToString()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * ");
            strSql.Append(" FROM P_Provience ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return(DBHelp.DateSet(strSql.ToString()));
        }
Exemplo n.º 3
0
        public DataSet SelectAdmin(string where)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select U_Id as ID,");
            strSql.Append(" U_Name2 as 用户名,U_RelName as 姓名,(case  U_Sex  when '0' then '男' when '1' then '女'  else ''  end  ) as 性别,");
            strSql.Append(" U_Telephone as 联系电话");
            strSql.Append(" from U_UserInfo");
            if (where != "")
            {
                strSql.Append(" where " + where);
            }
            return(DBHelp.DateSet(strSql.ToString()));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 查询所有管理员| 用户信息
        /// </summary>
        /// <param name="roletype">1:普通用户 2:管理员</param>
        /// <returns></returns>
        public DataSet SelectAdminAAA(string where)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select U_Id as 用户编号,");
            strSql.Append(" U_Name2 as 用户名,U_RelName as 真实姓名,(case  U_Sex  when '0' then '男' when '1' then '女'  else ''  end  ) as 性别,");
            strSql.Append(" U_Birthday as 出生日期, U_IdCard as 身份证号,U_Address as 家庭住址,U_Telephone as 联系电话");
            strSql.Append(" from U_UserInfo");
            if (where != "")
            {
                strSql.Append(" where " + where);
            }
            return(DBHelp.DateSet(strSql.ToString()));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" * ");
            strSql.Append(" FROM U_UserInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return(DBHelp.DateSet(strSql.ToString()));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 根据用户名和密保问题查询出密码
        /// </summary>
        /// <param name="U_Id"></param>
        /// <returns></returns>
        public DataSet ShowPwd(string U_Name, string pwd)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1 U_PassWord from U_UserInfo");
            strSql.Append(" where ");
            strSql.Append(" U_Name2 = @U_Name and U_PsdAnswer=@U_PsdAnswer ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@U_Name",      SqlDbType.VarChar, 50),
                new SqlParameter("@U_PsdAnswer", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = U_Name;
            parameters[1].Value = pwd;

            DataSet ds = DBHelp.DateSet(strSql.ToString(), parameters);

            return(ds);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 查询用户名和密码是否存在
        /// </summary>
        /// <param name="U_Id"></param>
        /// <returns></returns>
        public DataSet ExistsPwd(string U_Name, string pwd)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1 U_Id,U_RoleType,U_DepType,U_Position from U_UserInfo");
            strSql.Append(" where ");
            strSql.Append(" U_Name2 = @U_Name and U_PassWord=@U_PassWord ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@U_Name",     SqlDbType.VarChar, 50),
                new SqlParameter("@U_PassWord", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = U_Name;
            parameters[1].Value = pwd;

            DataSet ds = DBHelp.DateSet(strSql.ToString(), parameters);

            return(ds);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MU_UserInfo GetModel(int U_Id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * ");
            strSql.Append("  from U_UserInfo ");
            strSql.Append(" where U_Id=@U_Id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@U_Id", SqlDbType.Int, 4)
            };
            parameters[0].Value = U_Id;

            MU_UserInfo model = new MU_UserInfo();
            DataSet     ds    = DBHelp.DateSet(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["U_Id"].ToString() != "")
                {
                    model.U_Id = int.Parse(ds.Tables[0].Rows[0]["U_Id"].ToString());
                }
                model.U_NativePlace = ds.Tables[0].Rows[0]["U_NativePlace"].ToString();
                model.U_Address     = ds.Tables[0].Rows[0]["U_Address"].ToString();
                model.U_Telephone   = ds.Tables[0].Rows[0]["U_Telephone"].ToString();
                model.U_Email       = ds.Tables[0].Rows[0]["U_Email"].ToString();
                model.U_PostalId    = ds.Tables[0].Rows[0]["U_PostalId"].ToString();
                model.U_Position    = ds.Tables[0].Rows[0]["U_Position"].ToString();
                model.U_Reamrk      = ds.Tables[0].Rows[0]["U_Remark"].ToString();
                if (ds.Tables[0].Rows[0]["U_LoginTime"].ToString() != "")
                {
                    model.U_LoginTime = DateTime.Parse(ds.Tables[0].Rows[0]["U_LoginTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["U_RoleType"].ToString() != "")
                {
                    model.U_RoleType = int.Parse(ds.Tables[0].Rows[0]["U_RoleType"].ToString());
                }
                model.U_Name    = ds.Tables[0].Rows[0]["U_Name2"].ToString();
                model.U_RelName = ds.Tables[0].Rows[0]["U_RelName"].ToString();
                if (ds.Tables[0].Rows[0]["U_Sex"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["U_Sex"].ToString() == "1") || (ds.Tables[0].Rows[0]["U_Sex"].ToString().ToLower() == "true"))
                    {
                        model.U_Sex = true;
                    }
                    else
                    {
                        model.U_Sex = false;
                    }
                }
                model.U_PassWord = ds.Tables[0].Rows[0]["U_PassWord"].ToString();
                if (ds.Tables[0].Rows[0]["U_Birthday"].ToString() != "")
                {
                    model.U_Birthday = DateTime.Parse(ds.Tables[0].Rows[0]["U_Birthday"].ToString());
                }
                if (ds.Tables[0].Rows[0]["U_PsdType"].ToString() != "")
                {
                    model.U_PsdType = int.Parse(ds.Tables[0].Rows[0]["U_PsdType"].ToString());
                }
                model.U_PsdAnswer = ds.Tables[0].Rows[0]["U_PsdAnswer"].ToString();
                model.U_IdCard    = ds.Tables[0].Rows[0]["U_IdCard"].ToString();
                if (ds.Tables[0].Rows[0]["U_Image"].ToString() != "")
                {
                    model.U_Image = (byte[])ds.Tables[0].Rows[0]["U_Image"];
                }
                //model.U_DepType = int.Parse(ds.Tables[0].Rows[0]["U_DepType"].ToString());
                return(model);
            }
            else
            {
                return(null);
            }
        }