예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DayPerWeek dayPerWeek = db.DayPerWeeks.Find(id);

            db.DayPerWeeks.Remove(dayPerWeek);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Day")] DayPerWeek dayPerWeek)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dayPerWeek).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dayPerWeek));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Day")] DayPerWeek dayPerWeek)
        {
            if (ModelState.IsValid)
            {
                db.DayPerWeeks.Add(dayPerWeek);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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