private void Btn_buscar_Click(object sender, EventArgs e) { if (Txt_proveedor.Text == "") { mensaje = new Mensaje("Para agregar un producto se debe ingresar una cotizacion y un proveedor antes."); mensaje.Show(); } else { Txt_producto.Text = Cbo_producto.ObtenerIndif(); string prod = Cbo_producto.ObtenerIndif(); idProd = ""; int i = 0; while (prod[i] != '-') { idProd = idProd + prod[i]; i++; } //idCot = obtenerCodigoDeCombo(Txt_cotizacion.Text); //Nud_cantidad.Maximum = ordenesDeCompras.existenciasPosibles(int.Parse(idProd), int.Parse(idCot)); } }
public RentaEncabezadoDetalle() { InitializeComponent(); Cbo_membresia.llenarse("cliente", "MEMBRESIA", "NOMBRES"); Cbo_empleado.llenarse("empleado", "EMPLEADO", "NOMBRES"); Cbo_producto.llenarse("material", "MATERIAL", "NOMBRE"); }
private void Btn_buscar_Click(object sender, EventArgs e) { Lbl_producto.Text = Cbo_producto.obtenerP() + "-" + Cbo_producto.obtenerU(); if (int.Parse(Cbo_producto.obtenerP()) < 58 || int.Parse(Cbo_producto.obtenerP()) > 47) { materiales.obtenerPrecio(int.Parse(Cbo_producto.obtenerP()), Txt_precioTotal, prod); codProd = int.Parse(Cbo_producto.obtenerP()); } else if (int.Parse(Cbo_producto.obtenerU()) < 58 || int.Parse(Cbo_producto.obtenerU()) > 47) { materiales.obtenerPrecio(int.Parse(Cbo_producto.obtenerU()), Txt_precioTotal, prod); codProd = int.Parse(Cbo_producto.obtenerU()); } else { MessageBox.Show("error al encontrar el producto"); } }
void llenarComboProducto() { //llenado de comboBox MEMBRESIA try { Cbo_producto.Items.Clear(); conn.Open(); OdbcCommand command = new OdbcCommand("SELECT `documento_compraenca` FROM `compras_encabezado` WHERE `estado`=1", conn); OdbcDataReader reader = command.ExecuteReader(); while (reader.Read()) { Cbo_producto.Refresh(); //Cbo_membresia.Items.Add(reader.GetValue(0).ToString() + " - " + reader.GetValue(1).ToString()); Cbo_producto.Items.Add(reader.GetValue(0).ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } conn.Close(); }
private void llenarCombos() { Cbo_proveedor.llenarse("proveedores", "id_proveedor", "nombre_proveedor"); Cbo_producto.llenarse("productos", "id_producto", "nombre_producto"); //Cbo_cotizacion.llenarse("cotizaciones_encabezado", "id_cotizacion_encabezado", "nombre_cotizacion"); }