private void AddTester(object sender, EventArgs e)
        {
            List <Tester> testers   = gen.GetTesters();
            bool          dupe_name = false;
            string        newName   = (fn_tb.Text + " " + ln_tb.Text).Trim();

            for (int i = 0; i < testers.Count; i++)
            {
                if (testers[i].GetTester() == newName)
                {
                    dupe_name = true;
                }
            }

            if (!dupe_name && newName.Trim() != "")
            {
                testers.Add(new Tester(newName));
                gen.SetTesters(testers);
                form1.UpdateTesters();
                Close();
            }
            else if (dupe_name)
            {
                fn_tb.Text = "";
                ln_tb.Text = "";
                MessageBox.Show("There is already a tester with this name.");
            }
            else if (newName.Trim() == "")
            {
                fn_tb.Text = "";
                ln_tb.Text = "";
                MessageBox.Show("This name is invalid");
            }
        }
示例#2
0
        private void DeleteTester(object sender, EventArgs e)
        {
            int temp = -1;

            for (int i = 0; i < testers.Count; i++)
            {
                if (testers[i].GetTester() == testers_listbox.SelectedItem.ToString())
                {
                    temp = i;
                }
            }
            if (temp != -1)
            {
                testers.Remove(testers[temp]);
            }
            testers_listbox.Items.Remove(testers_listbox.SelectedItem);
            tests_listbox.Items.Clear();
            gen.SetTesters(testers);
            deleteTester_btn.Enabled = false;
            renameTester_btn.Enabled = false;
        }
示例#3
0
 private void AddTest(object sender, EventArgs e)
 {
     for (int i = 0; i < testers.Count; i++)
     {
         if (testers[i].GetTester() == testers_combobox.SelectedItem.ToString())
         {
             testers[i].AddTestID(newtest_tb.Text);
         }
     }
     gen.SetTesters(testers);
     form1.UpdateFromExtModal();
     Close();
 }