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 })); }
public ActionResult Show(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); StylistClass foundStylist = StylistClass.Find(id); List <ClientClass> stylistClients = foundStylist.GetClients(); List <SpecialtyClass> allSpecialties = SpecialtyClass.GetAll(); List <SpecialtyClass> stylistSpecialties = foundStylist.GetSpecialties(); model.Add("stylist", foundStylist); model.Add("clients", stylistClients); model.Add("specialties", allSpecialties); model.Add("stylistSpecialties", stylistSpecialties); return(View("Show", model)); }
public ActionResult Update(int stylistId, string newName, string newPhoneNumber) { StylistClass stylist = StylistClass.Find(stylistId); stylist.Edit(newName, newPhoneNumber); Dictionary <string, object> model = new Dictionary <string, object>(); List <ClientClass> stylistClients = stylist.GetClients(); List <SpecialtyClass> stylistSpecialties = stylist.GetSpecialties(); model.Add("stylist", stylist); model.Add("clients", stylistClients); model.Add("specialties", stylistSpecialties); return(RedirectToAction("Show", new{ id = stylistId })); }