public Itinerario(byte diasEstadia, decimal costoDiario, Destino destino, string id)
 {
     this.DiasEstadia = diasEstadia;
     this.CostoDiario = costoDiario;
     this.Destino = destino;
     this.Id = id;
 }
Example #2
0
 public void AltaDestino(string nombre, string pais, string ciudad, bool esNacional)
 {
     nombre = nombre.ToUpper();
     pais = pais.ToUpper();
     ciudad = ciudad.ToUpper();
     Destino aux = new Destino(nombre, pais, ciudad, esNacional);
     this.destinos.Add(aux);
 }
Example #3
0
        public void DestinoEnFecha(string ciudadDestino, DateTime fechaInicio, DateTime fechaFin)
        {
            //Comprueba que la ciudad ingresada exista en algun destino
            Destino destino = ObtenerDestino(ciudadDestino);

            if (destino == null)
            {
                Console.WriteLine("El destino ingresado no existe");
            }
            else
            {
                //Se recorren todas las excursiones
                foreach (Excursion exc in excursiones)
                {
                    //Se recorren todos los destinos dentro de cada excursion
                    foreach (Destino des in exc.Destinos)
                    {
                        //Si el destino esta en alguna excursion, se compruba de que se encuetre dentro de el rango dado
                        if (des == destino)
                        {
                            if (fechaInicio >= exc.FechaComienzo)
                            {
                                if (fechaInicio <= exc.FechaFinal)
                                {
                                    Console.WriteLine(exc.ToString());
                                }
                                else
                                {
                                    Console.WriteLine("No existe excursion con ese destino en ese rango de fechas");
                                }
                            }
                            else if (fechaFin <= exc.FechaFinal)
                            {
                                Console.WriteLine(exc.ToString());
                            }
                            else
                            {
                                Console.WriteLine("No existe excursion con ese destino en ese rango de fechas");
                            }
                        }
                    }
                }
            }
        }
Example #4
0
        public bool TieneDestino(Destino destino)
        {
            bool ret = false;
            int i = 0;

            while (i < this.destinos.Count && !ret)
            {
                if (this.destinos[i].Destino == destino)
                {
                    ret = true;
                }
                i++;
            }
            return ret;
        }
Example #5
0
        public bool AgregarDestinos(int cant, Destino destino)
        {
            bool ret = true;

            if (Excursion.ValidoCantDias(cant) && destino!= null)
            {
            DestinoExcursion aux = new DestinoExcursion(destino, cant);
            this.destinos.Add(aux);
            this.diasTotales += cant;
            }
            return ret;
        }
Example #6
0
 public void BajaDestino(Destino aux)
 {
     this.destinos.Remove(aux);
 }
Example #7
0
        public bool TieneDestino(Destino destino)
        {
            bool ret = false;
            int i = 0;

            while (i < this.excursiones.Count && !ret)
            {
                if (this.excursiones[i].TieneDestino(destino))
                {
                    ret = true;
                }
            }

            return ret;
        }
Example #8
0
 public bool AgregarDestinos(int cantDias, Destino destino, Excursion aux)
 {
     return aux.AgregarDestinos(cantDias, destino);
 }
Example #9
0
 public List<Excursion> ListadoExcusrionesQueTienenDestino(Destino aux)
 {
     List<Excursion> listado = new List<Excursion>();
     foreach (Excursion unaE in this.excursiones)
     {
         if (unaE.TieneDestino(aux))
         {
             listado.Add(unaE);
         }
     }
     return listado;
 }
Example #10
0
        public void AgregarDestino(string ciudad, string pais, int cantidadDias, double costoActualDiario)
        {
            Destino unDestino = new Destino(ciudad, pais, cantidadDias, costoActualDiario);

            listaDestinos.Add(unDestino);
        }
 public ExcursionDestino(Destino destino, int cant)
 {
     this.cantDiasEstadia = cant;
     this.destino = destino;          
 }
 public bool AgregarDestino(string nombre, string ciudad, string pais, string id)
 {
     bool retorno = false;
     Destino unD = new Destino(nombre, ciudad, pais, id);
     if (RepoDestinos.Add(unD))
     {
         retorno = true;
         FachadaAgencia.Instancia.SerializarTodo();
         FachadaAgencia.Instancia.GuardarParametros(":");
     }
     return retorno;
 }
Example #13
0
 public DestinoExcursion(Destino destino, int cantDias)
 {
     this.destino = destino;
     this.cantDias = cantDias;
 }