Esempio n. 1
0
        /// <summary>
        /// 获得人员
        /// </summary>
        /// <param name="code">人员编号</param>
        /// <returns></returns>
        public Bill_Users GetUserByCode(string code)
        {
            string sql = " select * from bill_users where userCode=@userCode ";

            SqlParameter[] sps = { new SqlParameter("@userCode", code) };
            using (SqlDataReader dr = DataHelper.GetDataReader(sql, sps))
            {
                if (dr.Read())
                {
                    Bill_Users users = new Bill_Users();
                    users.IsSystem     = Convert.ToString(dr["IsSystem"]);
                    users.UserCode     = Convert.ToString(dr["UserCode"]);
                    users.UserDept     = Convert.ToString(dr["UserDept"]);
                    users.UserGroup    = Convert.ToString(dr["UserGroup"]);
                    users.UserName     = Convert.ToString(dr["UserName"]);
                    users.UserPwd      = Convert.ToString(dr["UserPwd"]);
                    users.UserStatus   = Convert.ToString(dr["UserStatus"]);
                    users.UserPosition = Convert.ToString(dr["userPosition"]);

                    return(users);
                }
                else
                {
                    return(null);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 插入人员
        /// </summary>
        /// <param name="user"></param>
        /// <param name="trans"></param>
        public void InserUser(Bill_Users user, SqlTransaction trans)
        {
            string sql = @"insert into bill_users(userCode, userName, userGroup, userStatus, userDept, userPwd, isSystem,userPosition)values
                           ( @userCode, @userName, @userGroup, @userStatus, @userDept, @userPwd, @isSystem,@userPosition)";

            SqlParameter[] sps =
            {
                new SqlParameter("@userCode",     user.UserCode),
                new SqlParameter("@userName",     user.UserName),
                new SqlParameter("@userGroup",    user.UserGroup),
                new SqlParameter("@userStatus",   user.UserStatus),
                new SqlParameter("@userDept",     user.UserDept),
                new SqlParameter("@userPwd",      user.UserPwd),
                new SqlParameter("@isSystem",     user.IsSystem),
                new SqlParameter("@userPosition", user.UserPosition)
            };
            DataHelper.ExcuteNonQuery(sql, trans, sps, false);
        }
Esempio n. 3
0
        /// <summary>
        /// 获得所有的人员
        /// </summary>
        /// <returns></returns>
        public IList <Bill_Users> GetAllUser()
        {
            string             sql  = "select * from bill_users ";
            DataTable          dt   = DataHelper.GetDataTable(sql, null, false);
            IList <Bill_Users> list = new List <Bill_Users>();

            foreach (DataRow dr in dt.Rows)
            {
                Bill_Users users = new Bill_Users();
                users.IsSystem   = Convert.ToString(dr["IsSystem"]);
                users.UserCode   = Convert.ToString(dr["UserCode"]);
                users.UserDept   = Convert.ToString(dr["UserDept"]);
                users.UserGroup  = Convert.ToString(dr["UserGroup"]);
                users.UserName   = Convert.ToString(dr["UserName"]);
                users.UserPwd    = Convert.ToString(dr["UserPwd"]);
                users.UserStatus = Convert.ToString(dr["UserStatus"]);
                list.Add(users);
            }
            return(list);
        }
Esempio n. 4
0
 public UserMessage(Bill_Users tempuser)
 {
     users = tempuser;
 }
Esempio n. 5
0
 public UserMessage(string code)
 {
     users = userDal.GetUserByCode(code);
 }