Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPresupuestoModificaciones,Gestion,IdDocumentoRespaldo,NumeroRespaldo,FechaAutorizacion,IdPoa,IdPresupuestoFormulacion,MontoOrigen,IdPoaDestino,IdPresupuestoFormulacionDestino,MontoDestino,IdEstadoRegistro,IdUsuario,FechaRegistro")] PresupuestoModificaciones presupuestoModificaciones)
        {
            if (id != presupuestoModificaciones.IdPresupuestoModificaciones)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(presupuestoModificaciones);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PresupuestoModificacionesExists(presupuestoModificaciones.IdPresupuestoModificaciones))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(presupuestoModificaciones));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdPresupuestoModificaciones,Gestion,IdDocumentoRespaldo,NumeroRespaldo,FechaAutorizacion,IdPoa,IdPresupuestoFormulacion,MontoOrigen,IdPoaDestino,IdPresupuestoFormulacionDestino,MontoDestino,IdEstadoRegistro,IdUsuario,FechaRegistro")] PresupuestoModificaciones presupuestoModificaciones)
        {
            if (ModelState.IsValid)
            {
                presupuestoModificaciones.FechaRegistro    = DateTime.Now;
                presupuestoModificaciones.IdEstadoRegistro = '1';

                _context.Add(presupuestoModificaciones);
                await _context.SaveChangesAsync();

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