private void buttonaddPro_Click(object sender, EventArgs e) { try { if (textBpro.Text.Equals("")) { throw new QueryError(); } Negocio neg = (Negocio)combobiz.SelectedItem; ConsultaProducto.addPro(neg, textBpro.Text); MessageBox.Show("Producto agregado", "Hugo", MessageBoxButtons.OK); } catch (QueryError) { MessageBox.Show("No se permiten campos vacios", "Hugo", MessageBoxButtons.OK); } catch (Exception) { MessageBox.Show("Ha ocurrido un error", "Hugo", MessageBoxButtons.OK); } textBpro.Clear(); cargarAdmin(); }
public static void deletebiz(Negocio neg) { var sql = string.Format("DELETE FROM BUSINESS WHERE idBusiness = {0}", neg.idneg); ConnectionDB.ExecuteNonQuery(sql); }