Exemple #1
0
        public IHttpActionResult Puttb_detalle_factura(int id, tb_detalle_factura tb_detalle_factura)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public IHttpActionResult Gettb_detalle_factura(int id)
        {
            tb_detalle_factura tb_detalle_factura = db.tb_detalle_factura.Find(id);

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

            return(Ok(tb_detalle_factura));
        }
Exemple #3
0
        public IHttpActionResult Posttb_detalle_factura(tb_detalle_factura tb_detalle_factura)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tb_detalle_factura.Add(tb_detalle_factura);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tb_detalle_factura.Id }, tb_detalle_factura));
        }
Exemple #4
0
        public IHttpActionResult Deletetb_detalle_factura(int id)
        {
            tb_detalle_factura tb_detalle_factura = db.tb_detalle_factura.Find(id);

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

            db.tb_detalle_factura.Remove(tb_detalle_factura);
            db.SaveChanges();

            return(Ok(tb_detalle_factura));
        }