コード例 #1
0
        public async Task <IActionResult> PutTipoPago(int id, PCTipoPago TipoPago)
        {
            if (id != TipoPago.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
        // POST: api/TipoPago
        //[HttpPost]
        public async Task <ActionResult <PCTipoPago> > PostTipoPago(PCTipoPago TipoPago)
        {
            _context.PCTipoPago.Add(TipoPago);

            await _context.SaveChangesAsync();

            //TODO aclarar con franklin
            return(CreatedAtAction("GetTipoPago", new { id = TipoPago.Id }, TipoPago));
        }
コード例 #3
0
        public async Task <HttpResponseMessage> UpdateTipoPagoAsync(int id, PCTipoPago TipoPago)
        {
            var client = new HttpClient();

            return(await client.PutAsync($"{baseUrl}api/TipoPago/{id}", getStringContentFromObject(TipoPago)));
        }
コード例 #4
0
        public async Task <HttpResponseMessage> InsertTipoPagoAsync(PCTipoPago TipoPago)
        {
            var client = new HttpClient();

            return(await client.PostAsync($"{baseUrl}api/TipoPago", getStringContentFromObject(TipoPago)));
        }