private void btnCheckActiveBookings_Click(object sender, EventArgs e) { grpDJScheduleMatchingDJs.Visible = false; grdDJScheduleDJActiveBookings.AllowUserToAddRows = false; DataSet ds = new DataSet(); //grdDJScheduleDJsActiveBookings.DataSource = DJs.GetAllBookings(ds, txtEnterName.Text.ToUpper()).Tables["Bookings"]; ds = DJs.GetAllBookings(ds, Convert.ToInt32(txtDJID.Text)); grdDJScheduleDJActiveBookings.DataSource = ds.Tables["searchBookings"]; if (grdDJScheduleDJActiveBookings.Rows.Count == 0) { grdDJScheduleDJActiveBookings.Visible = false; grpDJScheduleDJActiveBookings.Visible = false; MessageBox.Show(text: "No active bookings for DJ found."); return; } else { grdDJScheduleDJActiveBookings.Visible = true; } grpDJScheduleDJActiveBookings.Visible = true; grdDJScheduleDJActiveBookings.AllowUserToAddRows = false; }
private void btnCheckActiveBookings_Click(object sender, EventArgs e) { //grpWithdrawDJsActiveBookings.Visible = true; grpWithdrawMatchingDJs.Visible = false; grdWithdrawDJActiveBookings.AllowUserToAddRows = false; DataSet ds = new DataSet(); //grdWithdrawDJsActiveBookings.DataSource = DJs.GetAllBookings(ds, txtEnterName.Text.ToUpper()).Tables["Bookings"]; ds = DJs.GetAllBookings(ds, Convert.ToInt32(txtDJID.Text)); grdWithdrawDJActiveBookings.DataSource = ds.Tables["searchBookings"]; if (grdWithdrawDJActiveBookings.Rows.Count == 0) { grdWithdrawDJActiveBookings.Visible = false; grpWithdrawDJActiveBookings.Visible = false; btnDJWithBookingsWithdrawDJ.Visible = false; btnLegendDJsWithBookingsWithdrawDJ.Visible = false; MessageBox.Show(text: "No active bookings for DJ found."); btnLegendDJsNoBookingsWithdrawDJ.Visible = true; btnDJNoBookingsWithdrawDJ.Visible = true; return; } else { grdWithdrawDJActiveBookings.Visible = true; } grpWithdrawDJActiveBookings.Visible = true; //grdWithdrawDJsActiveBookings.AllowUserToAddRows = false; btnLegendDJsNoBookingsWithdrawDJ.Visible = false; btnDJNoBookingsWithdrawDJ.Visible = false; btnLegendDJsWithBookingsWithdrawDJ.Visible = false; btnDJWithBookingsWithdrawDJ.Visible = false; btnSelectAll.Visible = true; btnDJWithdrawDJPrintBookings.Visible = false; var result = FlexibleMessageBox.Show("Is it the choice of the DJ to withdraw? If so, click 'Yes'." + Environment.NewLine + Environment.NewLine + "If it is the ADMINS choice to withdraw the DJ, click 'No'", "DJ or Admin?", MessageBoxButtons.YesNo); if (result == DialogResult.No) { btnLegendDJsNoBookingsWithdrawDJ.Visible = false; btnDJNoBookingsWithdrawDJ.Visible = false; btnLegendDJsWithBookingsWithdrawDJ.Visible = true; btnDJWithBookingsWithdrawDJ.Visible = false; } else { btnLegendDJsNoBookingsWithdrawDJ.Visible = false; btnDJNoBookingsWithdrawDJ.Visible = false; btnDJWithBookingsWithdrawDJ.Visible = true; btnLegendDJsWithBookingsWithdrawDJ.Visible = false; } }