Пример #1
0
        public void Update(BoletoUpdateViewModel boleto)
        {
            var _boleto = _terminalBusContext.Boletos.Find(boleto.IdBoleto);

            if (_boleto != null)
            {
                _boleto.IdViaje     = boleto.IdViaje;
                _boleto.Asiento     = boleto.Asiento;
                _boleto.FechaCompra = boleto.FechaCompra;
                _terminalBusContext.Boletos.Update(_boleto);
                _terminalBusContext.SaveChanges();
            }
        }
Пример #2
0
 public ActionResult Update(BoletoUpdateViewModel boleto)
 {
     try
     {
         _boletoService.Update(boleto);
     }
     catch (Exception)
     {
         return(new JsonResult("Oops! algo salio mal.")
         {
             StatusCode = 400
         });
     }
     return(new JsonResult("OK")
     {
         StatusCode = 200
     });
 }