/// <remarks/> public void GetCustomerExtendedAsync(GetCustomerExtendedRequest GetCustomerExtendedRequest) { this.GetCustomerExtendedAsync(GetCustomerExtendedRequest, null); }
/// <remarks/> public void GetCustomerExtendedAsync(GetCustomerExtendedRequest GetCustomerExtendedRequest, object userState) { if ((this.GetCustomerExtendedOperationCompleted == null)) { this.GetCustomerExtendedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCustomerExtendedOperationCompleted); } this.InvokeAsync("GetCustomerExtended", new object[] { GetCustomerExtendedRequest}, this.GetCustomerExtendedOperationCompleted, userState); }
EventConfirmation IEventService.EditEvent(Common.ModelsEx.Event.EventBooking eventBooking) { var confirmation = new EventConfirmation(); TransactionalResponse result = null; try { var requests = new List <ApiRequest>(); // Need to create customer if new party customer if (eventBooking.Customer.CustomerID != 0) { // TODO: gwb:20150111 - Need clarification which fields can be updated for a party // Right now, updating party location var updateCustomerRequest = new UpdateCustomerRequest { CustomerID = eventBooking.Customer.CustomerID, FirstName = eventBooking.Customer.FirstName, LastName = eventBooking.Customer.LastName, MainAddress1 = eventBooking.Customer.MainAddress.Address1, MainAddress2 = eventBooking.Customer.MainAddress.Address2, MainCity = eventBooking.Customer.MainAddress.City, MainState = eventBooking.Customer.MainAddress.State, MainZip = eventBooking.Customer.MainAddress.Zip, MainCountry = eventBooking.Customer.MainAddress.Country }; requests.Add(updateCustomerRequest); } else { throw new ApplicationException("Cannot call EditEvent for a new event. Call CreateEvent instead."); } var setCustomerSiteRequest = new SetCustomerSiteRequest(eventBooking.CustomerSite); requests.Add(setCustomerSiteRequest); var getCustomerExtendedRequest = new GetCustomerExtendedRequest() { CustomerID = eventBooking.Customer.CustomerID, ExtendedGroupID = (int)CustomerExtendedGroup.PartyDetails // Party Extended Fields }; var getCustomerExtendedResponse = Exigo.GetCustomerExtendedDetails(eventBooking.Customer.CustomerID, (int)CustomerExtendedGroup.PartyDetails).FirstOrDefault(); var updateCustomerExtendedRequest = new UpdateCustomerExtendedRequest() { CustomerExtendedID = getCustomerExtendedResponse.CustomerExtendedDetailID, CustomerID = eventBooking.Customer.CustomerID, ExtendedGroupID = (int)CustomerExtendedGroup.PartyDetails, // Party Extended Fields Field2 = eventBooking.ActualStartDate.ToString(), Field3 = eventBooking.CloseDate.ToString(), Field4 = eventBooking.LockoutDate.ToString(), Field12 = eventBooking.PartyDate.ToString(), Field13 = eventBooking.PartyStartTime, Field14 = eventBooking.PartyEndTime, Field15 = eventBooking.TimeZone }; requests.Add(updateCustomerExtendedRequest); result = Api.ProcessTransaction(new TransactionalRequest { TransactionRequests = requests.ToArray() }); } catch (Exception ex) { if (Status.Success.Equals(confirmation.Result.Status)) { confirmation.Result.Errors.Add("Your event was updated but an unexpected error was encountered: " + ex.Message); } else { confirmation.Result.Errors.Add("There was an unexpected error while updating your event: " + ex.Message); } return(confirmation); } try { using (var context = Exigo.Sql()) { string sqlProcedure = string.Format("UpdateEvent {0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}'", eventBooking.Customer.CustomerID, eventBooking.Customer.FirstName, eventBooking.ActualStartDate.ToString(CultureInfo.InvariantCulture), eventBooking.CloseDate.ToString(CultureInfo.InvariantCulture), eventBooking.LockoutDate.ToString(CultureInfo.InvariantCulture), eventBooking.PartyStartTime, eventBooking.PartyEndTime, eventBooking.TimeZone, eventBooking.CustomerSite.WebAlias); bool eventUpdated = context.Query <bool>(sqlProcedure).FirstOrDefault(); } } catch (Exception EX) { } ProcessUpdatePartyCustomerResponse(result, eventBooking, confirmation); return(confirmation); }