Skip to content

Commit 096c271

Browse files
authored
Merge pull request #347 from bcgov/ofmcc-7555
Updating Organization Address format
2 parents df036b5 + 5309734 commit 096c271

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

OFM.Infrastructure.Plugins/Account/StorePreviousAccountValuesToApplication.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,23 @@ protected override void ExecuteDataversePlugin(ILocalPluginContext localPluginCo
7878
if (preImageAccount.GetAttributeValue<OptionSetValue>("ccof_accounttype").Value == (int)ccof_AccountType.Organization &&
7979
preImageAccount.GetAttributeValue<string>("address1_composite") != postImageAccount.GetAttributeValue<string>("address1_composite"))
8080
{
81-
applicationUpdate["ofm_previous_organization_address"] = preImageAccount.GetAttributeValue<string>("address1_composite");
81+
var addressString = string.Empty;
82+
addressString += preImageAccount.GetAttributeValue<string>("address1_line1");
83+
if (preImageAccount.GetAttributeValue<string>("address1_line2") != null)
84+
{
85+
addressString += ", " + preImageAccount.GetAttributeValue<string>("address1_line2") + ", "
86+
+ preImageAccount.GetAttributeValue<string>("address1_city") + ", "
87+
+ preImageAccount.GetAttributeValue<string>("address1_stateorprovince") + " "
88+
+ preImageAccount.GetAttributeValue<string>("address1_postalcode");
89+
}
90+
else
91+
{
92+
addressString += ", " + preImageAccount.GetAttributeValue<string>("address1_city") + ", "
93+
+ preImageAccount.GetAttributeValue<string>("address1_stateorprovince") + " "
94+
+ preImageAccount.GetAttributeValue<string>("address1_postalcode");
95+
}
96+
97+
applicationUpdate["ofm_previous_organization_address"] = addressString;
8298
updateRequired = true;
8399
}
84100

0 commit comments

Comments
 (0)