private void Comboload() { // Actualizar ComboBox cmbDeleteCommerce.DataSource = null; cmbDeleteCommerce.ValueMember = "idBusiness"; cmbDeleteCommerce.DisplayMember = "name"; cmbDeleteCommerce.DataSource = NegocioDAO.Userslist(); }
private void Comboload1(int id) { // Actualizar ComboBox cmbProducts.DataSource = null; cmbProducts.ValueMember = "idProduct"; cmbProducts.DisplayMember = "name"; cmbProducts.DataSource = NegocioDAO.Productslist(id); }
private void button6_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Desea eliminar el negocio ? " + comboBox3.Text , "HUGO APP", MessageBoxButtons.YesNo) == DialogResult.Yes) { NegocioDAO.eliminarNegocio(comboBox3.Text); MessageBox.Show("El negocio ha sido eliminado!", "HUGO APP"); actualizarControlesN(); } }
private void actualizarControlesP() { List<Producto> lista = ProductoDAO.getLista(); comboBox5.DataSource = null; comboBox5.ValueMember = "idproduct"; comboBox5.DisplayMember = "name"; comboBox5.DataSource = lista; dataGridView4.DataSource = null; dataGridView4.DataSource = lista; comboBox4.DataSource = null; comboBox4.ValueMember = "idbusiness"; comboBox4.DisplayMember = "name"; comboBox4.DataSource = NegocioDAO.getLista(); }
public static List <NegocioDAO> getNegociosTabla() { string sql = "SELECT *FROM BUSINESS"; DataTable dt = Conexion.realizarConsulta(sql); List <NegocioDAO> lista = new List <NegocioDAO>(); foreach (DataRow fila in dt.Rows) { NegocioDAO u = new NegocioDAO(); u.idbusiness = Convert.ToInt32(fila[0].ToString()); u.name = fila[1].ToString(); u.description = fila[2].ToString(); lista.Add(u); } return(lista); }
private void button5_Click(object sender, EventArgs e) { try { if (textBox5.Text.Length >= 4) { NegocioDAO.crearNegocio(textBox5.Text, textBox6.Text); MessageBox.Show("¡Negocio agregado exitosamente!", "HUGO APP"); textBox5.Clear(); textBox6.Clear(); actualizarControlesN(); } else MessageBox.Show("Por favor digite un negocio con longitud minima de 4)", "HUGO APP", MessageBoxButtons.OK); } catch (Exception) { MessageBox.Show("Algo salio mal...", "HUGO APP", MessageBoxButtons.OK); } }