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

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

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

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

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

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

            return(Ok(nomLineCheckForms));
        }
Esempio n. 3
0
        public async Task <IHttpActionResult> PostNomLineCheckForms(NomLineCheckForms nomLineCheckForms)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.NomLineCheckForms.Add(nomLineCheckForms);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = nomLineCheckForms.Id }, nomLineCheckForms));
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> DeleteNomLineCheckForms(int id)
        {
            NomLineCheckForms nomLineCheckForms = await db.NomLineCheckForms.FindAsync(id);

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

            db.NomLineCheckForms.Remove(nomLineCheckForms);
            await db.SaveChangesAsync();

            return(Ok(nomLineCheckForms));
        }