Beispiel #1
0
 /// <remarks/>
 public void SetCustomerSiteAsync(SetCustomerSiteRequest SetCusotmerSiteRequest, object userState) {
     if ((this.SetCustomerSiteOperationCompleted == null)) {
         this.SetCustomerSiteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetCustomerSiteOperationCompleted);
     }
     this.InvokeAsync("SetCustomerSite", new object[] {
                 SetCusotmerSiteRequest}, this.SetCustomerSiteOperationCompleted, userState);
 }
Beispiel #2
0
 /// <remarks/>
 public void SetCustomerSiteAsync(SetCustomerSiteRequest SetCusotmerSiteRequest) {
     this.SetCustomerSiteAsync(SetCusotmerSiteRequest, null);
 }
        public void DeleteCustomerSite(int CustomerID)
        {
            var request = new SetCustomerSiteRequest();

            request.CustomerID = CustomerID;
            request.WebAlias = "Deleted-" + DateTime.Now.ToString("yyyyMMddhhmmssfff");

            var response = GetContext().SetCustomerSite(request);
        }
        public void UpdateCustomerSite(CustomerSite CustomerSite)
        {
            // First, get the existing customer site.
            var existingCustomerSite = GetContext().GetCustomerSite(new GetCustomerSiteRequest
            {
                CustomerID = CustomerSite.CustomerID
            });
            if(existingCustomerSite == null) existingCustomerSite = new GetCustomerSiteResponse();

            // Now, save the information.
            var request = new SetCustomerSiteRequest();

            request.CustomerID = CustomerSite.CustomerID;
            request.WebAlias = CustomerSite.WebAlias ?? existingCustomerSite.WebAlias;
            request.FirstName = CustomerSite.FirstName ?? existingCustomerSite.FirstName;
            request.LastName = CustomerSite.LastName ?? existingCustomerSite.LastName;
            request.Company = CustomerSite.Company ?? existingCustomerSite.Company;
            request.Email = CustomerSite.Email ?? existingCustomerSite.Email;
            request.Phone = CustomerSite.Phone ?? existingCustomerSite.Phone;
            request.Phone2 = CustomerSite.Phone2 ?? existingCustomerSite.Phone;
            request.Fax = CustomerSite.Fax ?? existingCustomerSite.Fax;
            request.Notes1 = CustomerSite.Notes1 ?? existingCustomerSite.Notes1;
            request.Notes2 = CustomerSite.Notes2 ?? existingCustomerSite.Notes2;
            request.Notes3 = CustomerSite.Notes3 ?? existingCustomerSite.Notes3;
            request.Notes4 = CustomerSite.Notes4 ?? existingCustomerSite.Notes4;
            request.Address1 = CustomerSite.Address.Address1 ?? existingCustomerSite.Address1;
            request.Address2 = CustomerSite.Address.Address2 ?? existingCustomerSite.Address2;
            request.City = CustomerSite.Address.City ?? existingCustomerSite.City;
            request.State = CustomerSite.Address.State ?? existingCustomerSite.State;
            request.Zip = CustomerSite.Address.Zip ?? existingCustomerSite.Zip;
            request.Country = CustomerSite.Address.Country ?? existingCustomerSite.Country;

            var response = GetContext().SetCustomerSite(request);
        }
        public void CreateCustomerSite(CustomerSite CustomerSite)
        {
            var request = new SetCustomerSiteRequest();

            request.CustomerID = CustomerSite.CustomerID;
            request.WebAlias = CustomerSite.WebAlias;
            request.FirstName = CustomerSite.FirstName;
            request.LastName = CustomerSite.LastName;
            request.Company = CustomerSite.Company;
            request.Email = CustomerSite.Email;
            request.Phone = CustomerSite.Phone;
            request.Phone2 = CustomerSite.Phone2;
            request.Fax = CustomerSite.Fax;
            request.Notes1 = CustomerSite.Notes1;
            request.Notes2 = CustomerSite.Notes2;
            request.Notes3 = CustomerSite.Notes3;
            request.Notes4 = CustomerSite.Notes4;
            if(CustomerSite.Address != null)
            {
                request.Address1 = CustomerSite.Address.Address1;
                request.Address2 = CustomerSite.Address.Address2;
                request.City = CustomerSite.Address.City;
                request.State = CustomerSite.Address.State;
                request.Zip = CustomerSite.Address.Zip;
                request.Country = CustomerSite.Address.Country;
            }

            var response = GetContext().SetCustomerSite(request);
        }