public UserManageModel GetUserManageModel(int?id) { var user = GetById(id); if (user != null) { return(new UserManageModel { Id = user.Id, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, Password = user.Password, ConfirmPassword = user.Password, Status = user.Status, StatusList = GetStatus(), Phone = user.Phone, Gender = user.Gender, Genders = EnumUtilities.GetSelectListFromEnum <UserEnums.GenderEnums>(), About = user.About, Address = user.Address, IdentityNumber = user.IdentityNumber, LastLogin = user.LastLogin, Facebook = user.Facebook, Twitter = user.Twitter, Google = user.Google, AvatarFileName = user.AvatarFileName, BirthDay = user.BirthDay, Created = user.Created, CreatedBy = user.CreatedBy, Updated = user.Updated, UpdatedBy = user.UpdatedBy, UserGroupIds = user.UserInGroups.Select(g => g.UserGroupId), UserGroups = _userGroupServices.GetUserGroups(user.Id) }); } return(new UserManageModel { UserGroups = _userGroupServices.GetUserGroups() }); }
public JsonResult GetUserGroups(int?id) { return(Json(_userGroupServices.GetUserGroups(id), JsonRequestBehavior.AllowGet)); }