/// <summary> /// 根据员工编号和密码获取用户 /// </summary> /// <param name="employeeNO">员工编号</param> /// <param name="passWord">密码</param> /// <returns></returns> public static UserProfile GetUserProfileByUserIDNew(string employeeNO, string passWord) { DataTable dtUser = GetDataSet.GetUesrProfileByUserIDandPwdNew(employeeNO, passWord); if (dtUser != null && dtUser.Rows.Count > 0) { UserProfile user = new UserProfile(); user.ID = dtUser.Rows[0]["ID"].ToString(); user.Name = dtUser.Rows[0]["name"].ToString(); user.EmployeeNO = dtUser.Rows[0]["employeeno"].ToString(); user.toRegularDate = Convert.ToDateTime(dtUser.Rows[0]["toRegularDate"]); List <Menu> lstMenu = new List <Menu>(); Menu menu = new Menu(); for (int i = 0; i < dtUser.Rows.Count; i++) { menu = new Menu(); menu.Name = dtUser.Rows[i]["MENUNAME"].ToString(); menu.Path = dtUser.Rows[i]["MENUPATH"].ToString(); menu.ParentID = dtUser.Rows[i]["PARENTID"].ToString(); menu.Remarks = dtUser.Rows[i]["REMARKS"].ToString(); menu.Available = Convert.ToBoolean(dtUser.Rows[i]["Available"]); lstMenu.Add(menu); } user.Menu = lstMenu; List <Role> lstRole = new List <Role>(); Role role = new Role(); for (int i = 0; i < dtUser.Rows.Count; i++) { role = new Role(); role.RoleID = dtUser.Rows[i]["roleID"].ToString(); role.RoleName = dtUser.Rows[i]["roleName"].ToString(); lstRole.Add(role); } user.Role = lstRole; return(user); } else { return(null); } }
/// <summary> /// 根据员工编号和密码获取用户(新) /// </summary> /// <param name="employeeNO"></param> /// <param name="password"></param> /// <returns></returns> public static DataTable GetUesrProfileByUserIDandPwdNew(string employeeNO, string password) { return(GetDataSet.GetUesrProfileByUserIDandPwdNew(employeeNO, password)); }