feat: 更新业务及控件功能
This commit is contained in:
@@ -373,7 +373,8 @@ namespace Lskj.Business.Impl
|
||||
.Replace("#", "%23")
|
||||
.Replace("%2f", "/")
|
||||
.Replace("(", "%ef%bc%88")
|
||||
.Replace(")", "%ef%bc%89");
|
||||
.Replace(")", "%ef%bc%89")
|
||||
.Replace(" ", "%20");
|
||||
|
||||
// 完全参数化 SQL,彻底杜绝 SQL 注入!
|
||||
sqlValue = @"SELECT * FROM P_fm_FileTab
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -926,15 +926,7 @@ namespace Lskj.Business.Impl
|
||||
{
|
||||
string field = string.Empty;
|
||||
|
||||
DataTable dataTable;
|
||||
try
|
||||
{
|
||||
dataTable = InitialParamCache.GetTableColumns("p_systembillsourcecond", delegate { return GetTableColumns("p_systembillsourcecond"); });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
dataTable = GetTableColumns("p_systembillsourcecond");
|
||||
}
|
||||
DataTable dataTable = GetTableColumns("p_systembillsourcecond");
|
||||
|
||||
if (dataTable.Columns.Contains("FontSize"))
|
||||
{
|
||||
@@ -1150,16 +1142,7 @@ namespace Lskj.Business.Impl
|
||||
switch (type)
|
||||
{
|
||||
case ModuleType.MrpClickBtn:
|
||||
bool isMrpClickBtnExists;
|
||||
try
|
||||
{
|
||||
isMrpClickBtnExists = InitialParamCache.GetColumnExists("P_systempopupmenu", "isMrpClickBtn", "int", delegate { return BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int"); });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isMrpClickBtnExists = BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int");
|
||||
}
|
||||
if (isMrpClickBtnExists)
|
||||
if (BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int"))
|
||||
{
|
||||
where = " and isnull(isMrpClickBtn,0)=1 and visible1=0 ";
|
||||
}
|
||||
@@ -1581,19 +1564,7 @@ namespace Lskj.Business.Impl
|
||||
//保存条件表
|
||||
public static DataTable GetClientCond(string MenuCode)
|
||||
{
|
||||
const string tableName = "P_SystemClientCondTab";
|
||||
bool tableExists;
|
||||
try
|
||||
{
|
||||
tableExists = InitialParamCache.GetTableExists(tableName, delegate { return BaseImpl.HasExistsTable(tableName); });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 缓存未能正常读取或记录时,重新查询,避免影响原有功能。
|
||||
tableExists = BaseImpl.HasExistsTable(tableName);
|
||||
}
|
||||
|
||||
if (tableExists)
|
||||
if (BaseImpl.HasExistsTable("P_SystemClientCondTab"))
|
||||
{
|
||||
string sqlValue = string.Format(@"select * from P_SystemClientCondTab where tab='{0}' and disableflag=0 order by orderid ", MenuCode);
|
||||
return GetDataTableResult(sqlValue);
|
||||
|
||||
@@ -340,8 +340,9 @@ namespace Lskj.Business
|
||||
ResourceDynamic.PubBrower = System.Environment.OSVersion.Version.Major == 5 && (System.Environment.OSVersion.Version.Minor == 1 || System.Environment.OSVersion.Version.Minor == 2) ? "Lskj.PubBrowerXp.dll" : "Lskj.PubBrower2.dll";
|
||||
}
|
||||
Instance.IsSpecialAuditSave = item.Table.Columns.Contains("IsSpecialAuditSave") && !string.IsNullOrEmpty(item["IsSpecialAuditSave"] + "") ? "1".Equals(item["IsSpecialAuditSave"] + "") : false;
|
||||
Instance.SuppressImportSuccessTip = item.Table.Columns.Contains("SuppressImportSuccessTip") && !string.IsNullOrEmpty(item["SuppressImportSuccessTip"] + "") ? "1".Equals(item["SuppressImportSuccessTip"] + "") : false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 高拍仪AccessKey
|
||||
@@ -1179,5 +1180,9 @@ namespace Lskj.Business
|
||||
/// P_MessageToolLinkDllTab表中cardId=-99为通用模块(右侧快捷通道通用模块) 2023-12-4 徐成说的cardId=-99的配置
|
||||
/// </summary>
|
||||
//public DataTable DefaultPermissionTable;
|
||||
/// <summary>
|
||||
/// 导入成功不会提示,直接关闭导入框(失败时还是会提示)
|
||||
/// </summary>
|
||||
public bool SuppressImportSuccessTip;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user