Skip to content

Commit 4078284

Browse files
authored
Merge pull request #112 from haydenhall/standard
Update solution to support targeting netstandard2.0
2 parents 18ccb17 + a37f3bc commit 4078284

123 files changed

Lines changed: 126240 additions & 14477 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ build/
1515
[Bb]in/
1616
[Oo]bj/
1717

18+
# Visual Studio Code settings directory
19+
.vscode/
20+
# Visual Studio 2015 cache/options directory
21+
.vs/
22+
1823
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
1924
!packages/*/build/
20-
NHapi20/packages/*
25+
!NHapi20/packages/*
2126

2227
# MSTest test Results
2328
[Tt]est[Rr]esult*/

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ All notable changes to this project will be documented in this file.
33

44
## Upcoming Release
55
###
6-
-
6+
## [3.0.0.0] - TBC
7+
### Added (Submitted by haydenhall and milkshakeuk)
8+
- Update project to add support for netstandard2.0 #61
9+
10+
11+
## Previous Releases
12+
###
713

814
## [2.5.0.6] - 2016-09-13
915
### Fixes

NHapi20/.nuget/NuGet.exe

3.84 MB
Binary file not shown.

NHapi20/ModelGenerator/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<configuration>
44
<appSettings>
55

6-
<add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\projects\hl7\hl7db.mdb;" />
6+
<add key="ConnectionString" value="Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=Z:\projects\hl7\hl7db.mdb;" />
77

