public SociosViewModel CrearSociosViewModel( string nombreApellidoORazonSocial = null, string email = null, byte?idSucursal = null, int p = 1) { int cantTotalItems = 0; var socios = SociosRepositorio.ObtenerTodos(p, CANT_ITEMS_POR_PAGINA, out cantTotalItems, email, nombreApellidoORazonSocial, idSucursal, incluirSucursal: true, incluirUsuario: true) .Select(e => new SocioModel { Id = e.Id, Email = e.Usuario.Email, NombreApellidoORazonSocial = e.NombreApellidoORazonSocial, SucursalNombre = e.Sucursal.Nombre, LockoutEndDateUtc = e.Usuario.LockoutEndDateUtc }) .ToList(); var viewModel = new SociosViewModel { NombreApellidoORazonSocial = nombreApellidoORazonSocial, Email = email, IdSucursal = idSucursal }; viewModel.CargarItemsYPaginacion(socios, p, cantTotalItems, CANT_ITEMS_POR_PAGINA); viewModel.SucursalesSelectList = ListasHelper.CrearSucursalesSelectList(); return(viewModel); }
public ActionResult CajaDeAhorros( string desde = null, string hasta = null, string tipoComprobante = null, int p = 1, bool exp = false, string f = null) { var rangoFechas = new RangoFechas(desde, hasta, cantMaxMeses: CantMaxMesesDetalleCajaAhorros); var viewModel = new DetalleCajaDeAhorrosViewModel { Desde = rangoFechas.Desde, Hasta = rangoFechas.Hasta, TipoComprobante = tipoComprobante ?? Socio.TipoCuenta, TiposComprobanteSelectList = ListasHelper.CrearTiposCuentaSelectList() }; if (ValidarRangoFechas(rangoFechas)) { CargarItemsCajaDeAhorrosViewModel(viewModel, p, exp); } if (exp) { switch (f) { case Formato.ARCHIVO_FORMATO_PDF: return(ReportesPdfHelper.GenerarReporteCajaDeAhorrosPdfFileResult(viewModel.Items)); case Formato.ARCHIVO_FORMATO_EXCEL: default: return(ReportesExcelHelper.GenerarActionResultExcelCajaDeAhorros(viewModel.Items)); } } else { return(View(viewModel)); } }
public void CargarListasSocioViewModel(SocioViewModel viewModel) { viewModel.SucursalesSelectList = ListasHelper.CrearSucursalesSelectList(); viewModel.TiposCuentaSelectList = ListasHelper.CrearTiposCuentaSelectList(); }