private void button3_Click(object sender, EventArgs e) { FindControls(this, controls, ControlIdentifier); if (!FieldValidator.HasEmptyFields(controls.ToArray())) { if (PasswordBox.Text.Equals(ConfirmPasswordBox.Text)) { RegisterDoctorModel doctorModel = CreateModel(); doctorService.Save(doctorModel); MessageBox.Show("Successfully created medical staff profile"); this.Hide(); AdminHomeForm adminHome = new AdminHomeForm(); adminHome.ShowDialog(); this.Close(); } else { MessageBox.Show("Password and Confirm Pasword mismatch"); } } else { MessageBox.Show("Fill in all fileds"); } }
private void button6_Click(object sender, EventArgs e) { this.username = UsernameBox_Required.Text; this.password = PasswordBox_Required.Text; FindControls(this, controls, ControlIdentifier); if (!FieldValidator.HasEmptyFields(controls.ToArray())) { LoginModel loginModel = CreateLoginModel(username, password); UserModel userModel = userService.Login(loginModel); if (userModel != null) { Form userForm = this.GetFormByRole(userModel); if (userForm != null) { this.Hide(); userForm.ShowDialog(); this.Close(); } } else { MessageBox.Show("Incorrect username or password"); } } else { MessageBox.Show("Fill in all fileds"); } }
private void button3_Click(object sender, EventArgs e) { FindControls(this, controls, ControlIdentifier); if (!FieldValidator.HasEmptyFields(controls.ToArray())) { RegisterMedicalExaminationModel medicalExaminationModel = CreateModel(); medicalServiceSevice.Save(medicalExaminationModel, MedicalServiceType); MessageBox.Show("Successfully recorded medical examination"); this.Close(); } else { MessageBox.Show("Fill in all fileds"); } }
private void button7_Click(object sender, EventArgs e) { FindControls(this, controls, ControlIdentifier); if (!FieldValidator.HasEmptyFields(controls.ToArray())) { RequestMedicalExaminationModel requestExaminationModel = CreateModel(); this.examinationRequestService.Save(requestExaminationModel); MessageBox.Show("Successfully requested medical examination"); this.Close(); } else { MessageBox.Show("Fill in all fileds"); } }