public ManageUsersForm(ManageUsersFormType formType) { InitializeComponent(); context = ContextProvider.GetApplicationContext(); this.formType = formType; ChangeFormType(formType); }
private void UserRolesRadioButton_CheckedChanged(object sender, EventArgs e) { if (UserRolesRadioButton.Checked) { formType = ManageUsersFormType.ManageUserRoles; this.Text = "Manage user roles"; ChangeFormType(formType); SearchBox.Text = string.Empty; users = updateFunc(string.Empty); RenderListView(); } }
private void NotActivatedUsersRadioButton_CheckedChanged(object sender, EventArgs e) { if (NotActivatedUsersRadioButton.Checked) { formType = ManageUsersFormType.ManageNotActivatedUsers; this.Text = "Manage not activated or rejected users"; ChangeFormType(formType); SearchBox.Text = string.Empty; users = updateFunc(string.Empty); RenderListView(); } }
private void ChangeFormType(ManageUsersFormType formType) { if (formType == ManageUsersFormType.ManageNotActivatedUsers) { updateFunc = GetUpdateFuncForManagingNotActivatedUsers(); SetDefaultValueToUserRolesComboBox(); UserRolesComboBox.Enabled = false; ActivateButton.Visible = true; ChangeRoleButton.Visible = false; RejectButton.Visible = true; NotActivatedUsersRadioButton.Checked = true; TargetRoleLable.Visible = false; TargetRoleComboBox.Visible = false; return; } if (formType == ManageUsersFormType.ManageActivatedUsers) { updateFunc = GetUpdateFuncForManagingActivatedUsers(); SetDefaultValueToUserRolesComboBox(); UserRolesComboBox.Enabled = false; ActivateButton.Visible = false; ChangeRoleButton.Visible = false; RejectButton.Visible = true; TargetRoleComboBox.Visible = false; TargetRoleLable.Visible = false; ActivatedUsersRadioButton.Checked = true; return; } if (formType == ManageUsersFormType.ManageUserRoles) { updateFunc = GetUpdateFuncForManagingUserRoles(); SetItemsInUserRolesComboBox(); UserRolesComboBox.Enabled = true; ActivateButton.Visible = false; ChangeRoleButton.Visible = true; RejectButton.Visible = false; TargetRoleComboBox.Visible = true; TargetRoleLable.Visible = true; UserRolesRadioButton.Checked = true; return; } }