private void textBox3_TextChanged(object sender, EventArgs e) { try { string campo = "Descripcion"; DAO.CatalogosDAO catalogosdao = new EquimarFac.DAO.CatalogosDAO(); DataView dv = new DataView(catalogosdao.devuelveProductos()); dv.RowFilter = campo + " like '%" + textBox3.Text + "%'"; dataGridView2.DataSource = dv; } catch { } }
public string descargainventarios() { try { foreach (DataGridViewRow row in dataGridView1.Rows) { decimal descarga = decimal.Parse(row.Cells[4].Value.ToString()); DAO.CatalogosDAO catalogosdao = new EquimarFac.DAO.CatalogosDAO(); catalogosdao.IDProducto = int.Parse(row.Cells[6].Value.ToString()); catalogosdao.Cantidad = -descarga; catalogosdao.modificaexistencias(); } return("Correcto"); } catch (Exception ex) { return(ex.ToString()); } }
private void button3_Click_1(object sender, EventArgs e) { try { if ((textBox6.Text != "") && (textBox7.Text != "") && (textBox8.Text != "")) { DAO.CatalogosDAO catalogosdao = new EquimarFac.DAO.CatalogosDAO(); catalogosdao.Descripcion = textBox6.Text; catalogosdao.idproveedor = int.Parse("100"); catalogosdao.Presentacion = textBox7.Text; catalogosdao.Precio = Decimal.Parse(textBox8.Text); catalogosdao.Cantidad = 0; catalogosdao.Inventariable = 1; string resultado = catalogosdao.insertaProductos(); if (resultado != "Correcto") { MessageBox.Show(resultado); } else { actualizagrid2(); textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; } } else { MessageBox.Show("Es necesario escribir los datos minimos primero"); } } catch (Exception ex) { MessageBox.Show("Error: " + ex); } }