Exemple #1
0
        public Auto()
        {
            int num;

            num = numRandom.Next(1, 3);

            switch (num)
            {
            case 1:
                this.Fabricante = (EFabricante)1;
                break;

            case 2:
                this.Fabricante = (EFabricante)2;
                break;

            case 3:
                this.Fabricante = (EFabricante)3;
                break;
            }

            this.DI = new Rueda();
            this.DD = new Rueda();
            this.TI = new Rueda();
            this.TD = new Rueda();
            Auto.ContadorDeObjetos++;
            this.TiempoDemorado     = 0;
            this.KilometroRecarrido = 0;
        }
Exemple #2
0
        public Auto()
        {
            numero = randomMarca.Next(1, 3);

            this.fabricante = (EFabricante)numero;
            this.ruedaDI    = new Rueda();//esto se denomina instanciar
            this.ruedaDD    = new Rueda();
            this.ruedaTI    = new Rueda();
            this.ruedaTD    = new Rueda();
            Auto.contadorDeObjetos++;
        }
Exemple #3
0
        public Auto()
        {
            //Random random = new Random();
            int numero;

            numero          = randomFabricante.Next(0, 9);
            this.fabricante = (EFabricante)numero;
            this.TI         = new Rueda();
            this.TD         = new Rueda();
            this.DD         = new Rueda();
            this.DI         = new Rueda();
            Auto.contadorObjetos++;
            this.tiempoTardado        = 0;
            this.kilometrosRecorridos = 0;
        }
Exemple #4
0
        public static List <Tren> Leer()
        {
            List <Tren> trenesL = new List <Tren>();
            Tren        tren;

            string consulta = String.Format("Select * from trenes");

            try
            {
                comando.CommandText = consulta;
                conexion.Open();
                SqlDataReader oDr = comando.ExecuteReader();

                while (oDr.Read())
                {
                    int         velocidad   = int.Parse(oDr["velocidad"].ToString());
                    EFabricante fabricante  = (EFabricante)oDr["fabricante"];
                    string      cantVagones = oDr["cantidad_vagones"].ToString();



                    tren = new Tren(velocidad, fabricante, cantVagones);

                    trenesL.Add(tren);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                conexion.Close();
            }

            return(trenesL);
        }
Exemple #5
0
 public Tren(int velocidad, EFabricante fabricante, string cantidadVagones) : base(fabricante, velocidad)
 {
     this.canVagones = cantidadVagones;
     this.fabricante = fabricante;
     this.velocidad  = velocidad;
 }
Exemple #6
0
 public Avion(int velocidad, EFabricante fabricante, string aerolinea) : base(fabricante, velocidad)
 {
     this.velocidad  = velocidad;
     this.fabricante = fabricante;
     this.aerolinea  = aerolinea;
 }
Exemple #7
0
 public Auto(string nombrePiloto, EFabricante fabricanteAuto) : this()
 {
     this._nombrePiloto   = nombrePiloto;
     this._fabricanteAuto = fabricanteAuto;
 }
 protected Transporte(EFabricante fabricante, int velocidad)
 {
     this.velocidad  = velocidad;
     this.fabricante = fabricante;
 }
Exemple #9
0
 public Auto(string NombrePiloto, EFabricante Fabricante)
 {
     this._nombrePiloto = NombrePiloto;
     this._Fabricante   = (EFabricante)Fabricante;
 }
Exemple #10
0
 public Transporte(EFabricante fabricante, int velocidad)
 {
     this.Velocidad  = velocidad;
     this.Fabricante = fabricante;
 }