예제 #1
0
 public ActionResult Edit([Bind(Include = "id,titulo,id_status,descricao,criacao,alteracao")] task task)
 {
     if (ModelState.IsValid)
     {
         db.Entry(task).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_status = new SelectList(db.status, "id", "descricao", task.id_status);
     return(View(task));
 }
예제 #2
0
        public ActionResult CompleteTask(int taskid)
        {
            tasklistEntities ORM = new tasklistEntities();

            task TaskToComplete = ORM.tasks.Find(taskid);

            if (TaskToComplete.status == false)
            {
                TaskToComplete.status = true;
            }
            else
            {
                TaskToComplete.status = false;
            }

            ORM.Entry(TaskToComplete).State = System.Data.Entity.EntityState.Modified;

            ORM.SaveChanges();

            return(RedirectToAction("Index"));
        }