Exemple #1
0
        public static async Task AddAccounts(int AccountCount)
        {
            IEnumerable <CustomerData> customers = RandomCustomerGenerator.GetCustomerList(AccountCount, false);

            foreach (CustomerData customer in customers)
            {
                Account newAccount = new Account {
                    name       = customer.Company,
                    telephone1 = customer.WorkPhone,
                    address1_primarycontactname = customer.FirstName + " " + customer.LastName,
                    address1_line1           = customer.Address,
                    address1_city            = customer.City,
                    address1_stateorprovince = customer.State,
                    address1_postalcode      = customer.ZipCode
                };

                await CdsaManager.AddAccount(newAccount);
            }
        }
Exemple #2
0
        public static async Task AddContacts(int CustomerCount)
        {
            IEnumerable <CustomerData> customers = RandomCustomerGenerator.GetCustomerList(CustomerCount, false);

            foreach (CustomerData customer in customers)
            {
                Contact newContact = new Contact {
                    firstname                = customer.FirstName,
                    lastname                 = customer.LastName,
                    emailaddress1            = customer.EmailAddress,
                    company                  = customer.Company,
                    telephone1               = customer.WorkPhone,
                    mobilephone              = customer.HomePhone,
                    address1_line1           = customer.Address,
                    address1_city            = customer.City,
                    address1_stateorprovince = customer.State,
                    address1_postalcode      = customer.ZipCode
                };

                await CdsaManager.AddContact(newContact);
            }
        }