Beispiel #1
0
        public void TestVizualizarePacienti()
        {
            int count = medicService.GetPacientByMedic(1).Count;

            if (count == 0)
            {
                medicService.AdaugaPacient(1, "test", "test", "test", true);
                Assert.AreEqual(count + 1, medicService.GetPacientByMedic(1).Count);
                medicService.DeletePacient("test");
            }
            else
            {
                Assert.IsTrue(medicService.GetPacientByMedic(1).Count > 0);
            }
        }
Beispiel #2
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            //adaugarePACIENT
            try
            {
                #region Date Pacient
                string Nume    = txtNume.Text;
                string Prenume = txtPrenume.Text;
                string Email   = txtEmail.Text;
                int    idMedic = idMedicCurent;
                bool   esteDonator;

                if (checkDonator.Checked == true)
                {
                    esteDonator = true;
                }
                else
                {
                    esteDonator = false;
                }

                if (Nume.Equals("") || Prenume.Equals("") || Email.Equals(""))
                {
                    throw new ValidationException();
                }

                #endregion

                serviceMedic.AdaugaPacient(idMedic, Nume, Prenume, Email, esteDonator);
                loadDataGridView1();
                initPacienti();

                #region ClearFieldsAddPacient
                txtNume.Text         = "";
                txtPrenume.Text      = "";
                txtEmail.Text        = "";
                checkDonator.Checked = false;
                #endregion
            }
            catch (Exception error)
            {
                MessageBox.Show("Date invalide! Pacientul nu poate fi adaugat!\n" + error.Message);
            }
        }