예제 #1
0
 private void SignInHuman()
 {
     if (isUser == false)
     {
         try
         {
             Administrator administrator = new Administrator()
             {
                 Pesel          = int.Parse(textBoxPesel.Text),
                 Login          = textBoxLogin.Text,
                 Password       = textBoxPassword.Text,
                 DrivingLicense = int.Parse(textBoxDrivingLicense.Text),
                 Name           = textBoxName.Text,
                 Surname        = textBoxSurname.Text,
                 Adress         = textBoxAdress.Text,
                 Email          = textBoxEmail.Text,
                 PhoneNumber    = int.Parse(textBoxPhoneNumber.Text)
             };
             _writeRepositoryAdministrator.Create(administrator);
             MessageBox.Show("Dodano");
             startWindow = new StartWindow();
             startWindow.Show();
             this.Hide();
         }
         catch (Exception)
         {
             MessageBox.Show("Nieprawidłowo wpisane dane");
         }
         ClearTextBoxes();
     }
     else
     {
         try
         {
             User user = new User()
             {
                 Pesel          = int.Parse(textBoxPesel.Text),
                 Login          = textBoxLogin.Text,
                 Password       = textBoxPassword.Text,
                 DrivingLicense = int.Parse(textBoxDrivingLicense.Text),
                 Name           = textBoxName.Text,
                 Surname        = textBoxSurname.Text,
                 Adress         = textBoxAdress.Text,
                 Email          = textBoxEmail.Text,
                 PhoneNumber    = int.Parse(textBoxPhoneNumber.Text)
             };
             _writeRepositoryUser.Create(user);
             MessageBox.Show("Dodano");
             startWindow = new StartWindow();
             startWindow.Show();
             this.Hide();
         }
         catch (Exception)
         {
             MessageBox.Show("Nieprawidłowo wpisane Dane");
         }
         ClearTextBoxes();
     }
 }
예제 #2
0
        private void buttonPrevious_Click(object sender, EventArgs e)
        {
            if (returnToStartWindow == true)
            {
                startWindow = new StartWindow();
                startWindow.Show();
            }
            else
            {
                administratorPanel = new AdministratorPanel();
                administratorPanel.Show();
            }

            this.Visible = false;
        }
예제 #3
0
 private void buttonPrevious_Click(object sender, EventArgs e)
 {
     startWindow = new StartWindow();
     startWindow.Show();
     this.Visible = false;
 }