Пример #1
0
 private void CompraDeOferta_Load(object sender, EventArgs e)
 {
     ofertas = FuncionesOferta.getOfertasNoVencidas();
     foreach (Oferta oferta in ofertas)
     {
         Object[] row = new Object[] { oferta.proveedor_id, oferta.descripcion, oferta.precio_oferta, oferta.cantidad, oferta.maximo_usuario };
         dataGridCompraOfertas.Rows.Add(row);
     }
 }
        private void button3_Click(object sender, EventArgs e)
        {
            this.validar();

            Oferta oferta = new Oferta();

            oferta.maximo_usuario    = Int32.Parse(maxCliente.Text);
            oferta.codigo            = txt_codigo.Text;
            oferta.descripcion       = txt_descripcion.Text;
            oferta.fecha_publicacion = dateTimePickerOferta.Value;
            oferta.fecha_vencimiento = dateTimePickerVencimiento.Value;
            oferta.cantidad          = Int32.Parse(cantidad.Text);
            oferta.precio_lista      = Int32.Parse(precioLista.Text);
            oferta.precio_oferta     = Int32.Parse(precioOferta.Text);
            oferta.proveedor_id      = Int32.Parse(comboBox1.Text);

            FuncionesOferta.altaOferta(oferta);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                Oferta oferta = new Oferta();
                oferta.maximo_usuario    = Int32.Parse(maxUnidades.Text);
                oferta.codigo            = txt_codigo.Text;
                oferta.descripcion       = txt_descripcion.Text;
                oferta.fecha_publicacion = dateTimePickerOferta.Value;
                oferta.fecha_vencimiento = dateTimePickerVencimiento.Value;
                oferta.cantidad          = Int32.Parse(cantidad.Text);
                oferta.precio_lista      = Int32.Parse(precioLista.Text);
                oferta.precio_oferta     = Int32.Parse(precioOferta.Text);
                oferta.proveedor_id      = FuncionesProveedor.getProveedorLogueado();

                FuncionesOferta.altaOferta(oferta);
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show("El Proveedor esta dado de baja", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }