public ActionResult Create(string doctorName, int specialtyId)
        {
            Doctor newDoctor = new Doctor(doctorName);

            newDoctor.Save();
            newDoctor.AddToJoinTable(specialtyId);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult CreateDoctorInSpecialty(string doctorName, int specialtyId)
        {
            Doctor newDoctor = new Doctor(doctorName);

            newDoctor.Save();
            newDoctor.AddToJoinTable(specialtyId);
            Dictionary <string, object> model = new Dictionary <string, object>();
            Specialty     selectedSpecialty   = Specialty.Find(specialtyId);
            List <Doctor> specialtyDoctors    = Specialty.GetDoctors(specialtyId);

            model.Add("specialty", selectedSpecialty);
            model.Add("specialtyDoctors", specialtyDoctors);
            return(View("Show", model));
        }