public static void Main(string[] args) { _client = new OrangeLeapClient(); EstablishConnection(); var donor = new Pocos.Donor(); var donation = new Pocos.Donation(); InitObjects(ref donation, ref donor); //var constt = CreateConstituentWithAllProperties(donor); //Console.WriteLine("created const! id: " + constt.id.ToString()); //Console.ReadLine(); var constt = Find(4618); AddGiftToConstituent(donation, ref constt); //UpdateConstituent(donor, ref constt, "Just adding a test note, b/c i'm testing!"); //var donors = Find(donor, true, true, false, false, false); //constituent constt; //if (donors.Any()) //{ // if (donors.Count == 1) // { // constt = donors.First(); // UpdateConstituent(donor, ref constt); // } // else // { // switch (_howToHandleOverMatch) // { // case Enum_HowToHandleOverMatch.Use_Oldest_Record: // constt = donors.OrderBy(x => x.updateDate).First(); // UpdateConstituent(donor, ref constt); // break; // case Enum_HowToHandleOverMatch.Use_Newest_Record: // constt = donors.OrderByDescending(x => x.updateDate).First(); // UpdateConstituent(donor, ref constt); // break; // case Enum_HowToHandleOverMatch.Create_New_Record: // constt = CreateConstituentWithAllProperties(donor); // break; // case Enum_HowToHandleOverMatch.Create_New_Record_And_Be_Notified: // constt = CreateConstituentWithAllProperties(donor); // break; // default: // throw new ArgumentOutOfRangeException(); // } // } //} //else //{ // //create new donor // constt = CreateConstituentWithAllProperties(donor); //} }
public static void InitObjects(ref Donation donation, ref Donor donor) { donor = new Pocos.Donor { FName = "Sally" + NewRandom(5), LName = "Sues" + NewRandom(5), Phone = "(972) 220-1234", Email = "Sally" + NewRandom(5) + "@email.com", NesletterOptIn = true, }; donor.DonorAddresses.Add(CreateDonorAddress(Enum_AddressType.Billing, donor)); donor.DonorAddresses.Add(CreateDonorAddress(Enum_AddressType.Shipping, donor)); CreateDonation(ref donation, ref donor); }
protected static DonationAddress CreateAddress(Enum_AddressType type, Pocos.Donor d) { var add = new Pocos.DonationAddress { Address1 = "a123 Plaza Way", AddressType = type, City = "Dallas", State = "TX", Zip = "75287", Country = LookupCountryCodeFromPickList("us"), FName = d.FName, LName = d.LName, Email = d.Email, Phone = d.Phone }; return(add); }