SVN r1103
SVN-Revision: r1103
This commit is contained in:
@@ -16,7 +16,7 @@ using Lskj.Model;
|
||||
using Lskj.Core;
|
||||
using Lskj.Util;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Lskj.Business.Impl
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace Lskj.Business.Impl
|
||||
try
|
||||
{
|
||||
string sqlValue = string.Format("select OBJECT_ID(N'{0}', N'P') ", Name);
|
||||
return !string.IsNullOrWhiteSpace(SqlHelper.ExecuteScalar(sqlValue)+"");
|
||||
return !string.IsNullOrWhiteSpace(SqlHelper.ExecuteScalar(sqlValue) + "");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static int ExecSqlValue(string sqlValue, params SqlParameter[] parameters)
|
||||
public static int ExecSqlValue(string sqlValue, params SqlParameter[] parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -556,7 +556,7 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public static int ExecSqlValue(string sqlValue, SqlTransaction Trans, params SqlParameter[] parameters)
|
||||
public static int ExecSqlValue(string sqlValue, DbTransaction Trans, params SqlParameter[] parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -594,9 +594,8 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public static int ExecProcedure(string sqlValue, params SqlParameter[] parameters)
|
||||
public static int ExecProcedure(string sqlValue, params DbParameter [] parameters)
|
||||
{
|
||||
|
||||
return SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, sqlValue, parameters);
|
||||
|
||||
}
|
||||
@@ -612,7 +611,7 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <param name="parameters">The parameters.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public static int ExecProcedure(string sqlValue, SqlTransaction Trans, params SqlParameter[] parameters)
|
||||
public static int ExecProcedure(string sqlValue, DbTransaction Trans, params DbParameter[] parameters)
|
||||
{
|
||||
|
||||
return SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, sqlValue, Trans, 1, parameters);
|
||||
@@ -757,6 +756,44 @@ namespace Lskj.Business.Impl
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 替换特殊字符 {#p_
|
||||
/// </summary>
|
||||
/// <param name="defaultValue"></param>
|
||||
/// <param name="parentValue"></param>
|
||||
/// <param name="otherParams"></param>
|
||||
/// <returns></returns>
|
||||
public static string SpecialReplacement(string defaultValue,string[] otherParams = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(defaultValue)) return defaultValue;
|
||||
|
||||
if (defaultValue.ToLower().Contains("{#p_"))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> paramList = ReplaceHelper.GetParamFields(defaultValue);
|
||||
|
||||
foreach (var item in paramList)
|
||||
{
|
||||
string index = item.Replace("{#p_", "").Replace("}", "");
|
||||
int i = 0;
|
||||
if (int.TryParse(index, out i))
|
||||
{
|
||||
defaultValue = defaultValue.Replace(item, otherParams != null ? otherParams[i - 1] : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:获取记录</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -809,9 +846,9 @@ namespace Lskj.Business.Impl
|
||||
/// </summary>
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static object GetResult(string sqlValue, SqlTransaction Trans)
|
||||
public static object GetResult(string sqlValue, DbTransaction Trans)
|
||||
{
|
||||
return SqlHelper.ExecuteScalar(sqlValue, Trans, 1, 1);
|
||||
return SqlHelper.ExecuteScalar(sqlValue, Trans);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -983,11 +1020,12 @@ namespace Lskj.Business.Impl
|
||||
/// </summary>
|
||||
/// <param name="sqlValue">The SQL value.</param>
|
||||
/// <returns>SqlDataAdapter.</returns>
|
||||
public static SqlDataAdapter GetAdapterResult(string sqlValue)
|
||||
public static DbDataAdapter GetAdapterResult(string sqlValue)
|
||||
{
|
||||
DbDataAdapter dbDataAdapter = SqlHelper.dbFactory.CreateDataAdapter();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sqlValue)) return new SqlDataAdapter();
|
||||
if (string.IsNullOrWhiteSpace(sqlValue)) return dbDataAdapter;
|
||||
sqlValue = GetDefaultValue(sqlValue);
|
||||
sqlValue = ReplaceHelper.ReplaceParam(sqlValue);
|
||||
return SqlHelper.ExecuteAdapter(CommandType.Text, sqlValue);
|
||||
@@ -995,7 +1033,7 @@ namespace Lskj.Business.Impl
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return new SqlDataAdapter();
|
||||
return dbDataAdapter;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:获取打印配置</para>
|
||||
@@ -1051,7 +1089,7 @@ namespace Lskj.Business.Impl
|
||||
/// <param name="tagid"></param>
|
||||
/// <param name="mid"></param>
|
||||
/// <returns></returns>
|
||||
public static int deleteFlow(int tagid, string Dllcode, string stepCode, int typeID, out string tipMsg, SqlTransaction Trans)
|
||||
public static int deleteFlow(int tagid, string Dllcode, string stepCode, int typeID, out string tipMsg, DbTransaction Trans)
|
||||
{
|
||||
SqlParameter pMsg = new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
||||
pMsg.Direction = ParameterDirection.Output;
|
||||
|
||||
Reference in New Issue
Block a user