Exemple #1
0
        private void BtnManageAdd_Click(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.VenueClass venue = new DAL.VenueClass(txtDescription.Text, int.Parse(txtCapacity.Text), int.Parse(txtDoorNo.Text), int.Parse(cmbBuildingBlock.SelectedValue.ToString()), int.Parse(cmbBuilding.SelectedValue.ToString()));
                int            x     = bll.AddVenue(venue);

                if (x > 0)
                {
                    txtDescription.Clear();
                    txtCapacity.Clear();
                    txtDoorNo.Clear();
                    cmbBuildingBlock.Text = "";
                    cmbBuilding.Text      = "";
                }
                else
                {
                    MessageBox.Show("Please input valid data.");
                }
            }
            catch
            {
                MessageBox.Show("Please input valid data.");
            }

            dgvVenue.DataSource = bll.GetVenues();
        }
Exemple #2
0
        protected void btnManageAdd(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.VenueClass venue = new DAL.VenueClass(txtDescription.Text, int.Parse(txtCapacity.Text), int.Parse(txtDoorNumber.Text), int.Parse(cmbBuildingBlocks.SelectedValue.ToString()), int.Parse(cmbBuilding.SelectedValue.ToString()));
                int            x     = bll.AddVenue(venue);

                if (x > 0)
                {
                    txtDescription.Text    = "";
                    txtCapacity.Text       = "";
                    txtDoorNumber.Text     = "";
                    cmbBuildingBlocks.Text = "";
                    cmbBuilding.Text       = "";
                }
                else
                {
                }
            }
            catch
            {
            }

            dgVenue.DataSource = bll.GetVenues();
            dgVenue.DataBind();
        }