public IHttpActionResult PutSeverityTask(int id, SeverityTask severityTask) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != severityTask.TaskId) { return(BadRequest()); } db.Entry(severityTask).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!db.SeverityTaskExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Create([Bind(Include = "ID,Nr,Title,Description,Worked,T_L,Test_Date,My_Time,Project_Name")] tasks tasks) { if (ModelState.IsValid) { db.Tasks.Add(tasks); db.SaveChanges(); return(RedirectToAction("Index", new { tasks.Project_Name })); } return(View(tasks)); }
public int SaveChanges() { return(_context.SaveChanges()); }