예제 #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));
        }
예제 #2
0
        public async Task <IHttpActionResult> GetNomLineCheckForms(int id)
        {
            NomLineCheckForms nomLineCheckForms = await db.NomLineCheckForms.FindAsync(id);

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

            return(Ok(nomLineCheckForms));
        }
예제 #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));
        }
예제 #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));
        }