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