public IList <T> getRecords(int RecordCount, Conditions conditions, OrderExpression orderExpression) { int num = 0; return(this.getRecords(0, RecordCount, conditions, orderExpression, null, Connector.AND, out num)); }
public IList <T> getRecords(int pageIndex, int pageSize, Conditions conditions, OrderExpression orderExpression, IList <string> conditionExpressions, Connector connector, out int recordCount) { if (pageSize == -1) { pageSize = 999999999; } string text = string.Empty; string sQLStatement = string.Empty; string arg_1C_0 = string.Empty; string text2 = string.Empty; int num = pageSize * pageIndex; text2 = string.Format("select {0} from {1} ", this.m_PKField, this.m_TableName); if ((conditions != null && conditions.ConditionExpressions.Count > 0) || (conditionExpressions != null && conditionExpressions.Count > 0)) { text = this.generateWhereStatementByConditionS(conditions, conditionExpressions, connector); text2 += text; } string text3 = string.Empty; if (orderExpression != null) { text3 = this.generateOrderStatementByCondition(orderExpression); sQLStatement = string.Format("select top {0} * from (select ROW_NUMBER() over ({1}) as RowNumber,* from {2} {3} ) as V_TEMP where V_TEMP.RowNumber>{4}", new object[] { pageSize, text3, this.m_TableName, text, num }); } else { sQLStatement = string.Format("select top {0} * from (select ROW_NUMBER() over ({1}) as RowNumber,* from {2} {3} ) as V_TEMP where V_TEMP.RowNumber>{4}", new object[] { pageSize, " order by " + this.m_PKField, this.m_TableName, text, num }); } IList <T> arg_111_0 = this.getRecordsBySqlStatement(sQLStatement); recordCount = this.GetRecordCountBySQLStatement(text2); return(arg_111_0); }
public IList <T> getRecords(int pageIndex, int pageSize, Conditions conditions, OrderExpression orderExpression) { string text = string.Empty; text = string.Format("select * from {0}", this.m_TableName); if (conditions != null) { text += this.generateWhereStatementByConditionS(conditions); } if (orderExpression != null) { text += this.generateOrderStatementByCondition(orderExpression); } return(this.getRecordsBySqlStatement(text, pageIndex, pageSize)); }
public IList <T> getRecords(int pageIndex, int pageSize, Conditions conditions, OrderExpression orderExpression, string conditionExpression) { if (conditionExpression != null) { conditionExpression = conditionExpression.Trim(); } int num = 0; IList <string> list = null; if (conditionExpression != null && conditionExpression != "") { list = new List <string>(); list.Add(conditionExpression); } return(this.getRecords(pageIndex, pageSize, conditions, orderExpression, list, Connector.AND, out num)); }