88
<add key="UseFactory" value="false" />
99
</appSettings>
Lines changed: 37 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,56 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.50727</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{EBB8E9C9-7FF2-49C4-96EF-C5B87E4C2617}</ProjectGuid>
94
<OutputType>Exe</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>ModelGenerator</RootNamespace>
12-
<AssemblyName>ModelGenerator</AssemblyName>
13-
<FileUpgradeFlags>
14-
</FileUpgradeFlags>
15-
<OldToolsVersion>3.5</OldToolsVersion>
16-
<UpgradeBackupLocation>
17-
</UpgradeBackupLocation>
18-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
19-
<TargetFrameworkProfile />
20-
<PublishUrl>publish\</PublishUrl>
21-
<Install>true</Install>
22-
<InstallFrom>Disk</InstallFrom>
23-
<UpdateEnabled>false</UpdateEnabled>
24-
<UpdateMode>Foreground</UpdateMode>
25-
<UpdateInterval>7</UpdateInterval>
26-
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
27-
<UpdatePeriodically>false</UpdatePeriodically>
28-
<UpdateRequired>false</UpdateRequired>
29-
<MapFileExtensions>true</MapFileExtensions>
30-
<ApplicationRevision>0</ApplicationRevision>
31-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
32-
<IsWebBootstrapper>false</IsWebBootstrapper>
33-
<UseApplicationTrust>false</UseApplicationTrust>
34-
<BootstrapperEnabled>true</BootstrapperEnabled>
35-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
36-
<RestorePackages>true</RestorePackages>
37-
</PropertyGroup>
38-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
39-
<DebugSymbols>true</DebugSymbols>
40-
<DebugType>full</DebugType>
41-
<Optimize>false</Optimize>
42-
<OutputPath>bin\Debug\</OutputPath>
43-
<DefineConstants>DEBUG;TRACE</DefineConstants>
44-
<ErrorReport>prompt</ErrorReport>
45-
<WarningLevel>4</WarningLevel>
46-
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
47-
<PlatformTarget>x86</PlatformTarget>
48-
</PropertyGroup>
49-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
50-
<DebugType>pdbonly</DebugType>
51-
<Optimize>true</Optimize>
52-
<OutputPath>bin\Release\</OutputPath>
53-
<DefineConstants>TRACE</DefineConstants>
54-
<ErrorReport>prompt</ErrorReport>
55-
<WarningLevel>4</WarningLevel>
56-
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
57-
</PropertyGroup>
58-
<PropertyGroup>
59-
<SignAssembly>false</SignAssembly>
60-
</PropertyGroup>
61-
<PropertyGroup>
5+
<TargetFrameworks>net35;netcoreapp3.1</TargetFrameworks>
626
<AssemblyOriginatorKeyFile>..\NHapi.snk</AssemblyOriginatorKeyFile>
7+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
638
</PropertyGroup>
9+
6410
<ItemGroup>
65-
<Reference Include="Args">
66-
<HintPath>..\packages\Args.1.1.2\lib\Net35\Args.dll</HintPath>
67-
</Reference>
68-
<Reference Include="System" />
69-
<Reference Include="System.configuration" />
70-
<Reference Include="System.Data" />
71-
<Reference Include="System.Xml" />
11+
<None Include="..\NHapi.snk" Link="NHapi.snk" />
7212
</ItemGroup>
13+
7314
<ItemGroup>
74-
<Compile Include="..\SharedAssemblyInfo.cs">
75-
<Link>Properties\SharedAssemblyInfo.cs</Link>
76-
</Compile>
77-
<Compile Include="Program.cs" />
78-
<Compile Include="Properties\AssemblyInfo.cs" />
79-
<Compile Include="Properties\Settings.Designer.cs">
80-
<AutoGen>True</AutoGen>
15+
<Compile Include="..\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<Compile Update="Properties\Settings.Designer.cs">
8120
<DesignTimeSharedInput>True</DesignTimeSharedInput>
21+
<AutoGen>True</AutoGen>
8222
<DependentUpon>Settings.settings</DependentUpon>
8323
</Compile>
84-
<Compile Include="ModelBuilder.cs" />
8524
</ItemGroup>
25+
8626
<ItemGroup>
87-
<None Include="..\NHapi.snk">
88-
<Link>NHapi.snk</Link>
89-
</None>
90-
<None Include="App.config">
91-
<SubType>Designer</SubType>
92-
</None>
93-
<None Include="packages.config" />
94-
<None Include="Properties\Settings.settings">
27+
<None Update="Properties\Settings.settings">
9528
<Generator>SettingsSingleFileGenerator</Generator>
9629
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
9730
</None>
9831
</ItemGroup>
32+
9933
<ItemGroup>
100-
<ProjectReference Include="..\nHapi.Base\NHapi.Base.csproj">
101-
<Project>{5A080123-0597-46C3-AE78-2007EFB0DD68}</Project>
102-
<Name>NHapi.Base</Name>
103-
</ProjectReference>
34+
<ProjectReference Include="..\NHapi.Base\NHapi.Base.csproj" />
10435
</ItemGroup>
105-
<ItemGroup>
106-
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
107-
<Visible>False</Visible>
108-
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
109-
<Install>false</Install>
110-
</BootstrapperPackage>
111-
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
112-
<Visible>False</Visible>
113-
<ProductName>.NET Framework 3.5 SP1</ProductName>
114-
<Install>true</Install>
115-
</BootstrapperPackage>
116-
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
117-
<Visible>False</Visible>
118-
<ProductName>Windows Installer 3.1</ProductName>
119-
<Install>true</Install>
120-
</BootstrapperPackage>
36+
37+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
38+
<PackageReference Include="Args" Version="1.2.1" />
39+
</ItemGroup>
40+
41+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
42+
<PackageReference Include="Args" Version="1.1.2" />
43+
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" />
44+
</ItemGroup>
45+
46+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
47+
<Reference Include="Args">
48+
<HintPath>..\packages\Args.1.1.2\lib\Net35\Args.dll</HintPath>
49+
</Reference>
50+
<Reference Include="System" />
51+
<Reference Include="System.configuration" />
52+
<Reference Include="System.Data" />
53+
<Reference Include="System.Xml" />
12154
</ItemGroup>
122-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
123-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
124-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
125-
<PropertyGroup>
126-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
127-
</PropertyGroup>
128-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
129-
</Target>
130-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
131-
Other similar extension points exist, see Microsoft.Common.targets.
132-
<Target Name="BeforeBuild">
133-
</Target>
134-
<Target Name="AfterBuild">
135-
</Target>
136-
-->
137-
</Project>
55+
56+
</Project>

