private void buscarProductos() { tp = StaticsFunctions.buscarServicios(textBox2.Text); if (tp.productos != null) { if (tp.productos.Count > 0) { agregarProductos(); } } }
private void textBox4_KeyUp(object sender, KeyEventArgs e) { StaticsFunctions.manejarEventos(e, this); if (e.KeyCode == Keys.Enter) { tp = StaticsFunctions.buscarProds(textBox4.Text); var list = new BindingList <GVProducto>(mandarProductosGV(tp.productos)); dataGridView2.DataSource = list; reiniciarTextBox(); modificarProducto = false; } }
private void buscarProductos() { tp = StaticsFunctions.buscarProds(textBox1.Text, (int)(comboBox1.SelectedItem as ComboBoxItem).Value); if (tp.productos != null) { if (tp.productos.Count > 0) { agregarProductos(); modificarProductos(); } } }
private void reiniciarGridView() { prs = new List <Producto>(); var list = new BindingList <GVProductoVenta>(mandarProductosGV(prs)); dataGridView1.DataSource = list; textBox4.Text = "0"; textBox7.Text = ""; textBox8.Text = ""; cl = null; ag = null; panel3.Controls.Clear(); tp = StaticsFunctions.tomarServicios(); comboBox1.SelectedIndex = 1; tlp = null; agregarProductos(); }
private void modificarProductosListaPrecio(TomarProductos tomarP) { TomarListaPrecio tomarListaPrecio = StaticsFunctions.tomarListaPrecios(ag); if (tomarListaPrecio.listaPrecio != null) { for (int i = 0; i < tomarListaPrecio.listaPrecio.Count; i++) { for (int j = 0; j < tomarP.productos.Count; j++) { if (tomarP.productos.ElementAt(j).id == tomarListaPrecio.listaPrecio.ElementAt(i).idProducto) { tomarP.productos.ElementAt(j).precio = (float)tomarListaPrecio.listaPrecio.ElementAt(i).precio; } } } } }
private void modificarPrecios() { TomarProductos tomarP = StaticsFunctions.tomarProdsModificarPrecio(); modificarProductosListaPrecio(tomarP); if (prs != null) { for (int i = 0; i < prs.Count; i++) { for (int j = 0; j < tomarP.productos.Count; j++) { if (tomarP.productos.ElementAt(j).id == prs.ElementAt(i).id) { prs.ElementAt(i).precio = tomarP.productos.ElementAt(j).precio; } } } } }
private void button1_Click(object sender, EventArgs e) { if (validarTextBox()) { Producto p = crearProducto(); if (!modificarProducto) { if (StaticsFunctions.enviarProducto(p) == 1) { MessageBox.Show("Agregado", "Producto"); } else { MessageBox.Show("Hubo un problema", "Warning"); } tp = StaticsFunctions.tomarProds(); var list = new BindingList <GVProducto>(mandarProductosGV(tp.productos)); dataGridView2.DataSource = list; if (tp.estado == 1) { reiniciarTextBox(); } } else { if (validarTextBox()) { if (StaticsFunctions.modificarProducto(p) == 1) { //insertarBaseDatos(p); reiniciarTextBox(); reiniciarGridView(); MessageBox.Show("Producto Modificado", "Producto"); } else { MessageBox.Show("Hubo un problema", "Warning"); } } } } }
private void agregarServicio(Producto ser) { if (!modificarServicio) { if (StaticsFunctions.enviarServicio(ser) == 1) { MessageBox.Show("Agregado", "Servicio"); } else { MessageBox.Show("Hubo un problema", "Warning"); } tp = StaticsFunctions.tomarServicios(); var list = new BindingList <GVServicio>(mandarServiciosGV(tp.productos)); dataGridView2.DataSource = list; if (tp.estado == 1) { reiniciarTextBox(); } } else { if (validarTextBox()) { ser.id = this.tp.productos.ElementAt(this.indiceAModificar).id; if (StaticsFunctions.modificarServicio(ser) == 1) { //insertarBaseDatos(p); reiniciarTextBox(); reiniciarGridView(); modificarServicio = false; MessageBox.Show("Servicio Modificado", "Servicio"); } else { MessageBox.Show("Hubo un problema", "Warning"); } } } }
private void cargarProductosDistribuidor() { tp = StaticsFunctions.tomarProductosProveedor(prov.idProveedor); agregarProductos(); }
private void buscarProductos() { tp = StaticsFunctions.buscarProdsProveedor(textBox1.Text, prov.idProveedor); agregarProductos(); }