private void buttonTrimite_Click(object sender, EventArgs e) { if (ValidateForm()) { try { service.AddAnaliza((GrupaSange)comboBoxGrupaSange.SelectedItem, (TipRh)comboBoxRh.SelectedItem, checkBoxHIV.Checked, checkBoxHepatitaB.Checked, checkBoxHepatitaC.Checked, checkBoxSifilis.Checked, checkBoxHTLV.Checked, int.Parse(textBoxNivelALT.Text), (PungaSange)comboBoxPunga.SelectedItem, donator); comboBoxGrupaSange.SelectedItem = null; comboBoxRh.SelectedItem = null; textBoxNivelALT.Text = null; comboBoxPunga.SelectedItem = null; PopulateComboPungi(); checkBoxHIV.Checked = false; checkBoxHepatitaB.Checked = false; checkBoxHepatitaC.Checked = false; checkBoxSifilis.Checked = false; checkBoxHTLV.Checked = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Date incomplete/incorecte!"); } }
public void testAddAnalize() { // NU RULATI , nu este delete DonatorService srvDon = new DonatorService(); Donator donator = srvDon.GetDonator("Dmihai"); CentruService service = new CentruService(); PungaSange punga = service.GetPunga(1); service.AddAnaliza(BIII, Pozitiv, false, false, true, false, false, -774, punga, donator); Assert.AreEqual(srvDon.GetAllAnalizeByIdDonator("Dmihai").Where(x => x.NivelALT == -774), 1); //serivice.DeleteAnaliza(analiza) }