Exemplo n.º 1
0
        public IActionResult Details(int id)
        {
            var model    = new MedicPacientViewModel();
            var medic    = medicData.Get(id);
            var pacients = new List <Pacient>();

            foreach (var pair in medicPacientData.GetAll())
            {
                if (pair.MedicId == id)
                {
                    var pacient = pacientData.Get(pair.PacientId);
                    pacients.Add(pacient);
                }
            }
            model.Medic    = medic;
            model.Pacients = pacients;
            if (model == null)
            {
                return(View("NotFound"));
            }
            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Details(int id)
        {
            var model   = new PacientMedicMedicineViewModel();
            var pacient = pacientData.Get(id);
            var medics  = new List <Medic>();

            foreach (var pair in medicPacientData.GetAll())
            {
                if (pair.PacientId == id)
                {
                    var medic = medicData.Get(pair.MedicId);
                    medics.Add(medic);
                }
            }
            var consultatii = new List <ConsultatieViewModel>();

            foreach (var pair in consultatieData.GetAll())
            {
                if (pair.PacientId == id)
                {
                    var consultatie = new ConsultatieViewModel();
                    consultatie.Data           = pair.Data;
                    consultatie.Diagnostic     = pair.Diagnostic;
                    consultatie.DozaMedicament = pair.DozaMedicament;
                    var medicament = medicamentData.Get(pair.MedicamentId);
                    consultatie.NumeMedicament = medicament.Denumire;
                    consultatii.Add(consultatie);
                }
            }
            model.Consultatii = consultatii;
            model.Medici      = medics;
            model.Pacient     = pacient;

            if (model == null)
            {
                return(View("NotFound"));
            }
            return(View(model));
        }