Beispiel #1
0
        private void grdChangeBookingActiveBookings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //this is checking if the amount of rows in the grdChangeBookingActiveDJs is greater than 0
            if (grdChangeBookingActiveBookings.SelectedRows.Count > 0)
            {
                string DJID      = grdChangeBookingActiveBookings.SelectedRows[0].Cells[3].Value + string.Empty;
                string ServiceID = grdChangeBookingActiveBookings.SelectedRows[0].Cells[4].Value + string.Empty;
                string EventDate = grdChangeBookingActiveBookings.SelectedRows[0].Cells[0].Value + string.Empty;
                string BookingID = grdChangeBookingActiveBookings.SelectedRows[0].Cells[2].Value + string.Empty;
                string Location  = grdChangeBookingActiveBookings.SelectedRows[0].Cells[8].Value + string.Empty;
                string Eircode   = grdChangeBookingActiveBookings.SelectedRows[0].Cells[9].Value + string.Empty;

                dtpEventDate.Text = EventDate;

                txtDJID.Text = DJID;

                txtServiceID.Text = ServiceID;

                txtBookingID.Text = BookingID;

                if (!ValidateData.isValidDate28(dtpEventDate.Value))

                {
                    //Reference for message box options https://www.functionx.com/vb/functions/msgbox.htm
                    DialogResult dialog = MessageBox.Show("Sorry, booking cannot be changed less than 28 days before the event date. \n\nWould you like to choose another booking?", "Error",
                                                          MessageBoxButtons.YesNo, MessageBoxIcon.Error);

                    if (dialog == DialogResult.No)
                    {
                        // parent.Show();
                        // this.Dispose()
                        parent.Show();
                        this.Dispose();
                    }

                    else
                    {
                        grdChangeBookingActiveBookings.Select();
                    }

                    return;
                }

                grdChangeBookingActiveServices.Visible            = true;
                grpChangeBookingActiveServices.Visible            = true;
                grdChangeBookingActiveServices.AllowUserToAddRows = false;

                DataSet ds         = new DataSet();
                string  Service_ID = null;
                //grChangeBookingActiveServices.DataSource = Bookings.GetAllActiveServices(ds, txtEnterName.Text.ToUpper()).Tables["Services"];
                ds = Bookings.GetAllActiveServices(ds, Service_ID);
                grdChangeBookingActiveServices.DataSource = ds.Tables["searchActiveServices"];

                txtServiceID.Select();
            }
        }
Beispiel #2
0
        private void grdMakeBookingMatchingClients_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            grpMakeBookingMatchingClients.Visible = true;

            //this is checking if the amount of rows in the grdMakeBookingMatchingClients is greater than 0
            if (grdMakeBookingMatchingClients.SelectedRows.Count > 0)
            {
                String ClientID = grdMakeBookingMatchingClients.SelectedRows[0].Cells[0].Value + string.Empty;

                txtClientID.Text = ClientID;

                DataSet ds         = new DataSet();
                string  Service_ID = null;
                //grdMakeBookingActiveServices.DataSource = Bookings.GetAllActiveServices(ds, txtEnterName.Text.ToUpper()).Tables["Services"];
                ds = Bookings.GetAllActiveServices(ds, Service_ID);
                grdMakeBookingActiveServices.DataSource = ds.Tables["searchActiveServices"];

                grdMakeBookingActiveServices.Visible       = true;
                grpMakeBookingActiveServices.Visible       = true;
                grdMakeBookingActiveDJs.AllowUserToAddRows = false;
            }
        }