BaoKai_202508-Wms-Jingwang..../WMS.Ctrl/SystemItemDataInfo.cs

57 lines
1.6 KiB
C#
Raw Permalink Normal View History

2025-08-24 09:35:55 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WMS.Business;
namespace WMS.Ctrl
{
public class SystemItemDataInfo
{
public DataTable GetItemInfo(string tableName, Dictionary<string, bool> tableColumn, string sqlWhere, ref string errText)
{
DataTable tableItem = new DataTable();
try
{
string column = string.Empty;
foreach (KeyValuePair<string, bool> col in tableColumn)
{
if (col.Key.Trim().Length > 0)
{
if (column.Trim().Length > 0)
{
column = tableName + "." + col.Key + "," + column;
}
else
{
column = tableName + "." + col.Key;
}
}
}
string Sqlstr = "select " + column + " from " + tableName + " ";
if (sqlWhere != null)
{
if (sqlWhere.Trim().Length > 0)
{
Sqlstr = Sqlstr + sqlWhere;
}
}
tableItem = IBussFactory<WMS.Business.Common.BussCommon>.Instance().GetTable(Sqlstr);
return tableItem;
}
catch (Exception ex)
{
// WMS.Common.LogWriteText.WriteLog("字典控件查询异常" + ex.Message.ToString() );
return null;
}
}
}
}