Skip to content

Commit fd91fe0

Browse files
authored
Merge pull request #705 from bcgov/yj
feat(dss-938)
2 parents f4f8fd6 + 63c37a0 commit fd91fe0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/StrDss.Data/Repositories/BizLicenceRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ INSERT INTO biz_lic_table (
103103
@LicenceStatusType, @ProvidingOrganizationId
104104
);";
105105

106-
bool ConvertToBool(string value) => value?.ToUpper() == "Y";
106+
bool? ConvertToBool(string value) => string.IsNullOrEmpty(value) ? null : value?.ToUpper() == "Y";
107107

108108
DateTime? ConvertToDate(string value) => DateTime.TryParseExact(value, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out var date) ? date : (DateTime?) null;
109109

@@ -142,9 +142,9 @@ INSERT INTO biz_lic_table (
142142
new NpgsqlParameter("@propertyZoneTxt", row.PropertyZoneTxt ?? (object)DBNull.Value),
143143
new NpgsqlParameter("@availableBedroomsQty", ConvertToInt2(row.AvailableBedroomsQty) ?? (object)DBNull.Value),
144144
new NpgsqlParameter("@maxGuestsAllowedQty", ConvertToInt2(row.MaxGuestsAllowedQty) ?? (object)DBNull.Value),
145-
new NpgsqlParameter("@isPrincipalResidence", ConvertToBool(row.IsPrincipalResidence)),
146-
new NpgsqlParameter("@isOwnerLivingOnsite", ConvertToBool(row.IsOwnerLivingOnsite)),
147-
new NpgsqlParameter("@isOwnerPropertyTenant", ConvertToBool(row.IsOwnerPropertyTenant)),
145+
new NpgsqlParameter("@isPrincipalResidence", ConvertToBool(row.IsPrincipalResidence) ?? (object)DBNull.Value),
146+
new NpgsqlParameter("@isOwnerLivingOnsite", ConvertToBool(row.IsOwnerLivingOnsite) ?? (object)DBNull.Value),
147+
new NpgsqlParameter("@isOwnerPropertyTenant", ConvertToBool(row.IsOwnerPropertyTenant) ??(object) DBNull.Value),
148148
new NpgsqlParameter("@propertyFolioNo", row.PropertyFolioNo ?? (object)DBNull.Value),
149149
new NpgsqlParameter("@propertyParcelIdentifierNo", row.PropertyParcelIdentifierNo ?? (object)DBNull.Value),
150150
new NpgsqlParameter("@propertyLegalDescriptionTxt", row.PropertyLegalDescriptionTxt ?? (object)DBNull.Value),

0 commit comments

Comments
 (0)