private void BtnSelect_Click(object sender, EventArgs e) { LblBusinessDescription.Show(); LblBusinessName.Show(); LblCategory.Show(); LblPrice.Show(); LblRating.Show(); LblTelephone.Show(); LblUser.Show(); LblWebsite.Show(); LblWorkHours.Show(); LblBusinessType.Show(); LblLocation.Show(); TbxBusinessName.Show(); TbxCategory.Show(); TbxDescription.Show(); TbxPrice.Show(); TbxRating.Show(); TbxTelephone.Show(); TbxWebsite.Show(); CmbLocation.Show(); CmbTypes.Show(); CmbUser.Show(); CmbWorkHours.Show(); ChbReservation.Show(); BtnEdit.Show(); LblSelect.Hide(); CmbBusinesses.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbBusinesses.SelectedValue)); TbxBusinessName.Text = (string)SelectedData.Rows[0]["Business_Name"]; TbxCategory.Text = (string)SelectedData.Rows[0]["Category"]; TbxDescription.Text = (string)SelectedData.Rows[0]["Description"]; TbxPrice.Text = SelectedData.Rows[0]["Price_Range"].ToString(); TbxRating.Text = (string)SelectedData.Rows[0]["Rating"].ToString(); TbxTelephone.Text = (string)SelectedData.Rows[0]["Telephone"]; TbxWebsite.Text = (string)SelectedData.Rows[0]["Website"]; CmbLocation.DataSource = DCom.GetData("SELECT ID,CONCAT(Address_Name, ', ', Address_Number) AS NAME FROM location"); CmbLocation.DisplayMember = "NAME"; CmbLocation.ValueMember = "ID"; CmbTypes.DataSource = DCom.GetData("SELECT * FROM businesses_types"); CmbTypes.DisplayMember = "Type"; CmbTypes.ValueMember = "Type"; CmbUser.DataSource = DCom.GetData("SELECT * FROM users"); CmbUser.DisplayMember = "Username"; CmbUser.ValueMember = "Username"; CmbWorkHours.DataSource = DCom.GetData("SELECT * FROM work_hours"); CmbWorkHours.DisplayMember = "ID"; CmbWorkHours.ValueMember = "ID"; }
void ReleaseDesignerOutlets() { if (LblDate != null) { LblDate.Dispose(); LblDate = null; } if (LblDuration != null) { LblDuration.Dispose(); LblDuration = null; } if (LblPrice != null) { LblPrice.Dispose(); LblPrice = null; } if (LblTime != null) { LblTime.Dispose(); LblTime = null; } if (LblVenue != null) { LblVenue.Dispose(); LblVenue = null; } }
public EdiBusinessForm() { InitializeComponent(); LblBusinessDescription.Hide(); LblBusinessName.Hide(); LblCategory.Hide(); LblPrice.Hide(); LblRating.Hide(); LblTelephone.Hide(); LblUser.Hide(); LblWebsite.Hide(); LblWorkHours.Hide(); LblBusinessType.Hide(); LblLocation.Hide(); TbxBusinessName.Hide(); TbxCategory.Hide(); TbxDescription.Hide(); TbxPrice.Hide(); TbxRating.Hide(); TbxTelephone.Hide(); TbxWebsite.Hide(); CmbLocation.Hide(); CmbTypes.Hide(); CmbUser.Hide(); CmbWorkHours.Hide(); ChbReservation.Hide(); BtnEdit.Hide(); CmbBusinesses.DataSource = DCom.GetData("SELECT businesses.ID, CONCAT(businesses.Business_Name, ', ', location.Address_Name, ', ', location.Municipality) AS NAME FROM businesses, location WHERE businesses.Location_ID = location.ID"); CmbBusinesses.DisplayMember = "NAME"; CmbBusinesses.ValueMember = "ID"; }