// // GET: /Time/Create //public ActionResult Create() //{ // return View(); //} public ActionResult Create(int Day, int Time) { var Apps = new Appointments(); Apps.Day = Day; Apps.Time = Time; Apps.DayName = new DatePretty().Prettify(Day); return View(Apps); }
public ActionResult Create(Appointments appointments) { if (ModelState.IsValid) { appDb.Appointments.Add(appointments); appDb.SaveChanges(); return RedirectToAction("Index"); } return View(appointments); }
public ActionResult Edit(Appointments appointments) { if (ModelState.IsValid) { appDb.Entry(appointments).State = EntityState.Modified; appDb.SaveChanges(); return RedirectToAction("Index"); } return View(appointments); }