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 tableColumn, string sqlWhere, ref string errText) { DataTable tableItem = new DataTable(); try { string column = string.Empty; foreach (KeyValuePair 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.Instance().GetTable(Sqlstr); return tableItem; } catch (Exception ex) { // WMS.Common.LogWriteText.WriteLog("字典控件查询异常" + ex.Message.ToString() ); return null; } } } }