Esempio n. 1
0
 public ActionResult Create(AspNetExamps.Models.OwnScaffModels.Task task)
 {
     if (ModelState.IsValid)
     {
         db.Tasks.Add(task);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Esempio n. 2
0
        public ActionResult Edit(AspNetExamps.Models.OwnScaffModels.Task task)
        {
            if (ModelState.IsValid)
            {
                db.Entry(task).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(Edit(task));
        }
Esempio n. 3
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            AspNetExamps.Models.OwnScaffModels.Task task = db.Tasks.Find(id);

            if (task == null)
            {
                return(HttpNotFound());
            }

            return(View(task));
        }