Exemplo n.º 1
0
        private void BtnOKTestCode_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Convert.ToInt32(txtTestCode.Text) < 10000000)
                {
                    throw new Exception("Non-valid test code. Please enter a valid test code.");
                }

                var found = bl.findById(Convert.ToInt32(txtTestCode.Text));

                if (action == "update")
                {
                    string content = "Update";
                    test   myTest  = new test(content, Convert.ToInt32(txtTestCode.Text));
                    this.Close();
                    myTest.Show();
                }
                else
                {
                    string content = "View";
                    tester myTest  = new tester(content, Convert.ToInt32(txtTestCode.Text));
                    this.Close();
                    myTest.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                txtTestCode.Text         = "";
                txtTestCode.Visibility   = System.Windows.Visibility.Hidden;
                labelTestCode.Visibility = System.Windows.Visibility.Hidden;
                btnOKTestCode.Visibility = System.Windows.Visibility.Hidden;
            }
        }
Exemplo n.º 2
0
        private void btnAddTester_Click(object sender, RoutedEventArgs e)
        {
            string content  = "Add";
            tester mytester = new tester(content);

            this.Close();
            mytester.Show();
        }
Exemplo n.º 3
0
        private void dataGridTesters_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dataGridTesters.SelectedItems == null)
            {
                return;
            }
            var    selectedTesters = dataGridTesters.SelectedItem as Tester;
            tester myTester        = new tester("View", selectedTesters.ID);

            this.Close();
            myTester.Show();
        }
Exemplo n.º 4
0
        private void tester(object sender, RoutedEventArgs e)
        {
            Window gotester = new tester();

            gotester.Show();
        }