public ActionResult Update(int id) { Speciality thisSpeciality = Speciality.Find(id); thisSpeciality.Edit(Request.Form["updatespeciality"]); return(RedirectToAction("Index")); }
public ActionResult Destroy(int id) { Speciality deleteSpeciality = Speciality.Find(id); deleteSpeciality.Delete(); return(RedirectToAction("Index")); }
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 })); }
public ActionResult Update(int specialityId, string newName) { Speciality thisSpeciality = Speciality.Find(specialityId); thisSpeciality.Edit(newName); return(RedirectToAction("Show", new { id = specialityId })); }
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 })); }
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 })); }
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")); }
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")); }
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 })); }
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")); }
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 })); }
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")); }
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 })); }
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 })); }
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)); }
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")); }
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); }
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); }
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)); }
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); }
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); }
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)); }
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)); }