public List <T> FindListPage <T>(string WhereSql, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(WhereSql); return(SqlServerHelper.GetPageList <T>(builder.ToString(), orderField, orderType, pageIndex, pageSize, ref recordCount)); }
public T FindEntityByWhere <T>(string WhereSql) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(1); builder.Append(WhereSql); return(DatabaseReader.ReaderToModel <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }
public List <T> FindList <T>(string WhereSql, DbParameter[] parameters) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(WhereSql); return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters))); }
public List <T> FindListPage <T>(string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount, out string querySql) where T : new() { string strSql = DatabaseCommon.SelectSql <T>().ToString(); querySql = string.IsNullOrEmpty(orderField) == true ? strSql : strSql + " order by " + orderField + " " + orderType; return(SqlServerHelper.GetPageList <T>(strSql, orderField, orderType, pageIndex, pageSize, ref recordCount)); }
public DataTable FindTable <T>(string WhereSql) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(WhereSql); return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }
public Hashtable FindHashtable(string tableName, StringBuilder WhereSql, DbParameter[] parameters) { StringBuilder builder = DatabaseCommon.SelectSql(tableName, 1); builder.Append(WhereSql); return(DatabaseReader.ReaderToHashtable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters))); }
public DataTable FindTablePage <T>(string WhereSql, DbParameter[] parameters, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(WhereSql); return(SqlServerHelper.GetPageTable(builder.ToString(), parameters, orderField, orderType, pageIndex, pageSize, ref recordCount)); }
public List <T> FindListTop <T>(int Top, string WhereSql) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(Top); builder.Append(WhereSql); return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }
public DataTable FindTableTop <T>(int Top, string WhereSql, DbParameter[] parameters) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(Top); builder.Append(WhereSql); return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters))); }
public List <T> FindListPage <T>(string WhereSql, DbParameter[] parameters, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount, out string querySql) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(WhereSql); string strSql = builder.ToString(); querySql = string.IsNullOrEmpty(orderField) == true ? strSql : strSql + " order by " + orderField + " " + orderType; return(SqlServerHelper.GetPageList <T>(strSql, parameters, orderField, orderType, pageIndex, pageSize, ref recordCount)); }
public Hashtable FindHashtable(string tableName, string propertyName, object propertyValue) { StringBuilder builder = DatabaseCommon.SelectSql(tableName, 1); builder.Append(" AND ").Append(propertyName).Append("=").Append(DbHelper.DbParmChar + propertyName); IList <DbParameter> source = new List <DbParameter> { DbFactory.CreateDbParameter(DbHelper.DbParmChar + propertyName, propertyValue) }; return(DatabaseReader.ReaderToHashtable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>()))); }
public List <T> FindListTop <T>(int Top, string propertyName, string propertyValue) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(Top); builder.Append(" AND " + propertyName + " = " + DbHelper.DbParmChar + propertyName); IList <DbParameter> source = new List <DbParameter> { DbFactory.CreateDbParameter(DbHelper.DbParmChar + propertyName, propertyValue) }; return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>()))); }
public T FindEntity <T>(string propertyName, object propertyValue) where T : new() { string str = propertyName; StringBuilder builder = DatabaseCommon.SelectSql <T>(); builder.Append(" AND ").Append(str).Append("=").Append(DbHelper.DbParmChar + str); IList <DbParameter> source = new List <DbParameter> { DbFactory.CreateDbParameter(DbHelper.DbParmChar + str, propertyValue) }; return(DatabaseReader.ReaderToModel <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>()))); }
public DataTable FindTableTop <T>(int Top) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(Top); return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }
public DataTable FindTablePage <T>(string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new() { return(SqlServerHelper.GetPageTable(DatabaseCommon.SelectSql <T>().ToString(), orderField, orderType, pageIndex, pageSize, ref recordCount)); }
public DataTable FindTable <T>(List <string> queryField) where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(queryField); return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }
public List <T> FindList <T>() where T : new() { StringBuilder builder = DatabaseCommon.SelectSql <T>(); return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString()))); }