private void btnRegister_Click(object sender, EventArgs e) { if (txtUsername.Text == "") { MessageBox.Show(SportRegistrationSystem.lblInvalidUsername); } else { if (txtPassword.Text == "" || lblPassword.Text.Length < 8) { MessageBox.Show(SportRegistrationSystem.lblInvalidPassword); } else { if (txtFullName.Text == "") { MessageBox.Show(SportRegistrationSystem.lblInvalidFullName); } else { bool registrationStatus = StaffBll.RegisterStaff(txtUsername.Text, txtPassword.Text, txtFullName.Text, (int)System.Enum.Parse(typeof (PermissionEnum), cbPermission.SelectedValue.ToString())); MessageBox.Show(registrationStatus ? SportRegistrationSystem.lblRegisterSuccess : SportRegistrationSystem.lblRegisterFailed); if (registrationStatus) { LoginForm form = new LoginForm(); form.Show(); this.Close(); } } } } }
private void btnCancel_Click(object sender, EventArgs e) { LoginForm form = new LoginForm(); form.Show(); this.Close(); }