예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            FootballSchedule footballSchedule = db.FootballSchedules.Find(id);

            db.FootballSchedules.Remove(footballSchedule);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Season,Opponent,Date,IsHomeGame")] FootballSchedule footballSchedule)
 {
     if (ModelState.IsValid)
     {
         db.Entry(footballSchedule).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(footballSchedule));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Season,Opponent,Date,IsHomeGame")] FootballSchedule footballSchedule)
        {
            if (ModelState.IsValid)
            {
                db.FootballSchedules.Add(footballSchedule);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(footballSchedule));
        }
예제 #4
0
        // GET: Schedule/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FootballSchedule footballSchedule = db.FootballSchedules.Find(id);

            if (footballSchedule == null)
            {
                return(HttpNotFound());
            }
            return(View(footballSchedule));
        }