public ActionResult AddStylist(int specialtyId, int stylistId) { SpecialtyClass specialty = SpecialtyClass.Find(specialtyId); StylistClass stylist = StylistClass.Find(stylistId); specialty.AddStylist(stylist); return(RedirectToAction("Show", new { id = specialtyId })); }
public ActionResult Show(int id) { SpecialtyClass specialty = SpecialtyClass.Find(id); List <StylistClass> stylists = specialty.GetStylists(); List <StylistClass> allStylists = StylistClass.GetAll(); Dictionary <string, object> model = new Dictionary <string, object>(); model.Add("specialty", specialty); model.Add("stylists", stylists); model.Add("allStylists", allStylists); return(View(model)); }
public ActionResult AddSpecialty(int specialtyId, int stylistId) { //Dictionary<string, object> model = new Dictionary<string, object>(); StylistClass foundStylist = StylistClass.Find(stylistId); // List<SpecialtyClass> allSpecialties = SpecialtyClass.GetAll(); List <SpecialtyClass> stylistSpecialties = foundStylist.GetSpecialties(); SpecialtyClass specialtyStylist = SpecialtyClass.Find(specialtyId); foundStylist.AddSpecialty(specialtyStylist); // model.Add("specialtyStylist", specialtyStylist); // model.Add("stylist", foundStylist); //model.Add("specialties", stylistSpecialties); return(RedirectToAction("Show", new { id = stylistId })); }