コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TipoDeTransaccionID,TransactionTypecode,DescripcionTipoDeTransaccion")] TipoDeTransaccion tipoDeTransaccion)
        {
            if (id != tipoDeTransaccion.TipoDeTransaccionID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tipoDeTransaccion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TipoDeTransaccionExists(tipoDeTransaccion.TipoDeTransaccionID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoDeTransaccion));
        }
コード例 #2
0
 public Transaccion(TipoDeTransaccion tipoDeTransaccion, Concepto concepto,
                    decimal monto)
 {
     this.TipoDeTransaccion = tipoDeTransaccion;
     this.Concepto          = concepto;
     this.Monto             = monto;
 }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("TipoDeTransaccionID,TransactionTypecode,DescripcionTipoDeTransaccion")] TipoDeTransaccion tipoDeTransaccion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tipoDeTransaccion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoDeTransaccion));
        }