private void CreateAndReturnButton_Click(object sender, EventArgs e) { if (ValidateUserInput()) // Verifying if user input confirm with all requirements { String message = UserInformationManager.CreateNewUserProfileInformation(CreateUserProfile()); // Confimring the user creation process if (message == "SUCCESS") // Creation process has been successful { messageLabel.Text = "User has been created succesfully!"; ClearTextBoxBuffers(); // cleaning textboxes // Closing form while freeing system resources FormsMenuList.registerNewUserForm.Dispose(); // Summon Users Registry Form FormsMenuList.usersRegistryForm = new UsersRegistryForm(); FormsMenuList.usersRegistryForm.Show(); } else { // Executing correct activity according to given code SystemProtocols.ApplyActivityProtocols("ERR2", null, null); messageLabel.Text = "A Fatal Error has occured!"; // The new user profile has not been created due to en error } } else { messageLabel.Text = "Please fill in every information correctly"; // user input has not been validated } }
private void CreateNewUserButton_Click(object sender, EventArgs e) { if (ValidateUserInput()) // Verifying if user input confirm with all requirements { String message = UserInformationManager.CreateNewUserProfileInformation(CreateUserProfile()); // Confimring the user creation process if (message == "SUCCESS") // Creation process has been successful { messageLabel.Text = "User " + usernameTextBox.Text + " has been created succesfully!"; ClearTextBoxBuffers(); // cleaning textboxes } else { // Executing correct activity according to given code SystemProtocols.ApplyActivityProtocols("ERR2", null, null); messageLabel.Text = "A Fatal Error has occured!"; // The new user profile has not been created due to en error } } else { messageLabel.Text = "Please fill in every information correctly"; // user input has not been validated } }