diff --git a/CvrModels/CvrCompany.cs b/CvrModels/CvrInfo.cs similarity index 64% rename from CvrModels/CvrCompany.cs rename to CvrModels/CvrInfo.cs index c473b60..3d44d71 100644 --- a/CvrModels/CvrCompany.cs +++ b/CvrModels/CvrInfo.cs @@ -4,10 +4,22 @@ // Created : 01-01-2022 // // Last Modified By : FH -// Last Modified On : 01-31-2022 +// Last Modified On : 02-24-2022 // *********************************************************************** -// -// Copyright © FCS 2015-2022 +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see // // // *********************************************************************** @@ -17,7 +29,7 @@ namespace FCS.Virk.CvrModels /// /// Class CvrCompany. /// - public class CvrCompany + public class CvrInfo { /// /// Gets or sets the vat number. @@ -53,6 +65,6 @@ namespace FCS.Virk.CvrModels /// Gets or sets the status. /// /// The status. - public List Status { get; set; } = new(); + public List States { get; set; } = new(); } } \ No newline at end of file diff --git a/CvrModels/CvrPeriod.cs b/CvrModels/CvrPeriod.cs deleted file mode 100644 index 8bc9421..0000000 --- a/CvrModels/CvrPeriod.cs +++ /dev/null @@ -1,32 +0,0 @@ -// *********************************************************************** -// Assembly : Inno.Api -// Author : FH -// Created : 01-01-2022 -// -// Last Modified By : FH -// Last Modified On : 01-09-2022 -// *********************************************************************** -// -// Copyright © FCS 2015-2022 -// -// -// *********************************************************************** -namespace FCS.Virk.CvrModels -{ - /// - /// Class CvrPeriod. - /// - public class CvrPeriod - { - /// - /// Gets or sets the start date. - /// - /// The start date. - public string StartDate { get; set; } = ""; - /// - /// Gets or sets the end date. - /// - /// The end date. - public string EndDate { get; set; } = ""; - } -} \ No newline at end of file diff --git a/CvrModels/CvrState.cs b/CvrModels/CvrState.cs new file mode 100644 index 0000000..d2e087d --- /dev/null +++ b/CvrModels/CvrState.cs @@ -0,0 +1,49 @@ +// *********************************************************************** +// Assembly : Inno.Api +// Author : FH +// Created : 01-01-2022 +// +// Last Modified By : FH +// Last Modified On : 02-22-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.CvrModels +{ + /// + /// Class CvrStatus. + /// + public class CvrState + { + /// + /// Gets or sets the last update. + /// + /// The last update. + public string LastUpdate { get; set; } = ""; + /// + /// Gets or sets the status. + /// + /// The status. + public string State { get; set; } = "INAKTIV"; + /// + /// Gets or sets the period. + /// + /// The period. + public TimeFrame TimeFrame { get; set; } = new(); + } +} \ No newline at end of file diff --git a/CvrModels/CvrStatus.cs b/CvrModels/CvrStatus.cs deleted file mode 100644 index cf6b6f6..0000000 --- a/CvrModels/CvrStatus.cs +++ /dev/null @@ -1,37 +0,0 @@ -// *********************************************************************** -// Assembly : Inno.Api -// Author : FH -// Created : 01-01-2022 -// -// Last Modified By : FH -// Last Modified On : 01-31-2022 -// *********************************************************************** -// -// Copyright © FCS 2015-2022 -// -// -// *********************************************************************** -namespace FCS.Virk.CvrModels -{ - /// - /// Class CvrStatus. - /// - public class CvrStatus - { - /// - /// Gets or sets the last update. - /// - /// The last update. - public string LastUpdate { get; set; } = ""; - /// - /// Gets or sets the status. - /// - /// The status. - public string Status { get; set; } = "LUKKET"; - /// - /// Gets or sets the period. - /// - /// The period. - public CvrPeriod Period { get; set; } = new(); - } -} \ No newline at end of file diff --git a/CvrModels/TimeFrame.cs b/CvrModels/TimeFrame.cs new file mode 100644 index 0000000..c414637 --- /dev/null +++ b/CvrModels/TimeFrame.cs @@ -0,0 +1,44 @@ +// *********************************************************************** +// Assembly : Inno.Api +// Author : FH +// Created : 01-01-2022 +// +// Last Modified By : FH +// Last Modified On : 02-22-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.CvrModels +{ + /// + /// Class CvrPeriod. + /// + public class TimeFrame + { + /// + /// Gets or sets the start date. + /// + /// The start date. + public string StartDate { get; set; } = ""; + /// + /// Gets or sets the end date. + /// + /// The end date. + public string EndDate { get; set; } = ""; + } +} \ No newline at end of file diff --git a/VrCvrMapper.cs b/VrCvrMapper.cs index c9a9fb0..e14e4fb 100644 --- a/VrCvrMapper.cs +++ b/VrCvrMapper.cs @@ -1,13 +1,46 @@ -using FCS.Virk.CvrModels; +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +using FCS.Virk.CvrModels; using FCS.Virk.VrModels; namespace FCS.Virk { + /// + /// Class VrCvrMapper. + /// public class VrCvrMapper { - public CvrCompany MapVrToCvr(VrVirksomhed vrVirk) + /// + /// Maps the vr to CVR. + /// + /// The vr virk. + /// CvrInfo. + public CvrInfo MapVrToCvr(VrVirksomhed vrVirk) { - var c = new CvrCompany + var c = new CvrInfo { Name = vrVirk.VirksomhedMetadata.NyesteNavn.Navn, Address = @@ -18,19 +51,27 @@ namespace FCS.Virk VatNumber = vrVirk.CvrNummer }; - foreach (var cs in vrVirk.VirksomhedsStatus.Select(vrStatus => new CvrStatus - { - Status = vrStatus.Status, - LastUpdate = vrStatus.SidstOpdateret, - Period = new CvrPeriod - { - StartDate = vrStatus.Periode.GyldigFra, - EndDate = vrStatus.Periode.GyldigTil - } - })) + if (vrVirk.VirksomhedsStatus.Any()) { - c.Status.Add(cs); + foreach (var cs in vrVirk.VirksomhedsStatus.Select(vrStatus => new CvrState + { + State = vrStatus.Status, + LastUpdate = vrStatus.SidstOpdateret, + TimeFrame = new TimeFrame + { + StartDate = vrStatus.Periode.GyldigFra, + EndDate = vrStatus.Periode.GyldigTil + } + })) + { + c.States.Add(cs); + } } + else + { + c.States.Add(new CvrState()); + } + return c; } } diff --git a/VrHttpRequest.cs b/VrHttpRequest.cs index ec9b6d7..04b6a28 100644 --- a/VrHttpRequest.cs +++ b/VrHttpRequest.cs @@ -1,10 +1,45 @@ -using System.Net.Http.Headers; +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +using System.Net.Http.Headers; using System.Text; namespace FCS.Virk { + /// + /// Class VrHttpRequest. + /// public class VrHttpRequest { + /// + /// Get response as an asynchronous operation. + /// + /// The endpoint. + /// The json data. + /// The authentication. + /// A Task<VrResponseView> representing the asynchronous operation. public async Task GetResponseAsync(string endpoint, string jsonData, string auth) { using var content = new StringContent(jsonData, Encoding.UTF8, "application/json"); diff --git a/VrModels/NyesteBeliggenhedsadresse.cs b/VrModels/NyesteBeliggenhedsadresse.cs index f7c71d7..f337648 100644 --- a/VrModels/NyesteBeliggenhedsadresse.cs +++ b/VrModels/NyesteBeliggenhedsadresse.cs @@ -1,12 +1,64 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.VrModels { + /// + /// Class NyesteBeliggenhedsadresse. + /// public class NyesteBeliggenhedsadresse { + /// + /// Gets or sets the husnummer fra. + /// + /// The husnummer fra. public int? HusnummerFra { get; set; } + /// + /// Gets or sets the husnummer til. + /// + /// The husnummer til. public int? HusnummerTil { get; set; } + /// + /// Gets or sets the postnummer. + /// + /// The postnummer. public int? Postnummer { get; set; } + /// + /// Gets or sets the vejnavn. + /// + /// The vejnavn. public string Vejnavn { get; set; } = ""; + /// + /// Gets or sets the co navn. + /// + /// The co navn. public string CoNavn { get; set; } = ""; + /// + /// Gets or sets the post distrikt. + /// + /// The post distrikt. public string PostDistrikt { get; set; } = ""; } } \ No newline at end of file diff --git a/VrModels/NyesteNavn.cs b/VrModels/NyesteNavn.cs index 1e7c93e..bc2751c 100644 --- a/VrModels/NyesteNavn.cs +++ b/VrModels/NyesteNavn.cs @@ -1,7 +1,40 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** + +namespace FCS.Virk.VrModels { + /// + /// Class NyesteNavn. + /// public class NyesteNavn { + /// + /// Gets or sets the navn. + /// + /// The navn. public string Navn { get; set; } = ""; } } \ No newline at end of file diff --git a/VrModels/Periode.cs b/VrModels/Periode.cs index 0d53eeb..038a769 100644 --- a/VrModels/Periode.cs +++ b/VrModels/Periode.cs @@ -1,8 +1,44 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.VrModels { + /// + /// Class Periode. + /// public class Periode { + /// + /// Gets or sets the gyldig fra. + /// + /// The gyldig fra. public string GyldigFra { get; set; } = ""; + /// + /// Gets or sets the gyldig til. + /// + /// The gyldig til. public string GyldigTil { get; set; } = ""; } } \ No newline at end of file diff --git a/VrModels/VirksomhedMetadata.cs b/VrModels/VirksomhedMetadata.cs index f28e329..360d3fa 100644 --- a/VrModels/VirksomhedMetadata.cs +++ b/VrModels/VirksomhedMetadata.cs @@ -1,8 +1,44 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.VrModels { + /// + /// Class VirksomhedMetadata. + /// public class VirksomhedMetadata { + /// + /// Gets or sets the nyeste navn. + /// + /// The nyeste navn. public NyesteNavn NyesteNavn { get; set; } = new(); + /// + /// Gets or sets the nyeste beliggenhedsadresse. + /// + /// The nyeste beliggenhedsadresse. public NyesteBeliggenhedsadresse NyesteBeliggenhedsadresse { get; set; } = new(); } } \ No newline at end of file diff --git a/VrModels/VirksomhedsStatus.cs b/VrModels/VirksomhedsStatus.cs index eb9eca0..c06a408 100644 --- a/VrModels/VirksomhedsStatus.cs +++ b/VrModels/VirksomhedsStatus.cs @@ -1,9 +1,49 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.VrModels { + /// + /// Class VirksomhedsStatus. + /// public class VirksomhedsStatus { + /// + /// Gets or sets the sidst opdateret. + /// + /// The sidst opdateret. public string SidstOpdateret { get; set; } = ""; + /// + /// Gets or sets the status. + /// + /// The status. public string Status { get; set; } = ""; + /// + /// Gets or sets the periode. + /// + /// The periode. public Periode Periode { get; set; } = new(); } } \ No newline at end of file diff --git a/VrModels/VrVirksomhed.cs b/VrModels/VrVirksomhed.cs index 331e012..4562f76 100644 --- a/VrModels/VrVirksomhed.cs +++ b/VrModels/VrVirksomhed.cs @@ -1,9 +1,49 @@ -namespace FCS.Virk.VrModels +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-21-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk.VrModels { + /// + /// Class VrVirksomhed. + /// public class VrVirksomhed { + /// + /// Gets or sets the CVR nummer. + /// + /// The CVR nummer. public string CvrNummer { get; set; } = ""; + /// + /// Gets or sets the virksomheds status. + /// + /// The virksomheds status. public List VirksomhedsStatus { get; set; } = new (); + /// + /// Gets or sets the virksomhed metadata. + /// + /// The virksomhed metadata. public VirksomhedMetadata VirksomhedMetadata { get; set; } = new(); } diff --git a/VrQuery.cs b/VrQuery.cs index 411366e..d2f5d20 100644 --- a/VrQuery.cs +++ b/VrQuery.cs @@ -1,10 +1,54 @@ -namespace FCS.Virk +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk { + /// + /// Class VrQuery. + /// public class VrQuery { + /// + /// Gets or sets the vat number. + /// + /// The vat number. public string VatNumber { get; set; } = ""; + /// + /// Gets or sets the name of the street. + /// + /// The name of the street. public string StreetName { get; set; } = ""; + /// + /// Gets or sets the house number. + /// + /// The house number. public string HouseNumber { get; set; } = ""; + /// + /// Gets or sets the zip code. + /// + /// The zip code. public string ZipCode { get; set; } = ""; } } \ No newline at end of file diff --git a/VrQueryMapper.cs b/VrQueryMapper.cs index b87b03f..530304f 100644 --- a/VrQueryMapper.cs +++ b/VrQueryMapper.cs @@ -1,9 +1,42 @@ -using Newtonsoft.Json.Linq; +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +using Newtonsoft.Json.Linq; namespace FCS.Virk { + /// + /// Class VrQueryMapper. + /// public class VrQueryMapper { + /// + /// Vrs the map query. + /// + /// The query. + /// JObject. public JObject VrMapQuery(VrQuery query) { if (string.IsNullOrWhiteSpace(query.VatNumber)) diff --git a/VrQueryValidator.cs b/VrQueryValidator.cs index 979f995..a7a46c4 100644 --- a/VrQueryValidator.cs +++ b/VrQueryValidator.cs @@ -1,15 +1,55 @@ -namespace FCS.Virk +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +namespace FCS.Virk { + /// + /// Class VrQueryValidator. + /// public static class VrQueryValidator { + /// + /// Validates the vr query. + /// + /// The query. + /// true if XXXX, false otherwise. public static bool ValidateVrQuery(VrQuery query) { - // Precise lookup - if (!string.IsNullOrEmpty(query.VatNumber)) return true; - // Search lookup - return !string.IsNullOrWhiteSpace(query.StreetName) - && !string.IsNullOrWhiteSpace(query.HouseNumber) - && !string.IsNullOrEmpty(query.ZipCode); + try + { + // Precise lookup + if (!string.IsNullOrWhiteSpace(query.VatNumber)) return true; + // Search lookup + return !string.IsNullOrWhiteSpace(query.StreetName) + && !string.IsNullOrWhiteSpace(query.HouseNumber) + && !string.IsNullOrWhiteSpace(query.ZipCode); + } + catch + { + return false; + } } } } \ No newline at end of file diff --git a/VrResponseParser.cs b/VrResponseParser.cs index b6e1aa3..6759875 100644 --- a/VrResponseParser.cs +++ b/VrResponseParser.cs @@ -1,11 +1,44 @@ -using FCS.Virk.VrModels; +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +using FCS.Virk.VrModels; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace FCS.Virk { + /// + /// Class VrResponseParser. + /// public class VrResponseParser { + /// + /// Parses the vr response. + /// + /// The json data. + /// List<System.Nullable<VrVirksomhed>>. public List ParseVrResponse(string jsonData) { var result = new List(); diff --git a/VrResponseView.cs b/VrResponseView.cs index e4bf1a1..cac3486 100644 --- a/VrResponseView.cs +++ b/VrResponseView.cs @@ -1,11 +1,51 @@ -using System.Net; +// *********************************************************************** +// Assembly : FCS.Virk +// Author : FH +// Created : 02-21-2022 +// +// Last Modified By : FH +// Last Modified On : 02-24-2022 +// *********************************************************************** +// +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see +// +// +// *********************************************************************** +using System.Net; namespace FCS.Virk { + /// + /// Class VrResponseView. + /// public class VrResponseView { + /// + /// Gets or sets the code. + /// + /// The code. public HttpStatusCode Code { get; set; } + /// + /// Gets or sets a value indicating whether this instance is success status code. + /// + /// true if this instance is success status code; otherwise, false. public bool IsSuccessStatusCode { get; set; } + /// + /// Gets or sets the message. + /// + /// The message. public string Message { get; set; } = ""; } } \ No newline at end of file