public void SendCustomers() { var customers = DaoController.Current.GetNewCustomers(); POSMng.POSMng pc = new POSMng.POSMng { UseDefaultCredentials = false, Credentials = new System.Net.NetworkCredential(PosSetting.Settings_DomainUserName, PosSetting.Settings_DomainPassword, PosSetting.Settings_DomainName), Url = PosSetting.Settings_PosServiceUrl }; foreach (var customer in customers) { var newCode = pc.CreateNewCustomerNew(customer.Name, customer.VATRegistrationNo_, customer.NeedsVATInvoice.Value, customer.Contact, NullToEmpty(customer.PhoneNo_), NullToEmpty(customer.Address), NullToEmpty(customer.ShipToAddress), NullToEmpty(customer.City), NullToEmpty(customer.Country_RegionCode), PosSetting.Settings_SalesPersonCode, NullToEmpty(customer.PostCode), customer.Mobile_, NullToEmpty(customer.AreaCode), customer.Customer_Posting_Group); DaoController.Current.UpdateCustomerStatus(customer.No_, newCode); } }