Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if ((bool)old_user.IsChecked)
                {
                    if (userID.Text == "מספר זהות" || userFirstName.Text == "שם פרטי" || userLastName.Text == "שם משפחה") //missing detailes
                    {
                        throw new Exception("אנא מלא את כל הפרטים");
                    }
                    Checks.CheckID(userID.Text);

                    if (combo.SelectedIndex == 0)
                    {
                        throw new Exception("אנא סמן את בחירתך");
                    }
                    if (combo.SelectedIndex == 1)
                    {
                        tester = bl.GetTester(userID.Text);
                        if (tester.NameTester.FirstName != userFirstName.Text || tester.NameTester.LastName != userLastName.Text)
                        {
                            throw new Exception("אחד או יותר מהנתונים שהוזנו שגויים");
                        }
                        log_in_tester log_in_tester = new log_in_tester(tester);
                        log_in_tester.ShowDialog();
                    }
                    if (combo.SelectedIndex == 2)
                    {
                        trainee = bl.GetTrainee(userID.Text);
                        if (trainee.NameTrainee.FirstName != userFirstName.Text || trainee.NameTrainee.LastName != userLastName.Text)
                        {
                            throw new Exception("אחד או יותר מהנתונים שהוזנו שגויים");
                        }
                        log_in_trainee log_in_trainee = new log_in_trainee(trainee);
                        log_in_trainee.ShowDialog();
                    }
                }
                if ((bool)new_user.IsChecked)
                {
                    if (combo.SelectedIndex == 0)
                    {
                        throw new Exception("אנא סמן את בחירתך");
                    }
                    if (combo.SelectedIndex == 1)
                    {
                        sign_in_tester sign_in_tester = new sign_in_tester();
                        sign_in_tester.ShowDialog();
                    }
                    if (combo.SelectedIndex == 2)
                    {
                        sign_in_trainee sign_in_trainee = new sign_in_trainee();
                        sign_in_trainee.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "שגיאה", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 2
0
 private void next_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         tester.mat = mat1;
         bl.changeTester(tester);
         log.Close();
         Close();
         log_in_tester _log = new log_in_tester(tester);
         _log.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "שגיאה", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemplo n.º 3
0
 private void next_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (birthDateTesterDatePicker.SelectedDate == null)
         {
             throw new Exception("אנא השלם את כל הפרטים");
         }
         tester.mat = m2.mat1;
         bl.addTester(tester);
         log_in_tester log_In = new log_in_tester(tester);
         Close();
         log_In.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "שגיאה", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }