Ejemplo n.º 1
0
 public ActionResult Edit(TahDoItem tahdoitem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tahdoitem).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.TahDoListId = new SelectList(db.TahDoLists, "Id", "Title", tahdoitem.TahDoListId);
     return View(tahdoitem);
 }
Ejemplo n.º 2
0
        public ActionResult Create(TahDoItem tahdoitem)
        {
            if (ModelState.IsValid)
            {
                db.TahDoItems.Add(tahdoitem);
                db.SaveChanges();
                return RedirectToAction("Index");  
            }

            ViewBag.TahDoListId = new SelectList(db.TahDoLists, "Id", "Title", tahdoitem.TahDoListId);
            return View(tahdoitem);
        }