Beispiel #1
0
        public ActionResult Pipa(int?page)
        {
            if (Session["StringToken"] == null)
            {
                return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel())));
            }
            string _tkn = Session["StringToken"].ToString();

            ViewBag.EsSuperUser = TokenServicio.ObtenerEsSuperUsuario(_tkn);
            var Pagina = page ?? 1;

            if (ViewBag.EsSuperUser)
            {
                ViewBag.Empresas    = CatalogoServicio.Empresas(_tkn);
                ViewBag.CajaGeneral = VentasServicio.ListaVentasCajaGral(_tkn, "").ToPagedList(Pagina, 20);
            }
            else
            {
                ViewBag.Empresas = CatalogoServicio.Empresas(_tkn).SingleOrDefault(x => x.IdEmpresa.Equals(TokenServicio.ObtenerIdEmpresa(_tkn))).NombreComercial;
                ViewBag.ListaPV  = CatalogoServicio.ListaPrecioVentaIdEmpresa(TokenServicio.ObtenerIdEmpresa(_tkn), _tkn).ToPagedList(Pagina, 20);
            }

            if (TempData["RespuestaDTO"] != null)
            {
                ViewBag.MessageExito = TempData["RespuestaDTO"];
            }
            if (TempData["RespuestaDTOError"] != null)
            {
                ViewBag.MessageError = TempData["RespuestaDTOError"];
            }

            ViewBag.MessageError = TempData["RespuestaDTOError"];

            return(View());
        }
Beispiel #2
0
        public ActionResult Buscar(int?page, int?pagePipa, CajaGeneralCamionetaModel _model = null)
        {
            if (_model != null && _model.FolioOperacionDia != null)
            {
                TempData["Model"] = _model;
            }
            if (Session["StringToken"] == null)
            {
                return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel())));
            }
            string _tkn = Session["StringToken"].ToString();

            var Pagina = page ?? 1;

            ViewBag.CajaGeneralCamioneta = VentasServicio.ListaVentasCajaGralCamioneta(((CajaGeneralCamionetaModel)TempData["Model"]).FolioOperacionDia, _tkn).ToPagedList(Pagina, 10);

            if (ViewBag.CajaGeneralCamioneta.Count == 0)
            {
                TempData["RespuestaDTOError"] = "No existe la clave solicitada";
            }
            else
            {
                CajaGeneralCamionetaModel nMod = (CajaGeneralCamionetaModel)ViewBag.CajaGeneralCamioneta[0];
                ViewBag.SalidaGas         = VentasServicio.ListaVentasMovimientosGas(nMod, _tkn);
                ViewBag.SalidaGasCilindro = VentasServicio.ListaVentasMovimientosGasC(nMod, _tkn).GroupBy(x => x.CantidadKg).Select(grp => grp.First());//.ToPagedList(Pagina, 10);

                TempData["RespuestaCajaGral"]          = ViewBag.CajaGeneralCamioneta;
                TempData["RespuestaSalidaGas"]         = ViewBag.SalidaGas;
                TempData["RespuestaSalidaGasCilindro"] = ViewBag.SalidaGasCilindro;
            }
            return(RedirectToAction("Liquidar", new { page, pagePipa }));
        }
Beispiel #3
0
        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"));
        }
Beispiel #4
0
        public ActionResult BuscarEstacion(VentaCorteAnticipoModel _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.CajaGeneralEstacion = VentasServicio.ListaVentasCajaGralEstacion(_model.FolioOperacion, _tkn).ToPagedList(Pagina, 10);

            if (ViewBag.CajaGeneralEstacion.Count == 0)
            {
                TempData["RespuestaDTOError"] = "No existe la clave solicitada";
            }
            else
            {
                TempData["RespuestaCajaGralEst"] = ViewBag.CajaGeneralEstacion;
            }
            return(RedirectToAction("Estacion"));
        }
        /// <summary>
        /// Metodo para inicializar los objetos
        /// y variables del MVVM del MV de ventas
        /// </summary>
        private void inicializa()
        {
            ventaServ = new VentasServicio(tpvEnt);

            usuServ       = new UsuariosServicio(tpvEnt);
            cliServ       = new ClienteServicio(tpvEnt);
            ventaProdServ = new Ventas_De_ProductosServicio(tpvEnt);


            objVenta       = new ventas();
            objVenta.fecha = DateTime.Now;

            objVentasProductos = new ventas_de_productos();

            listaVentasProdCompra = new List <ventas_de_productos>();

            listaCollecVentasDataGrid = new ListCollectionView(ventaServ.getAll().ToList());

            fechaIni = DateTime.Now;
            fechaFin = DateTime.Now;
        }
Beispiel #6
0
        // 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());
        }
        /// <summary>
        /// Metodo para inicializar los objetos
        /// y variables del MVVM del MV de ventas de productos
        /// </summary>
        private void inicializa()
        {
            //ventaProdServ = new ServicioGenerico<ventas_de_productos>(tpvEnt);
            ventaProdServ = new Ventas_De_ProductosServicio(tpvEnt);
            //ventaServ = new VentasServicio(tpvEnt);
            ventaServ = new ServicioGenerico <ventas>(tpvEnt);

            listaVentasProdCompra       = new List <ventas_de_productos>();
            listaCollecVentasProdCompra = new ListCollectionView(ventaProdServ.getAll().ToList());
            ventaProdSelect             = new ventas_de_productos();

            fechaIni = DateTime.Now;
            fechaFin = DateTime.Now;

            //Obtener ultima venta para la factura
            ventaFactura           = new ventas();
            ventaServFactura       = new VentasServicio(tpvEnt);
            listaVentasProdFactura = new List <ventas_de_productos>();

            ventaFactura = ventaServFactura.getLastVenta();

            sacarVentasDeProdFactura(ventaFactura);
        }
Beispiel #8
0
        public ActionResult GuardarLiquidaEstacion(VentaCorteAnticipoModel _ObjModel)
        {
            if (Session["StringToken"] == null)
            {
                return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel())));
            }
            string _tok = Session["StringToken"].ToString();

            var respuesta = VentasServicio.GuardarLiquidacionEstacion(_ObjModel, _tok);

            if (respuesta.Exito)
            {
                TempData["RespuestaDTO"]      = respuesta.Mensaje;
                TempData["RespuestaDTOError"] = null;
                return(RedirectToAction("Estacion"));
            }

            else
            {
                TempData["RespuestaDTOError"] = respuesta;
                return(RedirectToAction("Estacion"));
            }
        }