Exemple #1
0
        //------------------------------------Reporte de pasajes------------------------------------
        public async Task <List <EPasaje> > reportedePasaje(DTOreportePasaje reportePasaje, string tokenJWT)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(Baseurl + "reportePasaje");
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenJWT);
                var postTask = await client.PostAsJsonAsync <DTOreportePasaje>("reportePasaje", reportePasaje);

                return(await postTask.Content.ReadAsAsync <List <EPasaje> >());
            }
        }
Exemple #2
0
        public IHttpActionResult reportePasaje([FromBody] DTOreportePasaje repoPasaje)
        {
            try
            {
                string strfechaDesde = repoPasaje.fechaDesde;
                string strfechaHasta = repoPasaje.fechaHasta;
                if (repoPasaje.fechaDesde == null || repoPasaje.fechaHasta == null)
                {
                    strfechaDesde = "1900,01,01";
                    strfechaHasta = "1900,01,01";
                }
                List <EPasaje> EPasajes = cGeneral.reposrtesPasajes(Convert.ToDateTime(strfechaDesde), Convert.ToDateTime(strfechaHasta), repoPasaje.linea, repoPasaje.salida, repoPasaje.viaje);

                return(Ok(EPasajes));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
        public ActionResult reportePasaje(DTOreportePasaje repoPasaje)
        {
            if (Session["reporteP"].ToString() == "v")
            {
                repoPasaje.linea  = -1;
                repoPasaje.salida = -1;
            }
            if (Session["reporteP"].ToString() == "s")
            {
                repoPasaje.viaje = -1;
                repoPasaje.linea = -1;
            }
            if (Session["reporteP"].ToString() == "l")
            {
                repoPasaje.viaje  = -1;
                repoPasaje.salida = -1;
            }
            List <EPasaje> result = Task.Run(() => pxa.reportedePasaje(repoPasaje, Session["tokenJWT"].ToString())).Result;

            return(View("verReportePasaje", result));
        }