public ActionResult Update(int id, string tutorFirstName, string tutorLastName, string tutorEmail, string tutorPhoneNumber, int tutorExperience, bool tutorCredential, string tutorAvailability, double tutorRate) { Tutor currentTutor = Tutor.Find(id); currentTutor.Update(tutorFirstName, tutorLastName, tutorEmail, tutorPhoneNumber, tutorExperience, tutorCredential, tutorAvailability, tutorRate, id); return(RedirectToAction("Details", new { id = currentTutor.Id })); }
public ActionResult DeleteSpecialty(int tutorId, int specialtyId) { Tutor currentTutor = Tutor.Find(tutorId); Specialty currentSpecialty = Specialty.Find(specialtyId); currentTutor.DeleteSpecialty(currentSpecialty); return(RedirectToAction("Specialties", new { id = currentTutor.Id })); }
public ActionResult AddClient(int id, int tutorClient) { Tutor currentTutor = Tutor.Find(id); Client newClient = Client.Find(tutorClient); currentTutor.AddClient(newClient); return(RedirectToAction("Clients")); }
public ActionResult AddSpecialty(int id, int tutorSpecialty) { Tutor currentTutor = Tutor.Find(id); Specialty newSpecialty = Specialty.Find(tutorSpecialty); currentTutor.AddSpecialty(newSpecialty); return(RedirectToAction("Specialties")); }
public ActionResult DeleteClient(int tutorId, int clientId) { Tutor currentTutor = Tutor.Find(tutorId); Client currentClient = Client.Find(clientId); currentTutor.DeleteClient(currentClient); return(RedirectToAction("Clients", new { id = currentTutor.Id })); }
public ActionResult AddTutor(int id, int clientTutor) { Client currentClient = Client.Find(id); Tutor newTutor = Tutor.Find(clientTutor); currentClient.AddTutor(newTutor); return(RedirectToAction("Tutors")); }
public void Find_FindsTutorInDb_Tutor() { Tutor newTutor = new Tutor("Sean", "Miller", "*****@*****.**", "1234567890", 1, true, "Weekends", 25.00); newTutor.Save(); Tutor foundTutor = Tutor.Find(newTutor.Id); Assert.AreEqual(newTutor, foundTutor); }
public void Update_UpdateTutorFromDb_String() { Tutor newTutor = new Tutor("Sean", "Miller", "*****@*****.**", "1234567890", 1, true, "Weekends", 25.00); newTutor.Save(); newTutor.Update("Bill", "Miller", "*****@*****.**", "1234567890", 1, true, "Weekends", 25.00, newTutor.Id); string actualFirstName = Tutor.Find(newTutor.Id).FirstName; Assert.AreEqual("Bill", actualFirstName); }
public void GetTutorAndClient_GetsAssociatedTutorAndClientFromDb_TutorAndClient() { Tutor newTutor = new Tutor("Sean", "Miller", "*****@*****.**", "1234567890", 1, true, "Weekends", 25.00); newTutor.Save(); Client newClient = new Client("Ashley", "Adelman", "*****@*****.**", "1234567890", "123 ABC Street", "Xyz", "ZZ", "12345", 13); newClient.Save(); DateTime time = new DateTime(1111, 11, 11); Appointment newAppointment = new Appointment(newTutor.Id, newClient.Id, time, "123 ABC Street", "Xyz", "ZZ", "12345"); newAppointment.Save(); Tutor actualTutor = Tutor.Find(newAppointment.TutorId); Client actualClient = Client.Find(newAppointment.ClientId); Assert.AreEqual(newTutor, actualTutor); Assert.AreEqual(newClient, actualClient); }
public void FindTutor(int id) { CurrentTutor = Tutor.Find(id); }
public ActionResult UpdateForm(int id) { Tutor currentTutor = Tutor.Find(id); return(View(currentTutor)); }
public ActionResult DeleteTutorConfirmation(int id) { Tutor currentTutor = Tutor.Find(id); return(View(currentTutor)); }