feat: 更新业务及控件功能

This commit is contained in:
cyf
2026-08-21 17:21:18 +08:00
parent d3587a16f1
commit dd58f12374
16 changed files with 220 additions and 86 deletions
+24 -15
View File
@@ -101,11 +101,14 @@ namespace Lskj.Business.Impl
/// <returns><c>true</c> if [has contain column]; otherwise, <c>false</c>.</returns>
public static bool HasExistsColumn(string tableName, string colName, string colType)
{
if (!HasExistsColumn(tableName, colName))
return InitialParamCache.GetColumnExists(tableName, colName, colType, delegate
{
return ExecSqlValue(string.Format("ALTER TABLE {0} ADD {1} {2}", tableName, colName, colType)) > 0;
}
return true;
if (!HasExistsColumn(tableName, colName))
{
return ExecSqlValue(string.Format("ALTER TABLE {0} ADD {1} {2}", tableName, colName, colType)) > 0;
}
return true;
});
}
/// <summary>
/// <para>说明:是否存在xxx表</para>
@@ -120,15 +123,18 @@ namespace Lskj.Business.Impl
/// <returns><c>true</c> if [has exists table] [the specified table name]; otherwise, <c>false</c>.</returns>
public static bool HasExistsTable(string tableName)
{
try
return InitialParamCache.GetTableExists(tableName, delegate
{
string sqlValue = "select 1 from " + tableName + " where 1<>1";
return SqlHelper.ExecuteDataTable(sqlValue).Rows.Count >= 0;
}
catch (Exception)
{
}
return false;
try
{
string sqlValue = "select 1 from " + tableName + " where 1<>1";
return SqlHelper.ExecuteDataTable(sqlValue).Rows.Count >= 0;
}
catch (Exception)
{
}
return false;
});
}
/// <summary>
@@ -973,8 +979,11 @@ namespace Lskj.Business.Impl
/// <returns>DataTable.</returns>
public static DataTable GetTableColumns(string tableName)
{
string sqlValue = string.Format("select * from {0} where 1<>1", tableName);
return SqlHelper.ExecuteDataTable(sqlValue);
return InitialParamCache.GetTableColumns(tableName, delegate
{
string sqlValue = string.Format("select * from {0} where 1<>1", tableName);
return SqlHelper.ExecuteDataTable(sqlValue);
});
}
/// <summary>
/// <para>说明:执行SQL语句返回结果集</para>
@@ -1252,4 +1261,4 @@ namespace Lskj.Business.Impl
}
}
}