/// <summary> /// 根据主键数组获取数据 /// </summary> /// <param name="userInfo">用户</param> /// <param name="ids">主鍵</param> /// <returns>数据表</returns> public DataTable GetDataTableByIds(UserInfo userInfo, string[] ids) { DataTable dataTable = new DataTable(IncomingCallTable.TableName); using (IDbProvider dbProvider = DbFactoryProvider.GetProvider(BusinessDbType)) { try { dbProvider.Open(BusinessDbConnection); IncomingCallManager manager = new IncomingCallManager(dbProvider, userInfo); dataTable = manager.GetDT(IncomingCallTable.FieldId, ids, IncomingCallTable.FieldSortCode); dataTable.TableName = IncomingCallTable.TableName; } catch (Exception ex) { throw ex; } finally { dbProvider.Close(); } } return(dataTable); }
/// <summary> /// 取得数据表 /// </summary> /// <param name="userInfo">用户</param> /// <returns>数据表</returns> public DataTable GetDataTable(UserInfo userInfo) { DataTable dataTable = new DataTable(IncomingCallTable.TableName); using (IDbProvider dbProvider = DbFactoryProvider.GetProvider(BusinessDbType)) { try { dbProvider.Open(BusinessDbConnection); // 取得列表 IncomingCallManager manager = new IncomingCallManager(dbProvider, userInfo); dataTable = manager.GetDT(new KeyValuePair <string, object>(IncomingCallTable.FieldDeleteMark, 0), IncomingCallTable.FieldSortCode); dataTable.TableName = IncomingCallTable.TableName; } catch (Exception ex) { throw ex; } finally { dbProvider.Close(); } } return(dataTable); }