You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.5 KiB

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;
}
/// <summary>
/// 查询用户信息
/// </summary>
/// <param name="userName">用户名</param>
/// <param name="group">分组</param>
/// <returns></returns>
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;
}
}
}