コード例 #1
0
 private void btnMain_Click(object sender, EventArgs e)
 {
     // parent.Show();
     // this.Dispose()
     parent.Show();
     this.Dispose();
 }
コード例 #2
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     parent.Show();
     this.Dispose();
 }
コード例 #3
0
        private void btnClientWithBookingsWithdrawClient_Click(object sender, EventArgs e)
        {
            btnLegendDJsWithBookingsWithdrawClient.Visible = false;
            btnClientWithBookingsWithdrawClient.Visible    = false;

            String ClientID = txtClientID.Text;

            DataTable dt = new DataTable();

            dt = Client.GetWithdrawalTotalCost(dt, ClientID);

            decimal TotalOriginalCost;

            //decimal TotalRefundDue;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                TotalOriginalCost         = Convert.ToDecimal(dt.Rows[i][1].ToString());
                txtOriginalTotalCost.Text = TotalOriginalCost.ToString("N2");
            }

            //grpWithdrawClienActiveBookings.Visible = true;
            grpWithdrawMatchingClients.Visible = false;
            grdWithdrawClientActiveBookings.AllowUserToAddRows = false;
            btnLegendDJsWithBookingsWithdrawClient.Visible     = false;

            DataSet ds = new DataSet();

            //grdWithdrawClientActiveBookings.DataSource = Client.GetAllBookings(ds, txtEnterName.Text.ToUpper()).Tables["Bookings"];
            ds = Client.GetAllActiveBookingsbyClientID(ds, Convert.ToInt32(txtClientID.Text));
            grdWithdrawClientActiveBookings.DataSource = ds.Tables["searchActiveBookingsByClientID"];

            //reference fellow student Carraig McNulty for help with foreach loop to declare array

            string message = "";
            int    count   = 0;

            foreach (DataRow row in ds.Tables["searchActiveBookingsByClientID"].Rows)
            {
                String tablerow = "Event Date:          " + " " + row[2].ToString() + "\n" +
                                  "Start Time:           " + " " + row[3].ToString() + "\n" +
                                  "End Time:             " + " " + row[4].ToString() + "\n" +
                                  "Location:              " + " " + row[6].ToString() + "\n" +
                                  "Eircode:                " + " " + row[7].ToString() + "\n" +
                                  "Total Cost:           " + " " + "€" + row[8].ToString() + "\n" +
                                  "Payment Status:  " + " " + row[9].ToString() + "\n\n"
                ;
                message += tablerow;
                count++;
            }

            //Reference for a flexible message box which enables the message box to scroll to see all text.  The standard message box inside Visual Studio cannot display a lot of text by default.
            //https://www.codeproject.com/Articles/601900/FlexibleMessageBox-A-Flexible-Replacement-for-the

            FlexibleMessageBox.Show(text:
                                    Environment.NewLine + Environment.NewLine +
                                    "Dear " + txtForename.Text + "," +
                                    Environment.NewLine + Environment.NewLine +
                                    "Please find below, a list of remaining bookings to be fulfilled before we can confirm your withdrawal." +
                                    Environment.NewLine + Environment.NewLine +
                                    "In accordance with our terms and conditions on cancellations, you may not be entitled to refunds on all bookings." +
                                    Environment.NewLine + Environment.NewLine +
                                    Environment.NewLine + Environment.NewLine +
                                    (message) +
                                    Environment.NewLine + Environment.NewLine +
                                    Environment.NewLine + Environment.NewLine +
                                    "The total cost of your remaining bookings amounts to: €" + Convert.ToDecimal(txtOriginalTotalCost.Text) +
                                    Environment.NewLine + Environment.NewLine +
                                    "The total refund due to you will be: €" + Convert.ToDecimal(txtTotalRefundDue.Text));

            var result =
                FlexibleMessageBox.Show("Would you like to cancel all bookings and be withdrawn from Legend DJs' system?", "Confirm?", MessageBoxButtons.YesNo);

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

            else
            {
                FlexibleMessageBox.Show("*****ADMIN - PLEASE PRESS 'CALCULATE REFUND DUE' AGAIN FOR EACH BOOKING BEFORE PRINTING INVOICE*****", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            btnWithdrawClientPrintInvoice.Visible          = true;
            btnWithdrawClientPrintInvoiceLegendDJs.Visible = false;
        }