Example #1
0
        public async Task <ActionResult <status_payment> > Poststatus_payment(status_payment status_payment)
        {
            _context.status_payment.Add(status_payment);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getstatus_payment", new { id = status_payment.id_status_payment }, status_payment));
        }
Example #2
0
        public async Task <IActionResult> Putstatus_payment(int id, status_payment status_payment)
        {
            if (id != status_payment.id_status_payment)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }