/// <summary> /// When the client select the work hour that wants to edit the not necessarily labels, tetxboxes and comboboxes are hiding /// from the form and then the neccesarily labels, tetxboxes and comboboxes are pop up. Then fills all the fields with /// the data of the selected work hour. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSelect_Click(object sender, EventArgs e) { LblDays.Show(); LblEndTime.Show(); LblStartTime.Show(); DtpEndTime.Show(); DtpStartTime.Show(); CmbDays.Show(); BtnEdit.Show(); label1.Hide(); CmbWorkHours.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbWorkHours.SelectedValue)); DtpEndTime.Text = SelectedData.Rows[0]["End_Time"].ToString(); DtpStartTime.Text = SelectedData.Rows[0]["Start_Time"].ToString(); CmbDays.DataSource = DCom.GetData("SELECT * FROM days"); CmbDays.DisplayMember = "NAME"; CmbDays.ValueMember = "NAME"; CmbDays.Text = SelectedData.Rows[0]["Day"].ToString(); }