Example #1
0
        private void RefreshControl2()
        {
            List <Business> list = BusinessDAO.getLista();

            dgvBusiness.DataSource = null;
            dgvBusiness.DataSource = list;

            cmbBusinessName.DataSource    = null;
            cmbBusinessName.ValueMember   = "idbusiness";
            cmbBusinessName.DisplayMember = "name";
            cmbBusinessName.DataSource    = list;
        }
Example #2
0
        private void btnDeleteBusiness_Click(object sender, EventArgs e)
        {
            if (txtDeleteBusiness.Text.Length >= 5)
            {
                BusinessDAO.DeleteBusiness(txtDeleteBusiness.Text);

                MessageBox.Show("Negocio eliminado exitosamente!", "HUGO DELIVERY", MessageBoxButtons.OK, MessageBoxIcon.Information);

                txtDeleteBusiness.Clear();
            }
            else
            {
                MessageBox.Show("Error al eliminar el negocio!, intentelo más tarde", "HUGO DELIVERY",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
        private void btnAddBusiness_Click(object sender, EventArgs e)
        {
            if (txtAddBusiness.Text.Length >= 5)
            {
                BusinessDAO.AddBusiness(txtAddBusiness.Text, txtDescriptionBusiness.Text);

                MessageBox.Show("Negocio agregado exitosamente!", "HUGO DELIVERY", MessageBoxButtons.OK, MessageBoxIcon.Information);

                txtAddBusiness.Clear();
                txtDescriptionBusiness.Clear();
                RefreshControl2();
            }
            else
            {
                MessageBox.Show("Error al agregar el negocio!, intentelo más tarde", "HUGO DELIVERY",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }