public computadora() { this.estaEncendida = false; this.marca = (eMarca)0; this.peso = 0; this.procesador = (eProcesador)0; }
public eMarca Guardar(DSDataContext dcOri) { try { DSDataContext dc = dcOri; eMarca fila = new eMarca(); fila.nombre = this.nombre; if (this.id == 0) { dc.eMarcas.InsertOnSubmit(fila); } else { var res = from x in dc.eMarcas where x.id == this.id select x; if (res.Count() > 0) { fila = res.First(); fila.nombre = this.nombre; } else { throw new Exception("Id no encontrado en Marca"); } } return(fila); } catch (Exception) { throw; } }
public void Guardar() { DSDataContext dc = new DSDataContext(Conexion.DarStrConexion()); eMarca f = Guardar(dc); dc.SubmitChanges(); this.id = f.id; }
public Auto(int cantidadAsientosParametro, string s, byte b, eMarca m) : base(s, b, m) { this.cantidadAsientos = cantidadAsientosParametro; }
public Vehiculo(int patente, string nombre, string apellido, eMarca marca) : this(patente, nombre, apellido) { this._marca = marca; }
public Automovil(int patente, string nombre, string apellido, eMarca marca, ConsoleColor color) : base(patente, nombre, apellido, marca) { this._color = color; }
public Automovil(int patente, string nombre, string apellido, eMarca marca) : base(patente, nombre, apellido, marca) { }
public Auto(string patente, byte cantRuedas, eMarca marca, int cantidadAsientos) : base(patente, cantRuedas, marca) { this.cantidadAsientos = cantidadAsientos; }
public Moto(string patente, byte cantRuedas, eMarca marca, float cilindrada) : base(patente, cantRuedas, marca) { this.cilindrada = cilindrada; }
public Vehiculo(string patenteParametro, Byte ruedasParametro, eMarca marcaParametro) { this._patente = patenteParametro; this._cantidadRuedas = ruedasParametro; this._marca = marcaParametro; }
protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); Graphics g = pe.Graphics; LinearGradientBrush gradiente = new LinearGradientBrush(new Point(1, 0), new Point(50, 100), ColorInicial, ColorFinal); int grosor = 0; int offsetX = 0; int offsetY = 0; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; if (Gradiente) { g.FillRectangle(gradiente, 0, 0, this.Width, this.Height); } switch (Marca) { case eMarca.Circulo: grosor = 20; g.DrawEllipse(new Pen(Color.Green, grosor), grosor, grosor, this.Font.Height, this.Font.Height); offsetX = this.Font.Height + grosor; offsetY = grosor; medida = offsetX + offsetY; break; case eMarca.Cruz: grosor = 20; Pen lapiz = new Pen(Color.Red, grosor); g.DrawLine(lapiz, grosor, grosor, this.Font.Height, this.Font.Height); g.DrawLine(lapiz, this.Font.Height, grosor, grosor, this.Font.Height); offsetX = this.Font.Height + grosor; offsetY = grosor / 2; medida = offsetX + offsetY; lapiz.Dispose(); break; case eMarca.Imagen: if (image != null) { g.DrawImage(image, grosor, grosor, this.Font.Height, this.Font.Height); } else { marca = eMarca.Nada; } offsetX = this.Font.Height + grosor; offsetY = grosor / 2; medida = offsetX + offsetY; break; } SolidBrush b = new SolidBrush(this.ForeColor); g.DrawString(this.Text, this.Font, b, offsetX + grosor, offsetY); Size tam = g.MeasureString(this.Text, this.Font).ToSize(); this.Size = new Size(tam.Width + offsetX + grosor, tam.Height + offsetY * 2); b.Dispose(); }
public Motocicleta(int patente, string nombre, string apellido, eMarca marca, bool esCilindrada) : base(patente, nombre, apellido, marca) { this._esCilindrada = esCilindrada; }
public Motocicleta(int patente, string nombre, string apellido, eMarca marca) : base(patente, nombre, apellido, marca) { }
public Vehiculo(string patente, byte cantRuedas, eMarca marca) { this.patente = patente; this.cantRuedas = cantRuedas; this.marca = marca; }
public Camion(string patente, byte cantRuedas, eMarca marca, float tara) : base(patente, cantRuedas, marca) { this.tara = tara; }