Exemple #1
0
 public double valorConsumos(int piso, int nQuarto)
 {
     for (int i = 0; i < quartos.Count; i++)
     {
         if (quartos[i] is QuartoSuper && quartos[i].Piso == piso && quartos[i].Numero == nQuarto)
         {
             QuartoSuper super = (QuartoSuper)quartos[i];
             return(super.getTotalConsumos());
         }
     }
     return(-1);
 }
Exemple #2
0
        // Retorna a lista de Consumos
        public static List <double> getConsumosById(int idQuarto)
        {
            for (int i = 0; i < quartos.Count; i++)
            {
                if (quartos[i] is QuartoSuper && quartos[i].Id == idQuarto)
                {
                    QuartoSuper super = (QuartoSuper)quartos[i];

                    return(super.getConsumos());
                }
            }
            return(null);
        }
Exemple #3
0
        // Retorna a lista de Consumos
        public static double getTotalConsumosById(int idQuarto)
        {
            for (int i = 0; i < quartos.Count; i++)
            {
                if (quartos[i] is QuartoSuper && quartos[i].Id == idQuarto)
                {
                    QuartoSuper super = (QuartoSuper)quartos[i];

                    return(super.getTotalConsumos());
                }
            }
            return(0);
        }
Exemple #4
0
        public List <QuartoSuper> quartosConsumosSuperiorA(double consumo)
        {
            List <QuartoSuper> newList = new List <QuartoSuper>();

            for (int i = 0; i < quartos.Count; i++)
            {
                if (quartos[i] is QuartoSuper)
                {
                    QuartoSuper super = (QuartoSuper)quartos[i];
                    if (super.getTotalConsumos() > consumo)
                    {
                        newList.Add(super);
                    }
                }
            }
            return(newList);
        }