Example #1
0
        public void AddCoche(CocheEN coche)
        {
            CestaCAD aux = new CestaCAD();

            coches.Add(coche);
            precio += coche.Precio;
        }
Example #2
0
        //Métodos
        public void AddCoche(CocheEN coche)
        {
            ListaDeseadosCAD aux = new ListaDeseadosCAD();

            if (aux.InsertarCoche(coche))
            {
                coches.Add(coche);
            }
        }
Example #3
0
 public void DeleteCoche(CocheEN coche)
 {
     for (int i = 0; i < coches.Count; i++)
     {
         if (coches[i].Matricula == coche.Matricula)
         {
             coches.RemoveAt(i);
             precio -= coche.Precio;
         }
     }
 }
Example #4
0
        //Sacamos información de la BD a partir de una matrícula e insertamos los datos en el objeto
        public bool SacarCoche(string matricula)
        {
            bool     exito    = false;
            CocheCAD cocheCad = new CocheCAD();
            CocheEN  coche    = cocheCad.SacarCoche(matricula);

            this.marca     = coche.marca;
            this.modelo    = coche.modelo;
            this.precio    = coche.precio;
            this.puertas   = coche.puertas;
            this.motor     = coche.motor;
            this.km        = coche.km;
            this.anyo      = coche.anyo;
            this.tipo      = coche.tipo;
            this.plazas    = coche.plazas;
            this.cambio    = coche.cambio;
            this.color     = coche.color;
            this.matricula = coche.matricula;
            return(exito);
        }