NHapi20/ModelGenerator/Properties/Settings.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NHapi20/ModelGenerator/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

NHapi20/NHapi.Base/DBTableRepository.cs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
using System;
2424
using System.Collections;
25-
using System.Data.OleDb;
25+
using System.Data.Common;
26+
using System.Data.Odbc;
2627
using System.Text;
2728
using NHapi.Base.Log;
2829

@@ -44,12 +45,12 @@ public override int[] Tables
4445
{
4546
try
4647
{
47-
OleDbConnection conn = NormativeDatabase.Instance.Connection;
48-
OleDbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
49-
OleDbCommand temp_OleDbCommand;
48+
OdbcConnection conn = NormativeDatabase.Instance.Connection;
49+
DbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
50+
DbCommand temp_OleDbCommand;
5051
temp_OleDbCommand = stmt;
5152
temp_OleDbCommand.CommandText = "select distinct table_id from TableValues";
52-
OleDbDataReader rs = temp_OleDbCommand.ExecuteReader();
53+
DbDataReader rs = temp_OleDbCommand.ExecuteReader();
5354
int[] roomyList = new int[bufferSize];
5455
int c = 0;
5556
while (rs.Read())
@@ -62,7 +63,7 @@ public override int[] Tables
6263
tableList = new int[c];
6364
Array.Copy(roomyList, 0, tableList, 0, c);
6465
}
65-
catch (OleDbException sqle)
66+
catch (DbException sqle)
6667
{
6768
throw new LookupException("Can't get table list from database: " + sqle.Message);
6869
}
@@ -124,14 +125,14 @@ public override String[] getValues(int table)
124125

125126
try
126127
{
127-
OleDbConnection conn = NormativeDatabase.Instance.Connection;
128-
OleDbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
128+
OdbcConnection conn = NormativeDatabase.Instance.Connection;
129+
DbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
129130
StringBuilder sql = new StringBuilder("select table_value from TableValues where table_id = ");
130131
sql.Append(table);
131-
OleDbCommand temp_OleDbCommand;
132+
DbCommand temp_OleDbCommand;
132133
temp_OleDbCommand = stmt;
133134
temp_OleDbCommand.CommandText = sql.ToString();
134-
OleDbDataReader rs = temp_OleDbCommand.ExecuteReader();
135+
DbDataReader rs = temp_OleDbCommand.ExecuteReader();
135136

136137
c = 0;
137138
while (rs.Read())
@@ -142,7 +143,7 @@ public override String[] getValues(int table)
142143
stmt.Dispose();
143144
NormativeDatabase.Instance.returnConnection(conn);
144145
}
145-
catch (OleDbException sqle)
146+
catch (DbException sqle)
146147
{
147148
throw new LookupException("Couldn't look up values for table " + table + ": " + sqle.Message);
148149
}
@@ -175,12 +176,12 @@ public override String getDescription(int table, String value_Renamed)
175176

176177
try
177178
{
178-
OleDbConnection conn = NormativeDatabase.Instance.Connection;
179-
OleDbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
180-
OleDbCommand temp_OleDbCommand;
179+
OdbcConnection conn = NormativeDatabase.Instance.Connection;
180+
DbCommand stmt = SupportClass.TransactionManager.manager.CreateStatement(conn);
181+
DbCommand temp_OleDbCommand;
181182
temp_OleDbCommand = stmt;
182183
temp_OleDbCommand.CommandText = sql.ToString();
183-
OleDbDataReader rs = temp_OleDbCommand.ExecuteReader();
184+
DbDataReader rs = temp_OleDbCommand.ExecuteReader();
184185
if (rs.Read())
185186
{
186187
description = Convert.ToString(rs[1 - 1]);
@@ -193,7 +194,7 @@ public override String getDescription(int table, String value_Renamed)
193194
stmt.Dispose();
194195
NormativeDatabase.Instance.returnConnection(conn);
195196
}
196-
catch (OleDbException e)
197+
catch (DbException e)
197198
{
198199
throw new LookupException("Can't find value " + value_Renamed + " in table " + table, e);
199200
}

0 commit comments

Comments
 (0)