public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,PhoneNumber,Date,StylistId,TimeRequest,ConfirmAppointment,DenyAppointment,ReminderText")] Appointment appointment) { if (ModelState.IsValid) { db.Entry(appointment).State = EntityState.Modified; db.SaveChanges(); TextAPIsController textAPIsController = new TextAPIsController(); textAPIsController.SendText(appointment); return(RedirectToAction("Index")); } return(View(appointment)); }
public ActionResult Create([Bind(Include = "Id,FirstName,LastName,Phone,Date,StylistId,ServiceId,TimeRequest,Accept_Terms")] Appointment appointment) { if (ModelState.IsValid) { var stylists = db.Stylists.ToList(); var services = db.Services.ToList(); db.Appointments.Add(appointment); db.SaveChanges(); TextAPIsController textAPIsController = new TextAPIsController(); textAPIsController.SendText(appointment); return(RedirectToAction("ThankYou")); } return(View(appointment)); }