Esempio n. 1
0
        public async Task <IHttpActionResult> PutStatus_Reclamation(int id, Status_Reclamation status_Reclamation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != status_Reclamation.IdStatus_Reclamation)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> GetStatus_Reclamation(int id)
        {
            Status_Reclamation status_Reclamation = await db.Status_Reclamation.FindAsync(id);

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

            return(Ok(status_Reclamation));
        }
Esempio n. 3
0
        public async Task <IHttpActionResult> PostStatus_Reclamation(Status_Reclamation status_Reclamation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Status_Reclamation.Add(status_Reclamation);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = status_Reclamation.IdStatus_Reclamation }, status_Reclamation));
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> DeleteStatus_Reclamation(int id)
        {
            Status_Reclamation status_Reclamation = await db.Status_Reclamation.FindAsync(id);

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

            db.Status_Reclamation.Remove(status_Reclamation);
            await db.SaveChangesAsync();

            return(Ok(status_Reclamation));
        }