/// <summary> /// Populate the user role id to UserRole entity dictionary /// </summary> public void SetUserRoleList(int roleType) { UserRoleDropdownList.Add(new SelectListItem() { Value = "", Text = "Please select user group", Selected = true }); using (var proxy = new UserProxy()) { List <UserRole> List = proxy.GetAllUserGroupList().Where(ud => ud.RoleType <= roleType).ToList(); foreach (UserRole item in List) { UserRoleDropdownList.Add(new SelectListItem() { Value = StringHelper.ToString(item.UserRoleId), Text = item.RoleName }); DicUserRole.Add(StringHelper.ToString(item.UserRoleId), item); } } using (var proxy = new UserProxy()) { OrganizationDropdownList = new List <SelectListItem>(); OrganizationDropdownList.Add(new SelectListItem() { Value = "", Text = "Please select Organisation", Selected = true }); List <Organisation> List = proxy.GetAllOrganizationList().ToList(); foreach (Organisation item in List) { OrganizationDropdownList.Add(new SelectListItem() { Value = Convert.ToString(item.Organisation_GUID), Text = item.OrganisationName }); } } }
/// <summary> /// User detail model constructor /// </summary> public UserDetailModel() { ChangePasswordNextLogin = true; using (var proxy = new UserProxy()) { OrganizationDropdownList = new List <SelectListItem>(); UserGroupList = proxy.GetAllUserGroupList().ToList(); OrganizationDropdownList.Add(new SelectListItem() { Value = "", Text = "Please select Organisation", Selected = true }); List <Organisation> List = proxy.GetAllOrganizationList().ToList(); foreach (Organisation item in List) { OrganizationDropdownList.Add(new SelectListItem() { Value = Convert.ToString(item.Organisation_GUID), Text = item.OrganisationName }); } } BlastManagerWebSettingsDropdownList = new List <SelectListItem>(); using (var proxy = new CommonProxy()) { BlastManagerWebSettingsDropdownList.Add(new SelectListItem() { Value = "", Text = "Please select Language", Selected = true }); List <SystemType> List = proxy.GetSystemTypebyLanguage(Constants.SystemTypeCategory.Language); foreach (SystemType item in List) { BlastManagerWebSettingsDropdownList.Add(new SelectListItem() { Value = Convert.ToString(item.TypeKey), Text = item.DisplayName }); } } //foreach (RoleType en in Enum.GetValues(typeof(RoleType))) //{ // status = Utilities.GetSystemTypeName(Constants.SystemTypeCategory.Language, (int)en); // if (!string.IsNullOrWhiteSpace(status)) // { // BlastManagerWebSettingsDropdownList.Add(new SelectListItem() { Text = status, Value = Convert.ToString((int)en) }); // } //} }