public async Task <Guid> CreateDebtorAddressAsync(CustomAddress model) { var dynamicsModel = new Inss_InssAddress { inss_addressline1 = model.AddressLine1, inss_addressline2 = model.AddressLine2, inss_postcode = model.Postcode, inss_addressline4 = model.County, inss_addressline3 = model.TownCity, inss_country = model.Country, inss_datefrom = model.DateFrom, inss_dateto = model.DateTo }; var result = await _client.For <Inss_InssAddress>() .Set(dynamicsModel) .InsertEntryWithLogsAsync(_logger); var moratorium = await _client.For <Ntt_breathingspacemoratorium>() .Key(model.OwnerId) .Expand(x => x.ntt_debtorid) .FindEntryAsync(); await _client.For <Ntt_breathingspacedebtor>() .Key(moratorium.ntt_debtorid.Ntt_breathingspacedebtorid) .LinkEntryWithLogsAsync(_logger, result, "ntt_breathingspacedebtor_inss_inssaddress"); await _auditService.PerformAuditing(_auditContext.ToAuditDetail(result.ToAuditDictionary())); return(result.inss_inssaddressid.Value); }
public void CustomAddress_EqualsSameData_ReturnsTrue() { var ownerId = Guid.NewGuid(); var addr1 = new CustomAddress() { AddressLine1 = "Line1", AddressLine2 = "Line2", Country = "Country", County = "County", DateFrom = new DateTime(1990, 1, 1), DateTo = new DateTime(1991, 1, 1), OwnerId = ownerId, Postcode = "SW1 1AA", TownCity = "City" }; var addr2 = new CustomAddress() { AddressLine1 = "Line1", AddressLine2 = "Line2", Country = "Country", County = "County", DateFrom = new DateTime(1990, 1, 1), DateTo = new DateTime(1991, 1, 1), OwnerId = ownerId, Postcode = "SW1 1AA", TownCity = "City" }; Assert.IsTrue(addr1.Equals(addr2)); }
public NominatedContactAddress(CustomAddress address) { AddressLine1 = address.AddressLine1; AddressLine2 = address.AddressLine2; County = address.County; Postcode = address.Postcode; TownCity = address.TownCity; Country = address.Country ?? Constants.UkCountryValue; }
public CustomAddress MapToCustomAddress() { var address = new CustomAddress(); var addressElements = this.AddressLine; var addressLines = Enumerable.Where <AddressLineType>(this.AddressLine, x => string.IsNullOrEmpty(x.Label)).ToList(); address.AddressLine1 = addressLines.Count > 0 ? addressLines[0].Line : null; address.AddressLine2 = addressLines.Count > 1 ? addressLines[1].Line : null; address.TownCity = Enumerable.FirstOrDefault <AddressLineType>(addressElements, x => x.Label == "Town")?.Line; address.County = Enumerable.FirstOrDefault <AddressLineType>(addressElements, x => x.Label == "County")?.Line; address.Postcode = Enumerable.FirstOrDefault <AddressLineType>(addressElements, x => x.Label == "Postcode")?.Line; return(address); }
public void CheckAddress(CustomAddress ca, string stringsToMatch1, string stringsToMatch2, string stringsToMatch3, string stringsToMatch4, string stringsToMatch5, string stringsToMatch6, string stringsToMatch7) { Assert.NotNull(ca); Assert.Equal(ca.StreetLine1, stringsToMatch1); Assert.Equal(ca.StreetLine2, stringsToMatch2); Assert.Equal(ca.StreetLine3, stringsToMatch3); Assert.Equal(ca.City, stringsToMatch4); Assert.Equal(ca.Province, stringsToMatch5); Assert.Equal(ca.Postalcode, stringsToMatch6); Assert.Equal(ca.Country, stringsToMatch7); }
public void Save() { using (Settings settings = new MPSettings()) { settings.SetValue(SECTION_NAME, SERVER_NAME, ServerName); settings.SetValue(SECTION_NAME, SERVER_PASS, Password); settings.SetValue(SECTION_NAME, CUSTOM_ADDRESS, CustomAddress.HexStringFromBytes()); settings.SetValue(SECTION_NAME, RTSP_PORT, RtspPort); settings.SetValue(SECTION_NAME, UDP_PORT, UdpPort); settings.SetValue(SECTION_NAME, BUFFER_SIZE, AudioBuffer.ToString(CultureInfo.InvariantCulture)); settings.SetValueAsBool(SECTION_NAME, ALLOW_VOLUME, AllowVolume); settings.SetValueAsBool(SECTION_NAME, SEND_COMMANDS, SendCommands); settings.SetValue(SECTION_NAME, AIRPLAY_PORT, AirplayPort); settings.SetValueAsBool(SECTION_NAME, ALLOW_HD_STREAMS, AllowHDStreams); settings.SetValue(SECTION_NAME, VIDEO_BUFFER, VideoBuffer); settings.SetValueAsBool(SECTION_NAME, IOS8_WORKAROUND, iOS8Workaround); } }
public List <CustomAddress> Get() { List <CustomAddress> list = new List <CustomAddress>(); QueryExpression queryCustomAddress = new QueryExpression("ss_customaddress"); queryCustomAddress.ColumnSet.AllColumns = true; EntityCollection CustomAddressCols = svc.RetrieveMultiple(queryCustomAddress); foreach (Entity app in CustomAddressCols.Entities) { CustomAddress obj = new CustomAddress(); if (app.Attributes["ss_name"].ToString() != null) { obj.name = app.Attributes["ss_name"].ToString(); obj.id = app.Id; } list.Add(obj); } return(list); }
public async Task <IStatusCodeActionResult> DebtorAddressAsync(CustomAddress model) { var id = await _moneyAdviserGateway.CreateDebtorAddressAsync(model); return(Ok(id)); }
public async Task <IStatusCodeActionResult> CreditorAddressAsync(CustomAddress model) { var id = await _dynamicsGateway.AddAdHocCreditorAddressAsync(model); return(Ok(id)); }