Exemplo n.º 1
0
        }//when pressing x open the main window

        private void submitButtonClick(object sender, RoutedEventArgs e)
        {
            if (testIdComboBox.SelectedItem != null)
            {
                Test             test   = bl.getAllTests().Where(x => x.TestNumber == testIdComboBox.SelectedItem.ToString()).FirstOrDefault();
                testUpdateWindow testUp = new testUpdateWindow(test);
                testUp.ShowDialog();
            }
        }//update test grading on pervious tests
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     foreach (var item in bl.getAllTests())
     {
         if (item.TraineeId == trainee.id)
         {
             testUpdateWindow newtest = new testUpdateWindow(item);
             newtest.IsEnabled = false;
             newtest.ShowDialog();
             break;
         }
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int id;

            if (int.TryParse(testIdBox.Text, out id))
            {
                Test             test   = bl.getAllTests().Where(x => x.TestNumber == id.ToString("00000000")).First();
                testUpdateWindow testUp = new testUpdateWindow(test);
                testUp.ShowDialog();
            }
            else
            {
                MessageBox.Show("must enter a number in id field!", "Error!");
            }
        }
Exemplo n.º 4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            bool found = false;

            foreach (var item in bl.getAllTests())
            {
                if (item.TraineeId == trainee.id)
                {
                    found = true;
                    testUpdateWindow testInfo = new testUpdateWindow(item);
                    testInfo.IsEnabled = false;
                    testInfo.ShowDialog();
                    break;
                }
            }
            if (!found)
            {
                MessageBox.Show("no test exist to this trainee");
            }
        }