Пример #1
0
        public ActionResult Create(Task task)
        {
            if (ModelState.IsValid)
            {
                task.goalid = Convert.ToInt32(TempData["Goalid"]);
                db.Tasks.Add(task);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(task);
        }
Пример #2
0
 public ActionResult Edit(Task task)
 {
     if (ModelState.IsValid)
     {
         db.Entry(task).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(task);
 }