Пример #1
0
        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));
        }
Пример #2
0
        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));
        }