private List <TY_ReferendumReportModel> _Select(TY_ReferendumReportQueryModel qmObj) { List <TY_ReferendumReportModel> list = new List <TY_ReferendumReportModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from TY_ReferendumReport "); builder.Append(qmObj.QueryConditionStr); if (qmObj.SortColumns.Length == 0) { builder.Append(" ORDER BY ReferendumReportCode desc"); } else { builder.Append(" ORDER BY " + qmObj.SortColumns); } this._DataProcess.CommandText = builder.ToString(); this._DataProcess.SqlParameters = qmObj.Parameters; SqlDataReader sqlDataReader = null; int num = 0; try { try { sqlDataReader = this._DataProcess.GetSqlDataReader(); while (sqlDataReader.Read()) { if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1))) { TY_ReferendumReportModel model = new TY_ReferendumReportModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <TY_ReferendumReportModel> Select(TY_ReferendumReportQueryModel qmObj) { return(this._Select(qmObj)); }
public List <TY_ReferendumReportModel> Select() { TY_ReferendumReportQueryModel qmObj = new TY_ReferendumReportQueryModel(); return(this._Select(qmObj)); }