Пример #1
0
        //
        // GET: /TahDoItem/Edit/5

        public ActionResult Edit(int id)
        {
            TahDoItem tahdoitem = db.TahDoItems.Find(id);

            ViewBag.TahDoListId = new SelectList(db.TahDoLists, "Id", "Title", tahdoitem.TahDoListId);
            return(View(tahdoitem));
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            TahDoItem tahdoitem = db.TahDoItems.Find(id);

            db.TahDoItems.Remove(tahdoitem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
        // GET: TahDoItems/Delete/5
        public ActionResult Delete(int id)
        {
            TahDoItem tahDoItem = db.TahDoItems.Find(id);

            if (tahDoItem == null)
            {
                return(HttpNotFound());
            }
            return(View(tahDoItem));
        }
Пример #4
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));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "Id,Title,CreatedAt,Priority,Note,TahDoListId,Done,DoneAt")] 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));
 }
Пример #6
0
        // GET: TahDoItems/Edit/5
        public ActionResult Edit(int id)
        {
            TahDoItem tahDoItem = db.TahDoItems.Find(id);

            if (tahDoItem == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TahDoListId = new SelectList(db.TahDoLists, "Id", "Title", tahDoItem.TahDoListId);
            return(View(tahDoItem));
        }
Пример #7
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));
        }
Пример #8
0
        //
        // GET: /TahDoItem/Delete/5

        public ActionResult Delete(int id)
        {
            TahDoItem tahdoitem = db.TahDoItems.Find(id);

            return(View(tahdoitem));
        }
Пример #9
0
        //
        // GET: /TahDoItem/Details/5

        public ViewResult Details(int id)
        {
            TahDoItem tahdoitem = db.TahDoItems.Find(id);

            return(View(tahdoitem));
        }