Interaction logic for CreateMoneyDonation.xaml
Inheritance: System.Windows.Window
コード例 #1
0
        private void AddNewDonation(object sender, RoutedEventArgs e)
        {
            CreateMoneyDonation cmd = new CreateMoneyDonation(DonorID, false, -1);

            cmd.ShowDialog();

            Refresh_DonationGrid(sender, e);
        }
コード例 #2
0
        private void Continue(object sender, RoutedEventArgs e)
        {
            Models.FCS_DBModel db = new Models.FCS_DBModel();
            //Then its an organization
            if (OrgOrIndividual.IsChecked.Value && Organization.SelectedIndex != -1)
            {
                string Organiz = Organization.SelectedValue.ToString();
                var donorID = (from d in db.Donors
                                where d.OrganizationName == Organiz
                                select d.DonorID).Distinct().First();

                CreateMoneyDonation cmd = new CreateMoneyDonation(donorID, true, EventID);
                cmd.ShowDialog();
                this.Close();

            }
            //then its an individual
            else if (Individual.SelectedIndex != -1)
            {
                string[] separators = new string[] { ", " };
                string Indiv = Individual.SelectedValue.ToString();
                string[] words = Indiv.Split(separators, StringSplitOptions.None);
                string FName = words[0]; string LName = words[1]; string FNumber = words[2];
                var donorID = (from dc in db.DonorContacts
                               join d in db.Donors on dc.DonorID equals d.DonorID
                               where dc.ContactFirstName == FName && dc.ContactLastName == LName && dc.ContactPhone == FNumber
                               && (d.DonorType == "Individual" || d.DonorType == "Anonymous")
                               select dc.DonorID).Distinct().FirstOrDefault();

                CreateMoneyDonation cmd = new CreateMoneyDonation(donorID, true, EventID);
                cmd.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Make sure to select an organization or an individual");
                return;
            }

		}
コード例 #3
0
        private void Continue(object sender, RoutedEventArgs e)
        {
            Models.FCS_DBModel db = new Models.FCS_DBModel();
            //Then its an organization
            if (OrgOrIndividual.IsChecked.Value && Organization.SelectedIndex != -1)
            {
                string Organiz = Organization.SelectedValue.ToString();
                var    donorID = (from d in db.Donors
                                  where d.OrganizationName == Organiz
                                  select d.DonorID).Distinct().First();

                CreateMoneyDonation cmd = new CreateMoneyDonation(donorID, true, EventID);
                cmd.ShowDialog();
                this.Close();
            }
            //then its an individual
            else if (Individual.SelectedIndex != -1)
            {
                string[] separators = new string[] { ", " };
                string   Indiv = Individual.SelectedValue.ToString();
                string[] words = Indiv.Split(separators, StringSplitOptions.None);
                string   FName = words[0]; string LName = words[1]; string FNumber = words[2];
                var      donorID = (from dc in db.DonorContacts
                                    join d in db.Donors on dc.DonorID equals d.DonorID
                                    where dc.ContactFirstName == FName && dc.ContactLastName == LName && dc.ContactPhone == FNumber &&
                                    (d.DonorType == "Individual" || d.DonorType == "Anonymous")
                                    select dc.DonorID).Distinct().FirstOrDefault();

                CreateMoneyDonation cmd = new CreateMoneyDonation(donorID, true, EventID);
                cmd.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Make sure to select an organization or an individual");
                return;
            }
        }
コード例 #4
0
 private void AddNewDonation(object sender, RoutedEventArgs e)
 {
     CreateMoneyDonation cmd = new CreateMoneyDonation(DonorID, false, -1);
     cmd.ShowDialog();
     
     Refresh_DonationGrid(sender, e);
 }