コード例 #1
0
        private void radButtonPrintNow_Click(object sender, EventArgs e)
        {
            string question = "Are you sure you want to print (" + radSpinEditorNumPrint.Value.ToString() + ") "
                              + (radRadioButtonTimed.CheckState == CheckState.Checked ? "TIMED" : "NON-TIMED")
                              + " session ticket?";

            if (radRadioButtonTimed.CheckState == radRadioButtonNonTimed.CheckState || radSpinEditorNumPrint.Value == 0)
            {
                this.ShowAlertBox("Barcode Generation", "Please make your choice!");
            }
            else
            {
                DialogResult dr = RadMessageBox.Show(this, string.Format(question), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    BarcodeInfo bInfo = new BarcodeInfo();

                    for (int i = 0; i < radSpinEditorNumPrint.Value; i++)
                    {
                        BarcodeItem bItem = new BarcodeItem()
                        {
                            IsPrintingTicket = true,
                            Minutes          = (radRadioButtonTimed.CheckState == CheckState.Checked ? (int)radSpinEditorSessionTime.Value : 0),
                            CustomerName     = ""
                        };

                        bInfo.BarcodeItems.Add(bItem);
                    }

                    NetworkFunction.GenerateBarcode(bInfo);

                    Close();
                }
            }
        }
コード例 #2
0
        private void radButtonPrintTicket_Click(object sender, EventArgs e)
        {
            DialogResult dr = DialogResult.None;

            if (radListViewClientList.CheckedItems.Count > 0)
            {
                if (OptionSelectedValidate())
                {
                    if (!OptionTimeValidate())
                    {
                        dr = RadMessageBox.Show(this, string.Format("One or more check-ins failed appointment time validation. Is the customer late or too early (e.g. Earlier than 60 minutes to game start)? " + Environment.NewLine + Environment.NewLine + " Do you want to override this error?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);
                    }

                    if (dr == DialogResult.None || dr == DialogResult.Yes)
                    {
                        dr = RadMessageBox.Show(this, string.Format("Are you sure you want to print ({0}) tickets?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                        if (dr == DialogResult.Yes)
                        {
                            BarcodeInfo bInfo = new BarcodeInfo();
                            //List<WaiverInfo> listWaiverInfo = new List<WaiverInfo>();

                            foreach (ListViewDataItem item in radListViewClientList.CheckedItems)
                            {
                                ClientActionType cat = ((DataRowView)item.DataBoundItem)["Data"] as ClientActionType;

                                string clientName = ((DataRowView)item.DataBoundItem)["ClientName"].ToString();

                                BarcodeItem bItem = new BarcodeItem()
                                {
                                    IsPrintingTicket = true,
                                    Minutes          = (cat.StartType == ClientActionType.ClientStartType.TIMED_START ? cat.Duration : 0),
                                    CustomerName     = clientName,
                                    BookingReference = (string)((DataRowView)item.DataBoundItem)["Reference"],
                                    WaiverLogID      = (int)((DataRowView)item.DataBoundItem)["ID"]
                                };

                                bInfo.BarcodeItems.Add(bItem);

                                /*listWaiverInfo.Add(new WaiverInfo()
                                 * {
                                 *  ID = (int)((DataRowView)item.DataBoundItem)["ID"],
                                 *  BookingReference = new BookingReference()
                                 *  {
                                 *      Reference = (string)((DataRowView)item.DataBoundItem)["Reference"]
                                 *  }
                                 *
                                 * });*/
                            }

                            //NetworkFunction.MarkWaiverReceived(listWaiverInfo);

                            NetworkFunction.GenerateBarcode(bInfo);

                            Close();
                        }
                    }
                }
                else
                {
                    this.ShowAlertBox("Waiver Process", "One or more selected item does not have option picked! Booking reference not found!");
                }
            }
            else
            {
                this.ShowAlertBox("Waiver Process", "Please select at least one client to continue!");
            }
        }