public ActionResult Consultar(CajaGeneralModel _model, int?page) { if (Session["StringToken"] == null) { return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel()))); } string _tkn = Session["StringToken"].ToString(); var Pagina = page ?? 1; ViewBag.CajaGeneral = VentasServicio.ListaVentasCajaGralId(_model.IdEmpresa, _tkn).ToPagedList(Pagina, 20); ViewBag.Empresas = CatalogoServicio.Empresas(_tkn); return(View("Index")); }
// GET: CajaGeneral public ActionResult Index(int?page) { if (Session["StringToken"] == null) { return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel()))); } string _tkn = Session["StringToken"].ToString(); var Pagina = page ?? 1; ViewBag.CboxEntidad = VentasServicio.ListaVentasCajaGral(_tkn, "Entidad").Select(x => x.PuntoVenta).Distinct(); ViewBag.CboxConcepto = VentasServicio.ListaVentasCajaGral(_tkn, "").Select(x => x.Concepto).Distinct(); ViewBag.EsAdmin = TokenServicio.ObtenerEsAdministracionCentral(_tkn); if (ViewBag.EsAdmin) { ViewBag.Empresas = CatalogoServicio.Empresas(_tkn); ViewBag.CajaGeneral = VentasServicio.ListaVentasCajaGral(_tkn, "").OrderByDescending(x => x.FechaAplicacion).ToPagedList(Pagina, 20);//.OrderByDescending(y => y.Orden).ToList(); } else { ViewBag.Empresas = CatalogoServicio.Empresas(_tkn).SingleOrDefault().NombreComercial; ViewBag.CajaGeneral = VentasServicio.ListaVentasCajaGralId(TokenServicio.ObtenerIdEmpresa(_tkn), _tkn).OrderByDescending(x => x.FechaAplicacion).OrderByDescending(y => y.Orden).ToList().ToPagedList(Pagina, 20); } if (TempData["RespuestaDTO"] != null) { ViewBag.MessageExito = TempData["RespuestaDTO"]; } if (TempData["RespuestaDTOError"] != null) { ViewBag.MensajeError = Validar((RespuestaDTO)TempData["RespuestaDTOError"]); TempData["RespuestaDTOError"] = ViewBag.MessageError; } ViewBag.MessageError = TempData["RespuestaDTOError"]; return(View()); }