1.初始化项目。保险起见bin目录完整提交 2.基于现场代码为调整过的初始项目(此次提交还未解决代码差异问题)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace BllSql
|
||||
{
|
||||
// Token: 0x02000002 RID: 2
|
||||
public class BllBase : SqlHelper
|
||||
{
|
||||
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
|
||||
public DataTable ExecuteReadTable(string Sql)
|
||||
{
|
||||
SqlConnection conn = SqlHelper.GetConnection();
|
||||
DataSet ds = SqlHelper.ExecuteDataset(conn, CommandType.Text, Sql);
|
||||
return ds.Tables[0];
|
||||
}
|
||||
|
||||
// Token: 0x06000002 RID: 2 RVA: 0x00002080 File Offset: 0x00000280
|
||||
public int ExecuteNonQuery(string Sql)
|
||||
{
|
||||
SqlConnection conn = SqlHelper.GetConnection();
|
||||
return SqlHelper.ExecuteNonQuery(conn, CommandType.Text, Sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{868BBF99-0044-4AA3-9012-B99D5194F7C2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BllSql</RootNamespace>
|
||||
<AssemblyName>BllSql</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>..\..\..\..\..\Package\dnSpy-net-win64\bin\System.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BllBase.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SqlHelper.cs" />
|
||||
<Compile Include="SqlHelperParameterCache.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyTitle("BllSql")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BllSql")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("11f88c8a-181b-4204-893a-1c2b4348c8d6")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,184 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace BllSql
|
||||
{
|
||||
// Token: 0x02000004 RID: 4
|
||||
public sealed class SqlHelperParameterCache
|
||||
{
|
||||
// Token: 0x06000050 RID: 80 RVA: 0x000020A9 File Offset: 0x000002A9
|
||||
private SqlHelperParameterCache()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000051 RID: 81 RVA: 0x000041DC File Offset: 0x000023DC
|
||||
private static SqlParameter[] DiscoverSpParameterSet(SqlConnection connection, string spName, bool includeReturnValueParameter)
|
||||
{
|
||||
bool flag = connection == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connection");
|
||||
}
|
||||
bool flag2 = spName == null || spName.Length == 0;
|
||||
if (flag2)
|
||||
{
|
||||
throw new ArgumentNullException("spName");
|
||||
}
|
||||
SqlCommand cmd = new SqlCommand(spName, connection);
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
connection.Open();
|
||||
SqlCommandBuilder.DeriveParameters(cmd);
|
||||
connection.Close();
|
||||
bool flag3 = !includeReturnValueParameter;
|
||||
if (flag3)
|
||||
{
|
||||
cmd.Parameters.RemoveAt(0);
|
||||
}
|
||||
SqlParameter[] discoveredParameters = new SqlParameter[cmd.Parameters.Count];
|
||||
cmd.Parameters.CopyTo(discoveredParameters, 0);
|
||||
foreach (SqlParameter discoveredParameter in discoveredParameters)
|
||||
{
|
||||
discoveredParameter.Value = DBNull.Value;
|
||||
}
|
||||
return discoveredParameters;
|
||||
}
|
||||
|
||||
// Token: 0x06000052 RID: 82 RVA: 0x000042AC File Offset: 0x000024AC
|
||||
private static SqlParameter[] CloneParameters(SqlParameter[] originalParameters)
|
||||
{
|
||||
SqlParameter[] clonedParameters = new SqlParameter[originalParameters.Length];
|
||||
int i = 0;
|
||||
int j = originalParameters.Length;
|
||||
while (i < j)
|
||||
{
|
||||
clonedParameters[i] = (SqlParameter)((ICloneable)originalParameters[i]).Clone();
|
||||
i++;
|
||||
}
|
||||
return clonedParameters;
|
||||
}
|
||||
|
||||
// Token: 0x06000053 RID: 83 RVA: 0x000042F0 File Offset: 0x000024F0
|
||||
public static void CacheParameterSet(string connectionString, string commandText, params SqlParameter[] commandParameters)
|
||||
{
|
||||
bool flag = connectionString == null || connectionString.Length == 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connectionString");
|
||||
}
|
||||
bool flag2 = commandText == null || commandText.Length == 0;
|
||||
if (flag2)
|
||||
{
|
||||
throw new ArgumentNullException("commandText");
|
||||
}
|
||||
string hashKey = connectionString + ":" + commandText;
|
||||
SqlHelperParameterCache.paramCache[hashKey] = commandParameters;
|
||||
}
|
||||
|
||||
// Token: 0x06000054 RID: 84 RVA: 0x00004354 File Offset: 0x00002554
|
||||
public static SqlParameter[] GetCachedParameterSet(string connectionString, string commandText)
|
||||
{
|
||||
bool flag = connectionString == null || connectionString.Length == 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connectionString");
|
||||
}
|
||||
bool flag2 = commandText == null || commandText.Length == 0;
|
||||
if (flag2)
|
||||
{
|
||||
throw new ArgumentNullException("commandText");
|
||||
}
|
||||
string hashKey = connectionString + ":" + commandText;
|
||||
SqlParameter[] cachedParameters = SqlHelperParameterCache.paramCache[hashKey] as SqlParameter[];
|
||||
bool flag3 = cachedParameters == null;
|
||||
SqlParameter[] result;
|
||||
if (flag3)
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = SqlHelperParameterCache.CloneParameters(cachedParameters);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Token: 0x06000055 RID: 85 RVA: 0x000043DC File Offset: 0x000025DC
|
||||
public static SqlParameter[] GetSpParameterSet(string connectionString, string spName)
|
||||
{
|
||||
return SqlHelperParameterCache.GetSpParameterSet(connectionString, spName, false);
|
||||
}
|
||||
|
||||
// Token: 0x06000056 RID: 86 RVA: 0x000043F8 File Offset: 0x000025F8
|
||||
public static SqlParameter[] GetSpParameterSet(string connectionString, string spName, bool includeReturnValueParameter)
|
||||
{
|
||||
bool flag = connectionString == null || connectionString.Length == 0;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connectionString");
|
||||
}
|
||||
bool flag2 = spName == null || spName.Length == 0;
|
||||
if (flag2)
|
||||
{
|
||||
throw new ArgumentNullException("spName");
|
||||
}
|
||||
SqlParameter[] spParameterSetInternal;
|
||||
using (SqlConnection connection = new SqlConnection(connectionString))
|
||||
{
|
||||
spParameterSetInternal = SqlHelperParameterCache.GetSpParameterSetInternal(connection, spName, includeReturnValueParameter);
|
||||
}
|
||||
return spParameterSetInternal;
|
||||
}
|
||||
|
||||
// Token: 0x06000057 RID: 87 RVA: 0x00004474 File Offset: 0x00002674
|
||||
internal static SqlParameter[] GetSpParameterSet(SqlConnection connection, string spName)
|
||||
{
|
||||
return SqlHelperParameterCache.GetSpParameterSet(connection, spName, false);
|
||||
}
|
||||
|
||||
// Token: 0x06000058 RID: 88 RVA: 0x00004490 File Offset: 0x00002690
|
||||
internal static SqlParameter[] GetSpParameterSet(SqlConnection connection, string spName, bool includeReturnValueParameter)
|
||||
{
|
||||
bool flag = connection == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connection");
|
||||
}
|
||||
SqlParameter[] spParameterSetInternal;
|
||||
using (SqlConnection clonedConnection = (SqlConnection)((ICloneable)connection).Clone())
|
||||
{
|
||||
spParameterSetInternal = SqlHelperParameterCache.GetSpParameterSetInternal(clonedConnection, spName, includeReturnValueParameter);
|
||||
}
|
||||
return spParameterSetInternal;
|
||||
}
|
||||
|
||||
// Token: 0x06000059 RID: 89 RVA: 0x000044E8 File Offset: 0x000026E8
|
||||
private static SqlParameter[] GetSpParameterSetInternal(SqlConnection connection, string spName, bool includeReturnValueParameter)
|
||||
{
|
||||
bool flag = connection == null;
|
||||
if (flag)
|
||||
{
|
||||
throw new ArgumentNullException("connection");
|
||||
}
|
||||
bool flag2 = spName == null || spName.Length == 0;
|
||||
if (flag2)
|
||||
{
|
||||
throw new ArgumentNullException("spName");
|
||||
}
|
||||
string hashKey = connection.ConnectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter" : "");
|
||||
SqlParameter[] cachedParameters = SqlHelperParameterCache.paramCache[hashKey] as SqlParameter[];
|
||||
bool flag3 = cachedParameters == null;
|
||||
if (flag3)
|
||||
{
|
||||
SqlParameter[] spParameters = SqlHelperParameterCache.DiscoverSpParameterSet(connection, spName, includeReturnValueParameter);
|
||||
SqlHelperParameterCache.paramCache[hashKey] = spParameters;
|
||||
cachedParameters = spParameters;
|
||||
}
|
||||
return SqlHelperParameterCache.CloneParameters(cachedParameters);
|
||||
}
|
||||
|
||||
// Token: 0x04000001 RID: 1
|
||||
private static Hashtable paramCache = Hashtable.Synchronized(new Hashtable());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user