Example #1
0
        public async Task <IHttpActionResult> PostC102575814Customer(C102575814Customer c102575814Customer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.C102575814Customer.Add(c102575814Customer);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (C102575814CustomerExists(c102575814Customer.CustNo_))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = c102575814Customer.CustNo_ }, c102575814Customer));
        }
Example #2
0
        public async Task <IHttpActionResult> PutC102575814Customer(int id, C102575814Customer c102575814Customer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != c102575814Customer.CustNo_)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public async Task <IHttpActionResult> GetC102575814Customer(int id)
        {
            C102575814Customer c102575814Customer = await db.C102575814Customer.FindAsync(id);

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

            return(Ok(c102575814Customer));
        }
Example #4
0
        public async Task <IHttpActionResult> DeleteC102575814Customer(int id)
        {
            C102575814Customer c102575814Customer = await db.C102575814Customer.FindAsync(id);

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

            db.C102575814Customer.Remove(c102575814Customer);
            await db.SaveChangesAsync();

            return(Ok(c102575814Customer));
        }