예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public int SaveChanges()
 {
     return(_context.SaveChanges());
 }