예제 #1
0
 public void LoadEntriesTests()
 {
     CuredLabel.Text = _card.IsCured ? "Cured" : "Not cured";
     TestsTable.Controls.Clear();
     _tests = DbConnector.GetInstance().GetTests(_card.id);
     TestsTable.RowCount = _tests.Count;
     TestsTable.Update();
     for (int i = 0; i < _tests.Count; i++)
     {
         DateTimePicker lb1 = new DateTimePicker(); lb1.Size = new Size(120, lb1.Height);
         lb1.Text = _tests[i].DateTime; lb1.Show();
         TextBox lb2 = new TextBox(); lb2.Font = new Font("Calibri", 12);
         lb2.Size = new Size(300, lb2.Height);
         lb2.Text = _tests[i].Result; lb2.Show();
         ComboBox cb = new ComboBox(); cb.BeginUpdate(); _tt.ForEach(x => cb.Items.Add(x.Name)); cb.EndUpdate();
         cb.Text = _tests[i].Type;
         Label lb3 = new Label(); lb3.Font = new Font("Calibri", 12);
         lb3.Text = _tt.Find(x => x.Name == _tests[i].Type).Cost.ToString(); lb3.Show();
         DeleteButton b = new DeleteButton(_tests[i].id, "test");
         b.Click += b_Click;
         this.TestsTable.Controls.Add(cb, 0, i);
         this.TestsTable.Controls.Add(lb1, 1, i);
         this.TestsTable.Controls.Add(lb2, 2, i);
         this.TestsTable.Controls.Add(lb3, 3, i);
         this.TestsTable.Controls.Add(b, 4, i);
     }
 }
예제 #2
0
 public void LoadEntriesTests()
 {
     TestsTable.Controls.Clear();
     tests = DbConnector.GetInstance().GetTestTypes();
     TestsTable.RowCount = tests.Count;
     TestsTable.Update();
     for (int i = 0; i < tests.Count; i++)
     {
         TextBox      lb  = new TextBox(); lb.Font = new Font("Calibri", 12); lb.Text = tests[i].Name; lb.Show();
         TextBox      lb1 = new TextBox(); lb1.Font = new Font("Calibri", 12); lb1.Text = tests[i].Cost.ToString(); lb1.Show();
         DeleteButton b1  = new DeleteButton(tests[i].id, "testtype");
         b1.Click += b1_Click;
         this.TestsTable.Controls.Add(lb, 0, i);
         this.TestsTable.Controls.Add(lb1, 1, i);
         this.TestsTable.Controls.Add(b1, 2, i);
     }
 }