コード例 #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);
 }