public void InsertarObra(ObraDeArte obra)
        {
            String mensaje = "";

            if (this.EstaLlena())  // Verifica si esta llena
            {
                mensaje = "\nNo hay lugar para ingresar otra obra de arte";
            }
            else if (!this.HayObras())  // Verifica que no hayan obras
            {
                // Agrego la obra
                this.exposicion[0] = obra;
                mensaje            = "\nObra de arte agregada correctamente";
            }
            else if (this.RecuperarObra(obra.GetCodigo()) != null)  // Verifico si existe la obra
            {
                mensaje = "\nYa existe esa obra de arte";
            }
            else
            {
                // Agrego la Obra
                this.exposicion[this.CantidadObras()] = obra;
                mensaje = "\nObra de arte agregada correctamente";
            }

            Console.WriteLine(mensaje);
        }
Example #2
0
        public ObraDeArte recuperaObra(int codigo)
        {
            ObraDeArte obr = null;

            foreach (ObraDeArte obra in obras)
            {
                if (obra != null && obra.Codigo() == codigo)
                {
                    obr = obra;
                }
            }
            return(obr);
        }
Example #3
0
        public Boolean existeObra(ObraDeArte o)
        {
            Boolean existe = false;

            foreach (ObraDeArte obra in obras)
            {
                if (obra == o)
                {
                    existe = true;
                }
            }
            return(existe);
        }
        public Boolean estaArtista(ObraDeArte o)
        {
            Boolean estaArt = false;

            foreach (Artista art in ArtistasExp)
            {
                if (o.Nombre().Equals(art.Nombre()))
                {
                    estaArt = true;
                }
            }
            return(estaArt);
        }
Example #5
0
        public ObraDeArte[] todosLosCuadrosPrestados()
        {
            ObraDeArte[] obrasPrest;
            int          contador = obras.Length;

            obrasPrest = new ObraDeArte[contador];
            for (int i = 0; i < obras.Length; i++)
            {
                if (obras[i] != null && obras[i] is CuadroPrestado)
                {
                    obrasPrest[i] = obras[i];
                }
            }


            return(obrasPrest);
        }
 public void OrdenarObrasPorAnioDeCreacion()
 {
     for (int i = 0; i < this.exposicion.Length; i++)
     {
         for (int j = 0; j < this.exposicion.Length - 1; j++)
         {
             if (this.exposicion[j + 1] != null)
             {
                 if (this.exposicion[j].GetAnioCreacion() > this.exposicion[j + 1].GetAnioCreacion())
                 {
                     ObraDeArte aux = this.exposicion[j];
                     this.exposicion[j]     = this.exposicion[j + 1];
                     this.exposicion[j + 1] = aux;
                 }
             }
         }
     }
 }
Example #7
0
        public void insertarObra(ObraDeArte o)

        {
            //creo una lista de obras y le asigno la obra q se ingresa
            //List<ObraDeArte> obrass = new List<ObraDeArte> { };
            //obrass.Add(o);


            for (int i = 0; i < obras.Length; i++)
            {
                obras[i] = null;
                if (obras[i] == null)
                {
                    obras[i] = o;
                    break;
                }
            }
        }
 /* AGREGAR DATOS AL CENTRO CULTURAL */
 public void agregarObra(ObraDeArte obra)
 {
     obras.InsertarObra(obra);
 }