Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            day_of_week day_of_week = db.day_of_week.Find(id);

            db.day_of_week.Remove(day_of_week);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "DayCode,DayShortName,DayLongName")] day_of_week day_of_week)
 {
     if (ModelState.IsValid)
     {
         db.Entry(day_of_week).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(day_of_week));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "DayCode,DayShortName,DayLongName")] day_of_week day_of_week)
        {
            if (ModelState.IsValid)
            {
                db.day_of_week.Add(day_of_week);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(day_of_week));
        }
Пример #4
0
        // GET: day_of_week/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            day_of_week day_of_week = db.day_of_week.Find(id);

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