LoyaltyPartnerClientUpdateLoyaltyPartnerOutlet Method |
Update a Loyalty Partner Outlet, from the submitted values.
public Result UpdateLoyaltyPartnerOutlet( ManagementGroupRequestOfPartnerOutletProfile request )
using (var svc = new LoyaltyService.LoyaltyPartnerClient()) { var request = new LoyaltyService.ManagementGroupRequestOfPartnerOutletProfile(); request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin var parterOutletProfile = new LoyaltyService.PartnerOutletProfile(); parterOutletProfile.RSN = new Guid("578f50e6-efd8-4a9d-8576-90fd0d782ba9");;//Required - RSN of outlet //parterOutletProfile.Partner_RSN should not be populated parterOutletProfile.DisplayValue = "Simplicity Demo Partner - Albany Branch";//Optional parterOutletProfile.ID = "Partner Outlet ID";//Required - must be unique parterOutletProfile.Active = true;//Optional parterOutletProfile.Approved = true;//Optional parterOutletProfile.BankAccountHolderName = "J Doe";//Optional parterOutletProfile.BankAccountNumberBank = "12";//Optional parterOutletProfile.BankAccountNumberBranch = "1234";//Optional parterOutletProfile.BankAccountNumberAccount = "1234567";//Optional parterOutletProfile.BankAccountNumberSuffix = "123";//Optional parterOutletProfile.DealershipSignOff_Email = "demo@simplicitycrm.com";//Optional parterOutletProfile.DealershipSignOff_Line1 = "Always buy at simplicity demo";//Optional parterOutletProfile.DealershipSignOff_Line2 = "";//Optional parterOutletProfile.Email = "demo@simplicitycrm.com";//Optional parterOutletProfile.FeatureImageRSN = new Guid("1E636C7D-EDE2-40E4-99DB-8E9511282061");//Optional parterOutletProfile.FullSizeImageRSN = new Guid("3A55CDE5-EAF0-42F2-93DB-79ECA717DDB3");//Optional parterOutletProfile.ThumbnailImageRSN = new Guid("635328EF-542F-49D0-8F56-82CA6B5A528C");//Optional parterOutletProfile.Name = "Simplicity Demo Partner Ltd";//Optional - company name parterOutletProfile.PointsConversionFactor = 0.0m;//Optional parterOutletProfile.PrimaryContact_Email = "john.doe@simplicitycrm.com";//Required parterOutletProfile.PrimaryContact_Title = "Mr";//Required parterOutletProfile.PrimaryContact_GivenName = "John";//Required parterOutletProfile.PrimaryContact_FamilyName = "Doe";//Required parterOutletProfile.PrimaryContact_Role = "Director";//Optional parterOutletProfile.PromotionalPointsConversionFactor = 0.0m;//Optional parterOutletProfile.TradingAs = "Simplicity Demo";//Optional parterOutletProfile.URL = "www.simplicity-demo-partner.com";//Optional parterOutletProfile.Visible = true;//Optional parterOutletProfile.DefaultPurchaseOrderNumber = "PO_ALBANY_123";//Optional var contact = new LoyaltyService.ProfileContact(); var workPhone = new LoyaltyService.Phone(); workPhone.ContactType = "CONTACT";//Required - should always be CONTACT workPhone.IDD = "64"; //Optional Country code workPhone.STD = "9"; //Optional Entire phone number (excluding IDD) can be placed in Local parameter depending on setup workPhone.Local = "926 5400";//Optional var fax = new LoyaltyService.Phone(); fax.ContactType = "FAX";//Required - should always be FAX fax.IDD = "64"; //Optional Country code fax.STD = "9"; //Optional Entire phone number (excluding IDD) can be placed in Local parameter depending on setup fax.Local = "926 5400";//Optional contact.PhoneContact = new LoyaltyService.Phone[] { workPhone, fax };//Optional var headOfficeAddress = new LoyaltyService.Street(); headOfficeAddress.ContactType = "STREET"; // Should always be 'STREET' for AddressContact for this method headOfficeAddress.Line1 = "Level 1, Simplicity Building"; // Required headOfficeAddress.Line2 = "14-22 Triton Drive"; // Optional headOfficeAddress.Suburb = "Albany"; // Required headOfficeAddress.TownCityState = "Auckland"; // Required headOfficeAddress.PostCode = "0632"; // Required headOfficeAddress.Country = "New Zealand"; // Required contact.AddressContact = new LoyaltyService.Address[] { headOfficeAddress };// Required //add contact to partner profile parterOutletProfile.Contact = contact;// Required var region = new LoyaltyService.PartnerOutletRegion(); region.Region_RSN = new Guid("9779e504-9d1e-48df-abf6-8b35d2e9d30e");;//Required - RSN of the region //all other region properties ignored parterOutletProfile.Regions = new LoyaltyService.PartnerOutletRegion[] { region };//Optional var district = new LoyaltyService.PartnerOutletDistrict(); district.District_RSN = new Guid("a8e2dea4-9e3f-4fe2-b75d-91dbc5394898");;//Required - RSN of the district //all other district properties ignored parterOutletProfile.Districts = new LoyaltyService.PartnerOutletDistrict[] { district };//Optional //add parterProfile to request request.Value = parterOutletProfile;//Required LoyaltyService.Result result = svc.UpdateLoyaltyPartnerOutlet(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }