예제 #1
0
        public async Task <IActionResult> AddPago(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var propietario = await _context.Propietariostbls.FindAsync(id.Value);

            if (propietario == null)
            {
                return(NotFound());
            }

            var model = new PagoViewModel
            {
                PropietarioId     = propietario.Id,
                PAG_FECHACREACION = DateTime.Today,
                PAG_ESTADO        = 'A',
                Anios1            = _combosHelper.GetComboAnios(),
                Meses1            = _combosHelper.GetComboMeses(),
                Valores           = _combosHelper.GetComboValores(),
                TiposPago         = _combosHelper.GetComboValoresDescripcion(),
                Puntos            = _combosHelper.GetComboPuntos()
            };

            return(View(model));
        }
예제 #2
0
 public PagoViewModel ToPagoViewModel(Pagostbl pago)
 {
     return(new PagoViewModel
     {
         PAG_FECHAPAGADO = pago.PAG_FECHAPAGADO,
         PAG_FECHACREACION = DateTime.Today,
         PAG_ESTADO = 'A',
         Propietario = pago.Propietario,
         Anio = pago.Anio,
         Mes = pago.Mes,
         Val = pago.Val,
         Tipos = pago.Tipos,
         PuntodePago = pago.PuntodePago,
         Id = pago.Id,
         PropietarioId = pago.Propietario.Id,
         AnioId = pago.Anio.Id,
         MesId = pago.Mes.Id,
         ValorId = pago.Val.Id,
         TipoPagoId = pago.Tipos.Id,
         PuntoPagoId = pago.PuntodePago.Id,
         Anios1 = _combosHelper.GetComboAnios(),
         Meses1 = _combosHelper.GetComboMeses(),
         Valores = _combosHelper.GetComboValores(),
         TiposPago = _combosHelper.GetComboValoresDescripcion(),
         Puntos = _combosHelper.GetComboPuntos(),
     });
 }