Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,NoPago,PagoRequerido,FechaRequeridaPago,PagoRealizado,FechaPago,FKPreSolicitudPrestamo,FKPreCatEstadoPago")] PrePlantillaPagos prePlantillaPagos)
        {
            if (id != prePlantillaPagos.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(prePlantillaPagos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PrePlantillaPagosExists(prePlantillaPagos.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FKPreCatEstadoPago"]     = new SelectList(_context.PreCatEstadoPago, "ID", "Valor", prePlantillaPagos.FKPreCatEstadoPago);
            ViewData["FKPreSolicitudPrestamo"] = new SelectList(_context.PreSolicitudPrestamo, "ID", "ClaveSolicitud", prePlantillaPagos.FKPreSolicitudPrestamo);
            return(View(prePlantillaPagos));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ID,NoPago,PagoRequerido,FechaRequeridaPago,PagoRealizado,FechaPago,FKPreSolicitudPrestamo,FKPreCatEstadoPago")] PrePlantillaPagos prePlantillaPagos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prePlantillaPagos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FKPreCatEstadoPago"]     = new SelectList(_context.PreCatEstadoPago, "ID", "Valor", prePlantillaPagos.FKPreCatEstadoPago);
            ViewData["FKPreSolicitudPrestamo"] = new SelectList(_context.PreSolicitudPrestamo, "ID", "ClaveSolicitud", prePlantillaPagos.FKPreSolicitudPrestamo);
            return(View(prePlantillaPagos));
        }