public IHttpActionResult Posttbl_parent_task(tbl_parent_task tbl_parent_task)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tbl_parent_task.Add(tbl_parent_task);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (tbl_parent_taskExists(tbl_parent_task.parent_id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tbl_parent_task.parent_id }, tbl_parent_task));
        }
        public IHttpActionResult Puttbl_parent_task(int id, tbl_parent_task tbl_parent_task)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbl_parent_task.parent_id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult Gettbl_parent_task(int id)
        {
            tbl_parent_task tbl_parent_task = db.tbl_parent_task.Find(id);

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

            return(Ok(tbl_parent_task));
        }
        public IHttpActionResult Deletetbl_parent_task(int id)
        {
            tbl_parent_task tbl_parent_task = db.tbl_parent_task.Find(id);

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

            db.tbl_parent_task.Remove(tbl_parent_task);
            db.SaveChanges();

            return(Ok(tbl_parent_task));
        }