public ActionResult DeleteConfirmed(int id)
        {
            Daily_Diet daily_Diet = db.Daily_Diet.Find(id);

            db.Daily_Diet.Remove(daily_Diet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Content,Link,DDId")] Daily_Diet daily_Diet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(daily_Diet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DDId = new SelectList(db.Diet_DayPerWeek, "Id", "Id", daily_Diet.DDId);
     return(View(daily_Diet));
 }
        public ActionResult Create([Bind(Include = "Id,Name,Content,Link,DDId")] Daily_Diet daily_Diet)
        {
            if (ModelState.IsValid)
            {
                db.Daily_Diet.Add(daily_Diet);
                db.SaveChanges();
                return(View("Create"));
            }

            ViewBag.DDId = new SelectList(db.Diet_DayPerWeek, "Id", "Id", daily_Diet.DDId);
            return(View(daily_Diet));
        }
        // GET: Daily_Diet/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Daily_Diet daily_Diet = db.Daily_Diet.Find(id);

            if (daily_Diet == null)
            {
                return(HttpNotFound());
            }
            return(View(daily_Diet));
        }
        // GET: Daily_Diet/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Daily_Diet daily_Diet = db.Daily_Diet.Find(id);

            if (daily_Diet == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DDId = new SelectList(db.Diet_DayPerWeek, "Id", "Id", daily_Diet.DDId);
            return(View(daily_Diet));
        }