private void LoginMedicalStaffExecute() { try { LoginRegistrationMedicalStaff loginMedicalStaff = new LoginRegistrationMedicalStaff(); loginMedicalStaff.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void SaveExecute() { try { using (Service1Client wcf = new Service1Client()) { if (MedicalStaff.MedicalStaffID == 0) { MedicalStaff.MedicalDepartmentID = MedicalDepartments.MedicalDepartmentID; } wcf.AddMedicalStaff(MedicalStaff); int maxElement = wcf.maxMedicalStaffID(); if (Login.LoginID == 0) { Login.UserName = loginMedicalStaff.txtUserName.Text; Login.Password = loginMedicalStaff.txtPassword.Password; Login.MedicalStaffID = maxElement; //login.MedicalStaffID = 1; } wcf.AddLogin(Login); MessageBox.Show("You are successfully registered!"); loginMedicalStaff.Close(); LoginRegistrationMedicalStaff view = new LoginRegistrationMedicalStaff(); view.ShowDialog(); } } catch (Exception ex) { MessageBox.Show("Error. Repeat the entry!"); MessageBox.Show(ex.ToString()); loginMedicalStaff.txtUserName.Text = ""; loginMedicalStaff.txtPassword.Password = ""; loginMedicalStaff.txtName.Text = ""; loginMedicalStaff.txtDatePicker.Text = ""; loginMedicalStaff.txtAddress.Text = ""; loginMedicalStaff.txtPhoneNumber.Text = ""; loginMedicalStaff.cmbNameOfJob.Text = ""; loginMedicalStaff.cmbStatusOfEmployee.Text = ""; loginMedicalStaff.cmbBloodType.Text = ""; loginMedicalStaff.cmbMedicalDepartment.Text = ""; } }