private void personSelector_PersonSelecting(object sender, PersonSelectingEventArgs e) { if (e.Person == null) { return; } if (addNewPanel.Visible) { if (!Dialog.Warn("Are you sure you want to start adding a new reservation?\r\nYou haven't added the reservation you're currently editing yet!")) { e.Cancel = true; return; } } var existingReservation = Program.Table <SeatingReservation>().Rows.FirstOrDefault(sr => sr.Pledge.Date.Year == year && sr.Person == e.Person); if (existingReservation != null) { if (DialogResult.Yes != XtraMessageBox.Show(e.Person.VeryFullName + " already have a reservation for " + existingReservation.TotalSeats + " seats." + "\r\nAre you sure you want to add a second reservation?", "Shomrei Torah Billing", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2)) { e.Cancel = true; } } }
private void personSelector_PersonSelecting(object sender, PersonSelectingEventArgs e) { if (e.Person.Pledges.Any(p => p.Date.Year == year && p.Type == PledgeType)) { Dialog.ShowError(e.Person.FullName + " are already on the Shalach Manos list"); e.Cancel = true; } }
private void personSelector_PersonSelecting(object sender, PersonSelectingEventArgs e) { if (!e.Person.Invitees.Any(i => i.Year == year)) { if (!Dialog.Warn(e.Person.VeryFullName + " has not been invited to the Melave Malka.\r\nAre you sure you selected the correct person?")) { e.Cancel = true; } } }
//TODO: Remove private void person_PersonSelecting(object sender, PersonSelectingEventArgs e) { if (e.Person != person.SelectedPerson && !commit.Visible && DialogResult.No == XtraMessageBox.Show("Are you sure you want to change this payment to be associated with " + e.Person.VeryFullName + "?", "Shomrei Torah Billing", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { e.Cancel = true; } }
private void personSelector_PersonSelecting(object sender, PersonSelectingEventArgs e) { if (e.Method == PersonSelectionReason.Created) { e.Person.Source = Names.JournalPledgeType.Name + " " + year; } else { var otherInvite = e.Person.Invitees.FirstOrDefault(i => i.Year == year); if (otherInvite != null) { e.Cancel = true; Dialog.ShowError(e.Person.VeryFullName + " are already invited by the " + otherInvite.Source + "."); } } }