private void refreshDataGridView()
        {
            dgvAdress.DataSource = null;
            List <Adress> adresses = null;

            if (adressService.ShowAll().Where(a => a.OwnerId == null) != null)
            {
                adresses = adressService.ShowAll().Where(a => a.OwnerId == null).ToList();
                foreach (var adress in adresses)
                {
                    adress.Vet = vetService.GetById(adress.VetId);
                }
            }
            dgvAdress.DataSource = adresses;
        }
Ejemplo n.º 2
0
        //refresh inicial (Mostra todas as consultas agendadas)
        private void refreshDataGridView()
        {
            dgvMedicalConsultation.DataSource = null;
            IList <MedicalConsultation> medicalConsultations = null;

            if (medicalConsultationService.ShowAll() != null)
            {
                medicalConsultations = medicalConsultationService.ShowAll();
                foreach (var medicalConsultation in medicalConsultations)
                {
                    medicalConsultation.Vet   = vetService.GetById(Convert.ToInt64(medicalConsultation.VetId));
                    medicalConsultation.Owner = ownerService.GetById(Convert.ToInt64(medicalConsultation.OwnerId));
                    medicalConsultation.Pet   = petService.GetById(Convert.ToInt64(medicalConsultation.PetId));
                }
            }
            dgvMedicalConsultation.DataSource = medicalConsultations;
        }
Ejemplo n.º 3
0
        private void refreshDataGridViewMedicalConsultation()
        {
            dgvConsult.DataSource = null;
            List <MedicalConsultation> medicalConsultations = null;

            if (medicalConsultationService.ShowAll().Where(mc => mc.OwnerId == Convert.ToInt64(txtId.Text)) != null)
            {
                medicalConsultations = medicalConsultationService.ShowAll().Where(mc => mc.OwnerId == Convert.ToInt64(txtId.Text)).ToList();
                foreach (var medicalConsultation in medicalConsultations)
                {
                    medicalConsultation.Vet   = vetService.GetById(Convert.ToInt64(medicalConsultation.VetId));
                    medicalConsultation.Owner = ownerService.GetById(Convert.ToInt64(medicalConsultation.OwnerId));
                    medicalConsultation.Pet   = petService.GetById(Convert.ToInt64(medicalConsultation.PetId));
                }
            }
            dgvConsult.DataSource = medicalConsultations;
        }