コード例 #1
0
 public computadora()
 {
     this.estaEncendida = false;
     this.marca         = (eMarca)0;
     this.peso          = 0;
     this.procesador    = (eProcesador)0;
 }
コード例 #2
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;
            }
        }
コード例 #3
0
        public void Guardar()
        {
            DSDataContext dc = new DSDataContext(Conexion.DarStrConexion());
            eMarca        f  = Guardar(dc);

            dc.SubmitChanges();
            this.id = f.id;
        }
コード例 #4
0
 public Auto(int cantidadAsientosParametro, string s, byte b, eMarca m) : base(s, b, m)
 {
     this.cantidadAsientos = cantidadAsientosParametro;
 }
コード例 #5
0
 public Vehiculo(int patente, string nombre, string apellido, eMarca marca) : this(patente, nombre, apellido)
 {
     this._marca = marca;
 }
コード例 #6
0
 public Automovil(int patente, string nombre, string apellido, eMarca marca, ConsoleColor color) : base(patente, nombre, apellido, marca)
 {
     this._color = color;
 }
コード例 #7
0
 public Automovil(int patente, string nombre, string apellido, eMarca marca) : base(patente, nombre, apellido, marca)
 {
 }
コード例 #8
0
ファイル: Auto.cs プロジェクト: GuidoClas/C-Sharp
 public Auto(string patente, byte cantRuedas, eMarca marca, int cantidadAsientos) : base(patente, cantRuedas, marca)
 {
     this.cantidadAsientos = cantidadAsientos;
 }
コード例 #9
0
ファイル: Moto.cs プロジェクト: GuidoClas/C-Sharp
 public Moto(string patente, byte cantRuedas, eMarca marca, float cilindrada) : base(patente, cantRuedas, marca)
 {
     this.cilindrada = cilindrada;
 }
コード例 #10
0
 public Vehiculo(string patenteParametro, Byte ruedasParametro, eMarca marcaParametro)
 {
     this._patente        = patenteParametro;
     this._cantidadRuedas = ruedasParametro;
     this._marca          = marcaParametro;
 }
コード例 #11
0
        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();
        }
コード例 #12
0
 public Motocicleta(int patente, string nombre, string apellido, eMarca marca, bool esCilindrada) : base(patente, nombre, apellido, marca)
 {
     this._esCilindrada = esCilindrada;
 }
コード例 #13
0
 public Motocicleta(int patente, string nombre, string apellido, eMarca marca) : base(patente, nombre, apellido, marca)
 {
 }
コード例 #14
0
 public Vehiculo(string patente, byte cantRuedas, eMarca marca)
 {
     this.patente    = patente;
     this.cantRuedas = cantRuedas;
     this.marca      = marca;
 }
コード例 #15
0
ファイル: Camion.cs プロジェクト: GuidoClas/C-Sharp
 public Camion(string patente, byte cantRuedas, eMarca marca, float tara) : base(patente, cantRuedas, marca)
 {
     this.tara = tara;
 }