/// <summary> /// 根据条件获取数据 /// </summary> /// <param name="userInfo">用户</param> /// <param name="parameters">参数</param> /// <returns>数据表</returns> public DataTable GetDataTableByValues(UserInfo userInfo, List <KeyValuePair <string, object> > parameters) { DataTable dataTable = new DataTable(CustomerClassTable.TableName); using (IDbProvider dbProvider = DbFactoryProvider.GetProvider(BusinessDbType)) { try { dbProvider.Open(BusinessDbConnection); // 根据条件获取数据 CustomerClassManager manager = new CustomerClassManager(dbProvider, userInfo); dataTable = manager.GetDT(parameters); dataTable.TableName = CustomerClassTable.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(CustomerClassTable.TableName); using (IDbProvider dbProvider = DbFactoryProvider.GetProvider(BusinessDbType)) { try { dbProvider.Open(BusinessDbConnection); // 取得列表 CustomerClassManager manager = new CustomerClassManager(dbProvider, userInfo); dataTable = manager.GetDT(new KeyValuePair <string, object>(CustomerClassTable.FieldDeleteMark, 0), CustomerClassTable.FieldSortCode); dataTable.TableName = CustomerClassTable.TableName; } catch (Exception ex) { throw ex; } finally { dbProvider.Close(); } } return(dataTable); }
/// <summary> /// 根据主键数组获取数据 /// </summary> /// <param name="userInfo">用户</param> /// <param name="ids">主鍵</param> /// <returns>数据表</returns> public DataTable GetDataTableByIds(UserInfo userInfo, string[] ids) { DataTable dataTable = new DataTable(CustomerClassTable.TableName); using (IDbProvider dbProvider = DbFactoryProvider.GetProvider(BusinessDbType)) { try { dbProvider.Open(BusinessDbConnection); CustomerClassManager manager = new CustomerClassManager(dbProvider, userInfo); dataTable = manager.GetDT(CustomerClassTable.FieldId, ids, CustomerClassTable.FieldSortCode); dataTable.TableName = CustomerClassTable.TableName; } catch (Exception ex) { throw ex; } finally { dbProvider.Close(); } } return(dataTable); }