예제 #1
0
        public IHttpActionResult PutT_JobLog(int id, T_JobLog T_JobLog)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != T_JobLog.Id)
            {
                return(BadRequest());
            }

            db.Entry(T_JobLog).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!T_JobLogExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
        public IHttpActionResult GetT_JobLog(int id)
        {
            T_JobLog T_JobLog = db.T_JobLog.Find(id);

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

            return(Ok(T_JobLog));
        }
예제 #3
0
        public IHttpActionResult PostT_JobLog(T_JobLog T_JobLog)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.T_JobLog.Add(T_JobLog);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = T_JobLog.Id }, T_JobLog));
        }
예제 #4
0
        public IHttpActionResult DeleteT_JobLog(int id)
        {
            T_JobLog T_JobLog = db.T_JobLog.Find(id);

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

            db.T_JobLog.Remove(T_JobLog);
            db.SaveChanges();

            return(Ok(T_JobLog));
        }