/// <summary> /// 创建用户 /// </summary> /// <param name="jsonBase">用户基本信息</param> /// <param name="jsonLogin">用户登录信息</param> /// <returns></returns> public bool CreateUser(string jsonBase, string jsonLogin) { //用户基本信息 var _jsonBase = SystemDataProvider.GetStandardJson(jsonBase.ToString()); Users user = JsonConvert.DeserializeObject<Users>(_jsonBase); user.ID = Guid.NewGuid().ToString("N").ToUpper(); user.CreateDate = DateTime.Now; user.LastChanged = DateTime.Now; user.Status = (int)AccountStatusEnum.Active; //用户登录信息 var _jsonLogin = SystemDataProvider.GetStandardJson(jsonLogin.ToString()); Membership member = JsonConvert.DeserializeObject<Membership>(_jsonLogin); member.ID = Guid.NewGuid().ToString("N").ToUpper(); member.UserId = user.UserId; member.LoweredLoginName = member.LoginName.ToLower(); member.Email = user.Email; member.LoweredEmail = user.Email.ToLower(); member.CreateDate = DateTime.Now; //创建用户登录信息 MembershipLogic mLogic = new MembershipLogic(); var value = mLogic.CreateMember(member); //创建用户基本信息 UsersLogic uLogic = new UsersLogic(); value = uLogic.CreateUser(user); return value; }
/// <summary> /// 查询用户列表,三个条件 部门、职位、状态 /// </summary> /// <param name="deptId"></param> /// <param name="jobTitle"></param> /// <param name="status"></param> /// <returns></returns> public List<UsersList> GetUsersList(string deptId, string jobTitle, string status) { UsersLogic ul = new UsersLogic(); List<UsersList> listUser = ul.GetUserList(deptId, jobTitle, status); return listUser; }
public Users GetUserInfo(int userId) { UsersLogic ul = new UsersLogic(); return ul.GetUserInfo(userId); }
/// <summary> /// 获取简单用户信息、编号 姓名 职位 部门 /// </summary> /// <returns></returns> public List<Users> GetDirectUser() { UsersLogic ul = new UsersLogic(); List<Users> listUser = ul.GetDirectUser(); return listUser; }
/// <summary> /// 获取所有用户 /// </summary> /// <param name="status">状态</param> /// <returns></returns> public List<Users> GetAllUser(AccountStatusEnum status) { UsersLogic ul = new UsersLogic(); var where = string.Format(" Status = {0}", (int)status); return ul.GetAllUser(where); }
/// <summary> /// 获取所有用户 /// </summary> /// <returns></returns> public List<Users> GetAllUser() { UsersLogic ul = new UsersLogic(); return ul.GetAllUser(""); }