Ejemplo n.º 1
0
        public async Task <IActionResult> PutInvoiceDetails(int id, SalesInvoice_Details invoiceDetails)
        {
            if (id != invoiceDetails.ID)
            {
                return(BadRequest());
            }

            _context.Entry(invoiceDetails).State = EntityState.Modified;

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <SalesInvoice_Details> > PostInvoiceDetails(SalesInvoice_Details invoiceDetails)
        {
            _context.SalesInvoice_Details.Add(invoiceDetails);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetInvoiceDetails", new { id = invoiceDetails.ID }, invoiceDetails));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult <SalesInvoice_Details> > PostSalesInvoice_Details(int id, SalesInvoice_Details salesInvoice_Details)
        {
            var check = _context.SalesInvoice_Details.Where(x => x.Header_ID == id).ToList();

            if (check == null)
            {
                return(NotFound());
            }
            salesInvoice_Details.Header_ID = id;
            _context.SalesInvoice_Details.Add(salesInvoice_Details);

            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSalesInvoice_Details", new { id = salesInvoice_Details.ID }, salesInvoice_Details));
        }