Exemplo n.º 1
0
        public ActionResult Show(int stylistId, int clientId)
        {
            ClientClass client = ClientClass.Find(clientId);
            Dictionary <string, object> model = new Dictionary <string, object>();
            StylistClass stylist = StylistClass.Find(stylistId);

            model.Add("client", client);
            model.Add("stylist", stylist);
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Destroy(int stylistId, int clientId)
        {
            ClientClass.Find(clientId).Delete();
            StylistClass                foundStylist   = StylistClass.Find(stylistId);
            List <ClientClass>          stylistClients = foundStylist.GetClients();
            Dictionary <string, object> model          = new Dictionary <string, object>();

            model.Add("stylist", foundStylist);
            model.Add("clients", stylistClients);
            return(RedirectToAction("Show", new{ id = stylistId }));
        }
Exemplo n.º 3
0
        public ActionResult Update(int stylistId, int clientId, string name, string phoneNumber)
        {
            ClientClass client = ClientClass.Find(clientId);

            client.Edit(name, phoneNumber);
            Dictionary <string, object> model = new Dictionary <string, object>();
            StylistClass stylist = StylistClass.Find(stylistId);

            model.Add("stylist", stylist);
            model.Add("client", client);
            return(View("Show", model));
        }