Example #1
0
        public void GetInCharges()
        {
            List <Entity.User> ls  = new List <Entity.User>();
            string             sql = "SELECT UserCode,UserName From utb_users WHERE RoleID>1";

            InCharges = DTUtilis.LoadValueFromDT <Entity.User>(Mysql.Instance.Query(sql).Tables["ds"], ls);
        }
Example #2
0
        public void GetAllUsers()
        {
            List <Entity.User> ls  = new List <Entity.User>();
            string             sql = "SELECT UserCode,UserName From utb_users";

            Allusers = DTUtilis.LoadValueFromDT <Entity.User>(Mysql.Instance.Query(sql).Tables["ds"], ls);
        }
Example #3
0
        public List <Entity.Department> GetDepts()
        {
            List <Entity.Department> ls = new List <Entity.Department>();
            string sql = "Select * from utb_dept";

            return(DTUtilis.LoadValueFromDT <Entity.Department>(Mysql.Instance.Query(sql).Tables["ds"], ls));
        }
Example #4
0
        public PSPUser GetUser(string Uid, string Pwd)
        {
            PSPUser p   = new PSPUser();
            string  sql = "SELECT a.UserCode,a.UserName,a.UserPass,a.Email,a.MPHoneNo,a.RoleID,a.deptID,b.RoleName,c.deptname " +
                          "FROM utb_users AS a LEFT JOIN utb_roles AS b ON a.RoleID = b.RoleID LEFT JOIN utb_dept AS c ON a.`deptID` = c.`deptid` " +
                          $"WHERE a.UserCode = '{Uid}' AND a.UserPass = MD5('{Pwd}');";

            DTUtilis.LoadValueFromDT(Mysql.Instance.Query(sql).Tables["ds"], p);
            return(p);
        }