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

            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
                };

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

            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
                };

                CdsaManager.AddContact(newContact);
            }
        }