예제 #1
0
        public ActionResult Index(string Destino, string Origen, string FechaSalida, string Fechallegada, string cant)
        {
            //ViewBag.PriceSort = sortOrder == "Price" ? "price_desc" : "Price";

            List <DtoVuelo>    colVuelo = new List <DtoVuelo>();
            List <DtoAeronave> colAero  = new List <DtoAeronave>();

            colVuelo = HVuelo.getInstace().GetVuelo();

            //Buscador por nombre de producto
            if (!String.IsNullOrEmpty(Destino) && !String.IsNullOrEmpty(Origen) && !String.IsNullOrEmpty(FechaSalida) && !String.IsNullOrEmpty(Fechallegada) && !String.IsNullOrEmpty(cant))
            {
                int id = int.Parse(cant);
                colVuelo = HVuelo.getInstace().GetTodos(id, colVuelo, Origen, Destino, FechaSalida, Fechallegada);
            }
            else if (!String.IsNullOrEmpty(Destino) && !String.IsNullOrEmpty(Origen))
            {
                colVuelo = colVuelo.Where(s => s.destino == Destino && s.origen == Origen).ToList();
            }
            else if (!String.IsNullOrEmpty(FechaSalida) && !String.IsNullOrEmpty(Fechallegada))
            {
                colVuelo = colVuelo.Where(s => s.dtLlegada == DateTime.Parse(Fechallegada) && s.dtSalida == DateTime.Parse(FechaSalida)).ToList();
            }

            else if (!String.IsNullOrEmpty(cant))
            {
                int id = int.Parse(cant);
                colVuelo = HVuelo.getInstace().Getcant(id, colVuelo);
            }



            return(View(colVuelo));
        }
예제 #2
0
        public ActionResult VueloInfo(string id)
        {
            DtoVuelo vuelo = new DtoVuelo();

            vuelo = HVuelo.getInstace().GetVueloInfo(id);

            return(View(vuelo));
        }
예제 #3
0
        public ActionResult AddVuelo(DtoVuelo nuevovuelo)
        {
            List <string> days = (List <string>)TempData["days"];
            bool          msg  = HVuelo.getInstace().AddVuelo(nuevovuelo, days);

            if (msg == true)
            {
                TempData["MessageP"] = "Vuelo agregado satisfactoriamente!";
            }
            else
            {
                TempData["MessageP"] = "Error, verifique los datos por favor!";
            }

            return(RedirectToAction("AgregarVuelo"));
        }