Beispiel #1
0
        public IHttpActionResult PutTaskHistory(int task_id, tblTaskHistory taskHistory)
        {
            if (task_id != taskHistory.TASK_ID)
            {
                return(BadRequest());
            }
            db.Entry(taskHistory).State = EntityState.Modified;
            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TaskHistoryExists(task_id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult DeleteTask(int id)
        {
            tblTaskHistory objTaskHistory = db.tblTaskHistories.Find(id);

            if (objTaskHistory == null)
            {
                return(NotFound());
            }

            db.tblTaskHistories.Remove(objTaskHistory);
            db.SaveChanges();

            return(Ok(objTaskHistory));
        }
Beispiel #3
0
        public IHttpActionResult PostTaskHistory(tblTaskHistory taskHistory)
        {
            tblTaskHistory objTaskHistory = new tblTaskHistory();

            objTaskHistory.TASK_COMMENTS = taskHistory.TASK_COMMENTS;
            objTaskHistory.TASK_ID       = taskHistory.TASK_ID;
            objTaskHistory.CREATEDBY     = taskHistory.CREATEDBY;
            objTaskHistory.CREATEDON     = System.DateTime.Now;
            objTaskHistory.UPDATEDBY     = taskHistory.UPDATEDBY;
            objTaskHistory.UPDATEDON     = System.DateTime.Now;
            objTaskHistory.STATUS        = taskHistory.STATUS;


            db.tblTaskHistories.Add(objTaskHistory);
            db.SaveChanges();
            return(CreatedAtRoute("DefaultApi", new { id = taskHistory.ID }, taskHistory));
        }