Ejemplo n.º 1
0
        public ActionResult AddPacientToDoctor(AddPacient model)
        {
            var pacient = db.Pacients.Find(model.pacientId);
            var doctor  = db.Doctors.Find(model.doctorId);

            doctor.pacients.Add(pacient);
            db.SaveChanges();

            return(RedirectToAction("Index", db.Pacients.ToList()));
        }
Ejemplo n.º 2
0
        public ActionResult AddPacientToDoctor(int id)
        {
            AddPacient model = new AddPacient();

            model.doctorId = id;
            model.pacients = db.Pacients.ToList();
            var doctor = db.Doctors.Find(id);

            ViewBag.doctorName = db.Doctors.Find(id).FirstName + " " + db.Doctors.Find(id).LastName;


            return(View(model));
        }