예제 #1
0
 //
 // 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);
 }
예제 #2
0
        public ActionResult Create(Appointments appointments)
        {
            if (ModelState.IsValid)
            {
                appDb.Appointments.Add(appointments);
                appDb.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(appointments);
        }
예제 #3
0
 public ActionResult Edit(Appointments appointments)
 {
     if (ModelState.IsValid)
     {
         appDb.Entry(appointments).State = EntityState.Modified;
         appDb.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(appointments);
 }