Skip to content

Commit 576b838

Browse files
committed
Add function for KRS registry
1 parent fb5c15b commit 576b838

File tree

126 files changed

+7366
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+7366
-141
lines changed

nip24Example/Program.cs

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
76
*
87
* http://www.apache.org/licenses/LICENSE-2.0
98
*
109
* Unless required by applicable law or agreed to in writing, software
1110
* distributed under the License is distributed on an "AS IS" BASIS,
1211
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
1412
* limitations under the License.
1513
*
1614
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
15+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1816
* @license http://www.apache.org/licenses/LICENSE-2.0
1917
*/
2018

19+
using NIP24.Model;
2120
using System;
2221

2322
namespace NIP24
@@ -31,19 +30,17 @@ static void Main(string[] args)
3130
{
3231
try
3332
{
34-
// Utworzenie obiektu klienta usługi serwisu produkcyjnego
3533
// id – ciąg znaków reprezentujący identyfikator klucza API
3634
// key – ciąg znaków reprezentujący klucz API
3735
// NIP24Client nip24 = new NIP24Client("id", "key");
3836

39-
// Utworzenie obiektu klienta usługi serwisu testowego
4037
NIP24Client nip24 = new NIP24Client();
4138

4239
string nip = "7171642051";
4340
string nip_eu = "PL" + nip;
4441
string account_number = "49154000046458439719826658";
42+
string krs_number = "0000030897";
4543

46-
// Sprawdzenie stanu konta
4744
AccountStatus account = nip24.GetAccountStatus();
4845

4946
if (account != null)
@@ -74,7 +71,6 @@ static void Main(string[] args)
7471
}
7572
}
7673

77-
// Sprawdzenie statusu firmy w rejestrze VAT
7874
VATStatus vat = nip24.GetVATStatus(Number.NIP, nip);
7975

8076
if (vat != null)
@@ -146,7 +142,6 @@ static void Main(string[] args)
146142
Console.WriteLine("Błąd: " + nip24.LastError + " (kod: " + nip24.LastErrorCode + ")");
147143
}
148144

149-
// Wywołanie metody wyszukującej dane w rejestrze VAT
150145
SearchResult result = nip24.SearchVATRegistry(Number.NIP, nip);
151146

152147
if (result != null)
@@ -157,8 +152,32 @@ static void Main(string[] args)
157152
{
158153
Console.WriteLine("Błąd: " + nip24.LastError + " (kod: " + nip24.LastErrorCode + ")");
159154
}
160-
}
161-
catch (Exception e)
155+
156+
// Wywołanie metody pobierającej pełne dane z KRS
157+
KRSData krs = nip24.GetKRSData(Number.KRS, krs_number);
158+
159+
if (krs != null)
160+
{
161+
Console.WriteLine(krs);
162+
}
163+
else
164+
{
165+
Console.WriteLine("Błąd: " + nip24.LastError + " (kod: " + nip24.LastErrorCode + ")");
166+
}
167+
168+
// Wywołanie metody pobierającej dane z KRS (np. tylko dział 1)
169+
krs = nip24.GetKRSSection(Number.KRS, krs_number, 1);
170+
171+
if (krs != null)
172+
{
173+
Console.WriteLine(krs);
174+
}
175+
else
176+
{
177+
Console.WriteLine("Błąd: " + nip24.LastError + " (kod: " + nip24.LastErrorCode + ")");
178+
}
179+
}
180+
catch (Exception e)
162181
{
163182
System.Diagnostics.Debug.WriteLine(e.StackTrace);
164183
}

nip24Example/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Runtime.InteropServices;
33

44
// General Information about an assembly is controlled through the following
5-
// set of attributes. Change these attribute values to modify the information
65
// associated with an assembly.
76
[assembly: AssemblyTitle("NIP24 Service Client")]
87
[assembly: AssemblyDescription("NIP24 Service Client for .NET Framework (C#)")]
@@ -23,13 +22,10 @@
2322

2423
// Version information for an assembly consists of the following four values:
2524
//
26-
// Major Version
2725
// Minor Version
28-
// Build Number
29-
// Revision
3026
//
3127
// You can specify all the values or you can default the Build and Revision Numbers
3228
// by using the '*' as shown below:
3329
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.4.6.0")]
35-
[assembly: AssemblyFileVersion("1.4.6.0")]
30+
[assembly: AssemblyVersion("1.4.7.0")]
31+
[assembly: AssemblyFileVersion("1.4.7.0")]

nip24Library/AccountStatus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/AllData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/EUVAT.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/Error.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/IBAN.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/IBANStatus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/InvoiceData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

nip24Library/KRS.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2022 NETCAT (www.netcat.pl)
2+
* Copyright 2015-2023 NETCAT (www.netcat.pl)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
* @author NETCAT <[email protected]>
17-
* @copyright 2015-2022 NETCAT (www.netcat.pl)
17+
* @copyright 2015-2023 NETCAT (www.netcat.pl)
1818
* @license http://www.apache.org/licenses/LICENSE-2.0
1919
*/
2020

0 commit comments

Comments
 (0)