Exemplo n.º 1
0
        ///<summary>Raises the PersonSelecting event.</summary>
        ///<returns>False if the event was cancelled.</returns>
        bool RaisePersonSelecting(Person person, PersonSelectionReason method)
        {
            var args = new PersonSelectingEventArgs(person, method);

            OnPersonSelecting(args);
            return(!args.Cancel);
        }
Exemplo n.º 2
0
 ///<summary>Raises the PersonSelecting event.</summary>
 ///<param name="e">A PersonSelectingEventArgs object that provides the event data.</param>
 internal protected virtual void OnPersonSelecting(PersonSelectingEventArgs e)
 {
     if (PersonSelecting != null)
     {
         PersonSelecting(this, e);
     }
 }
Exemplo n.º 3
0
        ///<summary>Raises the ItemSelecting event.</summary>
        protected override void OnItemSelecting(ItemSelectingEventArgs e)
        {
            base.OnItemSelecting(e);
            var args = new PersonSelectingEventArgs((Person)e.NewItem, PersonSelectionReason.ResultClick)
            {
                Cancel = e.Cancel
            };

            OnPersonSelecting(args);
            e.Cancel = args.Cancel;
        }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
 private void pledgeAdder_PersonSelecting(object sender, PersonSelectingEventArgs e)
 {
     if (pledges.Rows.Any(p => p.Person == e.Person)) {
         if (!Dialog.Warn("This ad already has a pledge by " + e.Person.VeryFullName + ".\r\nAre you sure you want to add another one?")) {
             e.Cancel = true;
             return;
         }
     }
     if (e.Method == PersonSelectionReason.ResultClick
      && !e.Person.Invitees.Any(i => i.Year == journal.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;
     }
 }
Exemplo n.º 7
0
 //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;
 }
Exemplo n.º 8
0
 ///<summary>Raises the PersonSelecting event.</summary>
 ///<returns>False if the event was cancelled.</returns>
 bool RaisePersonSelecting(Person person, PersonSelectionReason method)
 {
     var args = new PersonSelectingEventArgs(person, method);
     OnPersonSelecting(args);
     return !args.Cancel;
 }
Exemplo n.º 9
0
 ///<summary>Raises the ItemSelecting event.</summary>
 protected override void OnItemSelecting(ItemSelectingEventArgs e)
 {
     base.OnItemSelecting(e);
     var args = new PersonSelectingEventArgs((Person)e.NewItem, PersonSelectionReason.ResultClick) { Cancel = e.Cancel };
     OnPersonSelecting(args);
     e.Cancel = args.Cancel;
 }
Exemplo n.º 10
0
 ///<summary>Raises the PersonSelecting event.</summary>
 ///<param name="e">A PersonSelectingEventArgs object that provides the event data.</param>
 protected internal virtual void OnPersonSelecting(PersonSelectingEventArgs e)
 {
     if (PersonSelecting != null)
         PersonSelecting(this, e);
 }
Exemplo n.º 11
0
 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 + ".");
         }
     }
 }
Exemplo n.º 12
0
 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;
     }
 }