示例#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);
            }
        }
示例#2
0
        public update_tester(Tester oldTester, log_in_tester log_In)
        {
            InitializeComponent();
            log         = log_In;
            tester      = oldTester;
            bl          = FactoryBL.GetBL();
            DataContext = tester;
            mat1        = tester.mat;
            string DirPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName;

            imageNotWorking.Source = new BitmapImage(new Uri(DirPath + "/images/עובד לא.jpg"));
            notWorking.ImageSource = imageNotWorking.Source;
            imageWorking.Source    = new BitmapImage(new Uri(DirPath + "/images/עובד.jpg"));
            working.ImageSource    = imageWorking.Source;
            foreach (Button item in buttons.Children)
            {
                int x = int.Parse(item.Name[1].ToString());
                int y = int.Parse(item.Name[3].ToString());
                if (mat1[x, y] == true)
                {
                    item.Background = working;
                }
                if (mat1[x, y] == false)
                {
                    item.Background = notWorking;
                }
            }
            carTypeTesterComboBox.ItemsSource = Enum.GetValues(typeof(CarType));
            genderTesterComboBox.ItemsSource  = Enum.GetValues(typeof(Gender));
        }
示例#3
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);
     }
 }
示例#4
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);
     }
 }