using RS.DBUtility; using RS.Model; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RS.SQLServerDAL { public class SSTUserInfo { public DataTable GetUserInfoTable(string group) { DataTable dataTable = null; try { string strSql = ""; strSql += "SELECT * FROM tb_usermanager" + " "; strSql += "WHERE user_group ='" + group + "'" + " "; strSql += "ORDER BY id ASC"; MySqlHelper sHelper = new MySqlHelper(); dataTable = sHelper.QuerySql(strSql); } catch (Exception ex) { ex.ToString(); } return dataTable; } /// /// 查询用户信息 /// /// 用户名 /// 分组 /// public ToolsUsersManage GetUserInfoByRepNo(string userName,string group) { ToolsUsersManage userInfo = null; try { string strSql = ""; strSql += "SELECT * FROM tb_usermanager" + " "; strSql += "WHERE user_name ='" + userName + "'" + " "; strSql += "and user_group ='" + group + "'" + " "; strSql += "ORDER BY id ASC"; MySqlHelper sHelper = new MySqlHelper(); DataTable dataTable = sHelper.QuerySql(strSql); int rownum = dataTable.Rows.Count; if (rownum > 0) { userInfo = new ToolsUsersManage(); object objID = dataTable.Rows[0]["id"]; userInfo.f_id = (objID == null || objID.ToString().Trim() == "") ? 0 : Convert.ToInt32(objID); userInfo.userName = dataTable.Rows[0]["user_name"] == null ? "" : dataTable.Rows[0]["user_name"].ToString().Trim(); userInfo.userPw = dataTable.Rows[0]["user_pw"] == null ? "" : dataTable.Rows[0]["user_pw"].ToString().Trim(); userInfo.userGroup = dataTable.Rows[0]["user_group"] == null ? "" : dataTable.Rows[0]["user_group"].ToString().Trim(); } } catch (Exception ex) { ex.ToString(); } return userInfo; } } }