예제 #1
0
        public ActionResult Update(int id)
        {
            Speciality thisSpeciality = Speciality.Find(id);

            thisSpeciality.Edit(Request.Form["updatespeciality"]);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Destroy(int id)
        {
            Speciality deleteSpeciality = Speciality.Find(id);

            deleteSpeciality.Delete();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public ActionResult Delete(int id)
        {
            Speciality thisSpeciality = Speciality.Find(id);

            thisSpeciality.Delete();
            return(RedirectToAction("Index"));
        }
        public ActionResult EditDetails(int id, string specialityName)
        {
            Speciality editSpeciality = Speciality.Find(id);

            editSpeciality.Edit(specialityName);
            return(RedirectToAction("Index", "Home", new { activeId = 3 }));
        }
예제 #5
0
        public ActionResult Update(int specialityId, string newName)
        {
            Speciality thisSpeciality = Speciality.Find(specialityId);

            thisSpeciality.Edit(newName);
            return(RedirectToAction("Show", new { id = specialityId }));
        }
예제 #6
0
        public ActionResult AddStylist(int SpecialityId)
        {
            Speciality Speciality = Speciality.Find(SpecialityId);
            Stylist    stylist    = Stylist.Find(int.Parse(Request.Form["stylistid"]));

            Speciality.AddStylist(stylist);
            return(RedirectToAction("Detail", new { id = SpecialityId }));
        }
예제 #7
0
        public ActionResult AddDoctor(int specialityId, int doctorId)
        {
            Speciality speciality = Speciality.Find(specialityId);
            Doctor     doctor     = Doctor.Find(doctorId);

            speciality.AddDoctor(doctor);
            return(RedirectToAction("Show", new { id = specialityId }));
        }
예제 #8
0
        public ActionResult AddSpecialty(int id)
        {
            Stylist    stylist   = Stylist.Find(id);
            Speciality specialty = Speciality.Find(int.Parse(Request.Form["special-id"]));

            stylist.AddSpecialty(specialty);
            return(RedirectToAction("Index"));
        }
예제 #9
0
        public ActionResult AddSpecialities(int stylistId)
        {
            Stylist    stylist      = Stylist.Find(stylistId);
            Speciality specialities = Speciality.Find(Int32.Parse(Request.Form["speciality-id"]));

            stylist.AddSpecialities(specialities);
            return(RedirectToAction("Index"));
        }
예제 #10
0
        public ActionResult AddSpeciality(int StylistId)
        {
            Stylist    Stylist    = Stylist.Find(StylistId);
            Speciality speciality = Speciality.Find(int.Parse(Request.Form["specialityid"]));

            Stylist.AddSpeciality(speciality);
            return(RedirectToAction("Details", new { id = StylistId }));
        }
예제 #11
0
        public ActionResult Edit(int specialityId)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Speciality speciality             = Speciality.Find(specialityId);

            model.Add("speciality", speciality);
            return(View(model));
        }
        public ActionResult AddStylists(int specialityId)
        {
            Speciality speciality = Speciality.Find(specialityId);
            Stylist    stylists   = Stylist.Find(Int32.Parse(Request.Form["stylist-id"]));

            speciality.AddStylists(stylists);
            return(RedirectToAction("Index"));
        }
예제 #13
0
        public ActionResult AddStylist(int specialityId, int stylistId)
        {
            Speciality speciality = Speciality.Find(specialityId);
            Stylist    stylist    = Stylist.Find(stylistId);

            speciality.AddStylist(stylist);
            return(RedirectToAction("Show", new { id = specialityId }));
        }
예제 #14
0
        public void Find_ReturnsSpecialityInDatabase_Speciality()
        {
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();
            Speciality foundSpeciality = Speciality.Find(testSpeciality.GetId());

            Assert.AreEqual(testSpeciality, foundSpeciality);
        }
        public ActionResult Show(int id)

        {
            Speciality newSpeciality = Speciality.Find(id);

            ViewBag.Stylists   = Stylist.GetAll();
            ViewBag.Speciality = Speciality.Find(id);
            ViewBag.Stylists1  = newSpeciality.GetStylists();
            return(View());
        }
        public ActionResult AddStylist(int id, int stylistId)
        {
            Speciality newSpeciality = Speciality.Find(id);

            newSpeciality.AddStylist(Stylist.Find(stylistId));
            ViewBag.Stylists   = Stylist.GetAll();
            ViewBag.Speciality = Speciality.Find(id);
            ViewBag.Stylists1  = newSpeciality.GetStylists();

            return(View("Show"));
        }
예제 #17
0
        public ActionResult AddDoctor(int specialityId, int doctorId)
        {
            Speciality speciality = Speciality.Find(specialityId);
            // Console.WriteLine(specialityId);
            Doctor doctor = Doctor.Find(doctorId);

            // Console.WriteLine(doctorId);
            speciality.AddDoctor(doctor);
            // Console.WriteLine("added doc");
            return(RedirectToAction("Show", new { id = specialityId }));
        }
예제 #18
0
        public ActionResult AddSpecialityFromDetails(int stylistId, int specialityId)
        {
            Stylist    foundStylist    = Stylist.Find(stylistId);
            Speciality foundSpeciality = Speciality.Find(specialityId);

            if (!foundSpeciality.CheckIfExists(foundStylist.GetId()))
            {
                foundStylist.AddSpeciality(foundSpeciality);
            }
            return(RedirectToAction("Details", new { id = stylistId }));
        }
예제 #19
0
        public ActionResult Show(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>(); // pa - sp do - do
            Speciality    selectedSpeciality  = Speciality.Find(id);
            List <Doctor> specialityDoctors   = selectedSpeciality.GetDoctors();
            List <Doctor> allDoctors          = Doctor.GetAll();

            model.Add("selectedSpeciality", selectedSpeciality);
            model.Add("specialityDoctors", specialityDoctors);
            model.Add("allDoctors", allDoctors);
            return(View(model));
        }
예제 #20
0
        public ActionResult Destroy(int id)
        {
            Speciality    deleteSpeciality = Speciality.Find(id);
            List <Doctor> deleteDoctors    = deleteSpeciality.GetDoctors();

            foreach (Doctor doctor in deleteDoctors)
            {
                doctor.Delete();
            }
            deleteSpeciality.Delete();
            return(RedirectToAction("Index"));
        }
예제 #21
0
        public void Find_Save_GetID_Speciality()
        {
            //Arrange
            Speciality testSpeciality = new Speciality("test1");

            testSpeciality.Save();
            //Act
            Speciality foundSpeciality = Speciality.Find(testSpeciality.GetId());


            Assert.AreEqual(testSpeciality, foundSpeciality);
        }
예제 #22
0
        public void Edit_UpdatesSpecialityNameInDatabase_String()
        {
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();
            string secondName = "Color";

            testSpeciality.Edit(secondName);
            string result = Speciality.Find(testSpeciality.GetId()).GetName();

            Assert.AreEqual(secondName, result);
        }
예제 #23
0
        public ActionResult Show(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Speciality     selectedSpeciality = Speciality.Find(id);
            List <Stylist> specialityStylists = selectedSpeciality.GetStylists();
            List <Stylist> allStylists        = Stylist.GetAll();

            model.Add("selectedSpeciality", selectedSpeciality);
            model.Add("specialityStylists", specialityStylists);
            model.Add("allStylists", allStylists);
            return(View(model));
        }
예제 #24
0
        public ActionResult Why(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object> {
            };
            Speciality     thisSpecialty      = Speciality.Find(id);
            List <Stylist> allStylists        = thisSpecialty.GetStylist();

            model.Add("stylists", allStylists);
            model.Add("thisSpecialty", thisSpecialty);
            model.Add("specialtyId", id);
            return(View(model));;
        }
        public ActionResult AddSpeciality(int id, int specialityId)
        {
            Stylist newStylist = Stylist.Find(id);

            newStylist.AddSpeciality(Speciality.Find(specialityId));
            ViewBag.Clients       = Client.GetAll();
            ViewBag.Specialities  = Speciality.GetAll();
            ViewBag.Stylist       = Stylist.Find(id);
            ViewBag.Clients1      = newStylist.GetClients();
            ViewBag.Specialities1 = newStylist.GetSpecialities();

            return(View("Show"));
        }
        public void Find_Test()
        {
            //Arrange
            Speciality newSpeciality = new Speciality("layer cut");

            newSpeciality.Save();

            //Act
            Speciality result = Speciality.Find(newSpeciality.GetSpecialityId());

            //Assert
            Assert.AreEqual(newSpeciality, result);
        }
예제 #27
0
        public void Find_FindSpeciality_FoundSpeciality()
        {
            //Arrange
            Speciality speciality1 = new Speciality("Cut");

            speciality1.Save();

            //Act
            Speciality foundSpeciality = Speciality.Find(speciality1.GetId()); //why just 0 doens't work?

            //Assert
            Assert.AreEqual(speciality1, foundSpeciality);
        }
예제 #28
0
        public ActionResult StylistList(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Stylist           selectedStylist = Stylist.Find(id);
            List <Client>     selectedClients = Client.GetClientId(id);
            List <Client>     allClients      = Client.GetAll();
            List <Speciality> getSpeciality   = Speciality.Find(id);

            model.Add("getSpeciality", getSpeciality);
            model.Add("selectedClients", selectedClients);
            model.Add("allClients", allClients);
            return(View(model));
        }
예제 #29
0
        public ActionResult SpecialityDetail(int id)
        {
            Speciality findSpeciality = new Speciality();

            findSpeciality.SetId(id);
            List <Stylist> allStylistsWithSpeciality = new List <Stylist> {
            };

            allStylistsWithSpeciality = Speciality.StylistsWithSpeciality(findSpeciality);
            ViewBag.Speciality        = Speciality.Find(id);
            ViewBag.AllStylists       = allStylistsWithSpeciality;
            return(View());
        }
        public ActionResult Details(int id)
        {
            List <Stylist> allStylists        = Stylist.GetAll();
            Speciality     foundSpeciality    = Speciality.Find(id);
            List <Stylist> currentStylists    = foundSpeciality.GetStylists();
            Dictionary <string, object> model = new Dictionary <string, object>()
            {
            };

            model.Add("speciality", foundSpeciality);
            model.Add("stylistList", allStylists);
            model.Add("currentList", currentStylists);
            return(View(model));
        }