Beispiel #1
0
        public IHttpActionResult PuttSalesInvoiceHeader(int id, tSalesInvoiceHeader tSalesInvoiceHeader)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tSalesInvoiceHeader.ID)
            {
                return(BadRequest());
            }

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tSalesInvoiceHeaderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult GettSalesInvoiceHeader(int id)
        {
            tSalesInvoiceHeader tSalesInvoiceHeader = db.tSalesInvoiceHeaders.Find(id);

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

            return(Ok(tSalesInvoiceHeader));
        }
Beispiel #3
0
        public IHttpActionResult PosttSalesInvoiceHeader(tSalesInvoiceHeader tSalesInvoiceHeader)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tSalesInvoiceHeaders.Add(tSalesInvoiceHeader);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tSalesInvoiceHeader.ID }, tSalesInvoiceHeader));
        }
Beispiel #4
0
        public IHttpActionResult DeletetSalesInvoiceHeader(int id)
        {
            tSalesInvoiceHeader tSalesInvoiceHeader = db.tSalesInvoiceHeaders.Find(id);

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

            db.tSalesInvoiceHeaders.Remove(tSalesInvoiceHeader);
            db.SaveChanges();

            return(Ok(tSalesInvoiceHeader));
        }