public override void Synchronize() { base.Synchronize(); this.Text = ""; if (this.Row != null) { DataRowView rowView = this.Row.DataBoundItem as DataRowView; ClientActionType cat = (ClientActionType)rowView.Row["Data"]; if (cat.StartType == ClientActionType.ClientStartType.TIMED_START) { non_timed_option.CheckState = CheckState.Unchecked; timed_option.CheckState = CheckState.Checked; duration.Value = cat.Duration; duration.Visibility = ElementVisibility.Visible; } else if (cat.StartType == ClientActionType.ClientStartType.NON_TIMED_START) { non_timed_option.CheckState = CheckState.Checked; timed_option.CheckState = CheckState.Unchecked; duration.Visibility = ElementVisibility.Hidden; } else { non_timed_option.CheckState = CheckState.Unchecked; timed_option.CheckState = CheckState.Unchecked; duration.Visibility = ElementVisibility.Hidden; } } }
private void NetworkFunction_OnIncommingWaiverInfoList(object sender, EventArgs e) { List <WaiverInfo> lwi = ((WaiverInfoEvent)e).ListWaiverInfo; List <WaiverInfo> updateWaivers = new List <WaiverInfo>(); this.InvokeUI(() => { // determin if update is needed if (lwi != null) { foreach (WaiverInfo wi in lwi) { if (_dtClientList.Select("ID = " + wi.ID).Length == 0) { updateWaivers.Add(wi); } } } // update if (updateWaivers.Count > 0) { _dtClientList.BeginLoadData(); foreach (WaiverInfo wi in updateWaivers) { string cName = wi.FirstName + " " + wi.LastName; int age = Math.Abs((int)Math.Floor(DateTime.Now.Subtract(wi.DOB).TotalDays / 365)); string reference = ""; ClientActionType cat = new ClientActionType(ClientActionType.ClientStartType.NONE, _sessionLength); if (wi.BookingReference != null) { reference = wi.BookingReference.Reference; if (wi.BookingReference.IsTimedTiming) { cat.StartType = ClientActionType.ClientStartType.TIMED_START; cat.Duration = wi.BookingReference.Duration; } else if (wi.BookingReference.IsNonTimedTiming) { cat.StartType = ClientActionType.ClientStartType.NON_TIMED_START; } } _dtClientList.Rows.Add(wi.TimeCreated.ToString("G"), cName, age, reference, "", (wi.BookingReference != null) ? wi.BookingReference.BookingStartTime.ToString("G") : "", cat, wi.ID, false); } _dtClientList.AcceptChanges(); _dtClientList.EndLoadData(); } }); }
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!"); } }