private void LoginPatientsExecute()
 {
     try
     {
         LoginRegistrationPatients loginRegistrationPatient = new LoginRegistrationPatients();
         loginRegistrationPatient.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
예제 #2
0
 private void SaveExecute()
 {
     try
     {
         using (Service1Client wcf = new Service1Client())
         {
             wcf.AddPatient(Patients);
             int maxElement = wcf.maxPatientID();
             if (Login.LoginID == 0)
             {
                 Login.UserName  = loginPatients.txtUserName.Text;
                 Login.Password  = loginPatients.txtPassword.Password;
                 Login.PatientID = maxElement;
                 //login.MedicalStaffID = 1;
             }
             wcf.AddLogin(Login);
             MessageBox.Show("You are successfully registered!");
             loginPatients.Close();
             LoginRegistrationPatients view = new LoginRegistrationPatients();
             view.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error. Repeat the entry!");
         MessageBox.Show(ex.ToString());
         loginPatients.txtUserName.Text     = "";
         loginPatients.txtPassword.Password = "";
         loginPatients.txtAddress.Text      = "";
         loginPatients.cmbBloodType.Text    = "";
         loginPatients.txtIDCard.Text       = "";
         loginPatients.txtName.Text         = "";
         loginPatients.txtPhoneContact.Text = "";
         loginPatients.txtPhoneHome.Text    = "";
         loginPatients.txtPhoneMobile.Text  = "";
     }
 }