Exemplo n.º 1
0
        private void UpdateDoctorList()
        {
            listViewAdminD.Items.Clear();

            for (int i = 0; i < _doctorRepository.Count(); i++)
            {
                Doctor doctor = _doctorRepository.GetDoctorFromList(i);

                ListViewItem listViewItem = new ListViewItem(doctor.ID.ToString());
                listViewItem.SubItems.Add(doctor.Name);

                listViewAdminD.Items.Add(listViewItem);
            }
        }
Exemplo n.º 2
0
        public bool CheckDoctorLogin(string username, int pass)
        {
            bool exists = false;

            for (int i = 0; i < _doctorRepository.Count(); i++)
            {
                Doctor doctor = _doctorRepository.GetDoctorFromList(i);

                if (doctor.Username == username && doctor.Password == pass)
                {
                    doctorLoged = doctor;
                    exists      = true;
                }
            }

            return(exists);
        }
Exemplo n.º 3
0
        private void FormNurseWindow_Load(object sender, EventArgs e)
        {
            if (!_nurse.MainNurse)
            {
                tabControl1.TabPages.Remove(tabPageNPacAdd);
                tabControl1.TabPages.Remove(tabPageNPacRemove);
            }

            UpdatePacientsList();

            Doctor doctor = new Doctor();

            for (int i = 0; i < _doctorRepository.Count(); i++)
            {
                doctor = _doctorRepository.GetDoctorFromList(i);
                comboBoxMNDoctor.Items.Add(doctor.Name);
            }

            buttonNViewDiagnosis.Enabled = false;
            buttonMNPRRemove.Enabled     = false;
        }
Exemplo n.º 4
0
        public void CountTest()
        {
            int count;

            using (var context = new DataContext())
            {
                BaseRepository <Doctor> doctors = new DoctorRepository(context);
                var doc = new Doctor("Ivan", "Ivanov", "Surgeon");
                doctors.Add(doc);
                doctors.Save();

                count = doctors.Count(d => d.Name == "Ivan");
            }

            Assert.AreEqual(1, count);
        }
Exemplo n.º 5
0
 public void LoadData()
 {
     view.bindingList = repository.GetAllDoctors(view.pageNumber, view.itemsPerPage, view.search, view.sortBy,
                                                 view.ascending);
     view.totalItems = repository.Count();
 }