added stuff for jasonneumannaudio.com

net6.0
Don Oerkfitz 4 years ago
parent 86c16c0c32
commit 84afbc435b

@ -2,6 +2,10 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<PackageId>common-library-data-layer</PackageId>
<Version>1.0.0</Version>
<Authors>Don Oerkfitz</Authors>
<Company>DMC Dynamics LLC</Company>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

@ -0,0 +1,45 @@
using Common.Library.SQL.MySQL;
using System;
using System.Data;
using Common.Library.DataLayer.DTO.Websites.JasonNeumannAudio.com;
namespace Common.Library.DataLayer.DAO.Websites.JasonNeumannAudio.com
{
public class AboutPageDAO : MySQL
{
public AboutPageDAO(DBConnectionInformation connectionInformation) : base(connectionInformation){ }
public AboutPageDTO SelectAboutPageText()
{
InitConnection();
AboutPageDTO item = null;
try
{
DBCommand.CommandType = CommandType.StoredProcedure;
DBCommand.CommandText = "about_page_select_text";
DBReader = DBCommand.ExecuteReader();
if(DBReader.Read())
{
item = new()
{
AboutPageID = GetInt("AboutPageID").Value,
AboutPageText = GetString("AboutPageText")
};
}
return item;
}
catch(Exception)
{
throw;
}
finally
{
DisposeConnection();
}
}
}
}

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace Common.Library.DataLayer.DTO.Websites.JasonNeumannAudio.com
{
public class AboutPageDTO
{
public int AboutPageID { get; set;}
public string AboutPageText { get; set; }
}
public class AboutPageDTOCollection : List<AboutPageDTO>{ }
}

@ -5,9 +5,7 @@ VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Library", "Common.Library\Common.Library.csproj", "{0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Library", "Common.Library\Common.Library.csproj", "{0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Library.DAO", "Common.Library.DAO\Common.Library.DAO.csproj", "{05AE0B7C-889C-4EA2-B44E-748BA345135D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Library.DataLayer", "Common.Library.DataLayer\Common.Library.DataLayer.csproj", "{29741C82-C18E-499C-8B7E-360227FD5A68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Library.DTO", "Common.Library.DTO\Common.Library.DTO.csproj", "{04E1D9B0-6AE1-4361-850F-45325D61BD0C}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -34,29 +32,17 @@ Global
{0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x64.Build.0 = Release|Any CPU {0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x64.Build.0 = Release|Any CPU
{0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x86.ActiveCfg = Release|Any CPU {0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x86.ActiveCfg = Release|Any CPU
{0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x86.Build.0 = Release|Any CPU {0D9719C9-8A12-4549-8AFA-A85FF8E16C3A}.Release|x86.Build.0 = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|Any CPU.Build.0 = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|x64.ActiveCfg = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|x64.ActiveCfg = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|x64.Build.0 = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|x64.Build.0 = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|x86.ActiveCfg = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|x86.ActiveCfg = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Debug|x86.Build.0 = Debug|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Debug|x86.Build.0 = Debug|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|Any CPU.ActiveCfg = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|Any CPU.Build.0 = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|Any CPU.Build.0 = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|x64.ActiveCfg = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|x64.ActiveCfg = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|x64.Build.0 = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|x64.Build.0 = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|x86.ActiveCfg = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|x86.ActiveCfg = Release|Any CPU
{05AE0B7C-889C-4EA2-B44E-748BA345135D}.Release|x86.Build.0 = Release|Any CPU {29741C82-C18E-499C-8B7E-360227FD5A68}.Release|x86.Build.0 = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|x64.ActiveCfg = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|x64.Build.0 = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|x86.ActiveCfg = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Debug|x86.Build.0 = Debug|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|Any CPU.Build.0 = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|x64.ActiveCfg = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|x64.Build.0 = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|x86.ActiveCfg = Release|Any CPU
{04E1D9B0-6AE1-4361-850F-45325D61BD0C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

@ -2,14 +2,16 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<PackageId>common-library</PackageId>
<Version>1.0.0</Version>
<Authors>Don Oerkfitz</Authors>
<Company>DMC Dynamics LLC</Company>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="MySql.Data" Version="8.0.22" /> <PackageReference Include="MySql.Data" Version="8.0.22" />
<PackageReference Include="Serilog" Version="2.10.1-dev-01265" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.1-dev-00188" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.2" /> <PackageReference Include="SixLabors.ImageSharp" Version="1.0.2" />
<PackageReference Include="System.Text.Json" Version="5.0.0" /> <PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup> </ItemGroup>

@ -6,12 +6,12 @@ namespace Common.Library.SQL.Base
{ {
protected DBConnectionInformation DBConnectionInfo; protected DBConnectionInformation DBConnectionInfo;
protected enum DBType public enum DBType
{ {
MSSQL, MSSQL,
MYSQL MYSQL
} }
protected struct DBConnectionInformation public struct DBConnectionInformation
{ {
public string DBHost {get;set;} public string DBHost {get;set;}
public string DBName {get;set;} public string DBName {get;set;}

@ -24,6 +24,11 @@ namespace Common.Library.SQL.MySQL
}; };
} }
public MySQL(DBConnectionInformation connectionInformation)
{
DBConnectionInfo = connectionInformation;
}
protected override void InitConnection() protected override void InitConnection()
{ {
DBConnection = new MySqlConnection(DBConnectionInfo.GetConnectionString()); DBConnection = new MySqlConnection(DBConnectionInfo.GetConnectionString());

@ -16,5 +16,17 @@ namespace Common.Library.Settings
public static string DBPassword { get => Configuration?.GetSection("Database")["Password"]; } public static string DBPassword { get => Configuration?.GetSection("Database")["Password"]; }
#endregion #endregion
public static SQL.Base.SQLBase.DBConnectionInformation GetDBConnectionInformation(IConfiguration configuration, SQL.Base.SQLBase.DBType dbType)
{
return new()
{
DBName = configuration?.GetSection("Database")["DBName"],
DBHost = configuration?.GetSection("Database")["Host"],
DBUserName = configuration?.GetSection("Database")["UserName"],
DBPassword = configuration?.GetSection("Database")["Password"],
DBType = dbType
};
}
} }
} }

Loading…
Cancel
Save