private void CrearOfertaAdministrativo_Load(object sender, EventArgs e)
 {
     foreach (Proveedor p in FuncionesProveedor.getProveedoresHabilitados())
     {
         comboBox1.Items.Add(p);
     }
 }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                //this.validar();
                Proveedor proveedor = new Proveedor(
                    FuncionesProveedor.getProveedorLogueado(),
                    txt_razonsocial.Text,
                    txt_cuit.Text,
                    txt_mail.Text,
                    Convert.ToDecimal(txt_tel.Text),
                    new Direccion(proveedorAModificar.direccion.id, txt_ciudad.Text, txt_calle.Text, Convert.ToDecimal(txt_codpostal)),
                    new Rubro(null, txt_rubro.Text),
                    txt_nombreContacto.Text,
                    checkBox1.Checked);

                FrbaOfertas.ConectorDB.FuncionesProveedor.editProveedor(proveedor);

                MessageBox.Show("Cliente modificado con exito", "Modificacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (System.ArgumentException ex)
            {
                MessageBox.Show(ex.Message, ex.ParamName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }


            this.Close();
        }
예제 #3
0
 private void ListarProveedor_Load(object sender, EventArgs e)
 {
     proveedores = FuncionesProveedor.getProveedores();
     //ACA SE AGREGAN LOS CLIENTES AL DATA GRID PARA MOSTRARSE
     foreach (Proveedor prov in proveedores)
     {
         Object[] row = new Object[] {
             prov.id,
             prov.RazonSocial,
             prov.cuit,
             prov.mail,
             prov.telefono,
             prov.direccion.Calle,
             prov.direccion.Ciudad,
             prov.direccion.codigoPostal,
             prov.nombreContacto,
             prov.rubro.descripcion,
             prov.habilitado
         };
         dataGridView1.Rows.Add(row);
     }
 }
        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);
            }
        }