private void button_End_Tab1_Click(object sender, RoutedEventArgs e) { if (Validate()) { UserRole selectedRole; switch ((string)roleComboBox.SelectedValue) { case "Client": selectedRole = UserRole.Client; break; case "Admin": selectedRole = UserRole.Admin; break; case "Operator": selectedRole = UserRole.Operator; break; case "Security Service Employee": selectedRole = UserRole.SecurityServiceEmployee; break; default: selectedRole = UserRole.Client; break; } //register user if it's not a client _userBusinessComponent.Add(textBox_Create_Login.Text, passwordBox_Create_Password.Password, selectedRole); MessageBox.Show("Registered successfully!"); } }