public async Task <IHttpActionResult> PostSupply_Details(Supply_Details supply_Details)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Supply_Details.Add(supply_Details);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (Supply_DetailsExists(supply_Details.IdSupply))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = supply_Details.IdSupply }, supply_Details));
        }
        public async Task <IHttpActionResult> PutSupply_Details(int id, Supply_Details supply_Details)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != supply_Details.IdSupply)
            {
                return(BadRequest());
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Supply_DetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetSupply_Details(int id)
        {
            Supply_Details supply_Details = await db.Supply_Details.FindAsync(id);

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

            return(Ok(supply_Details));
        }
        public async Task <IHttpActionResult> DeleteSupply_Details(int id)
        {
            Supply_Details supply_Details = await db.Supply_Details.FindAsync(id);

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

            db.Supply_Details.Remove(supply_Details);
            await db.SaveChangesAsync();

            return(Ok(supply_Details));
        }