public List <GK_OA_InFileAuditingMainModel> GetGK_OA_InFileAuditingMainList(string SortColumns, int StartRecord, int MaxRecords, string SystemCodeEqual, string FileCodeEqual, string StatusEqual) { List <GK_OA_InFileAuditingMainModel> models = new List <GK_OA_InFileAuditingMainModel>(); GK_OA_InFileAuditingMainQueryModel objQueryModel = new GK_OA_InFileAuditingMainQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.SystemCodeEqual = SystemCodeEqual; objQueryModel.FileCodeEqual = FileCodeEqual; objQueryModel.StatusEqual = StatusEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new GK_OA_InFileAuditingMainBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <GK_OA_InFileAuditingMainModel> _Select(GK_OA_InFileAuditingMainQueryModel qmObj) { List <GK_OA_InFileAuditingMainModel> list = new List <GK_OA_InFileAuditingMainModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from GK_OA_InFileAuditingMain "); builder.Append(qmObj.QueryConditionStr); if (qmObj.SortColumns.Length == 0) { builder.Append(" ORDER BY Code 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))) { GK_OA_InFileAuditingMainModel model = new GK_OA_InFileAuditingMainModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <GK_OA_InFileAuditingMainModel> GetGK_OA_InFileAuditingMainList(GK_OA_InFileAuditingMainQueryModel QueryModel) { List <GK_OA_InFileAuditingMainModel> models = new List <GK_OA_InFileAuditingMainModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new GK_OA_InFileAuditingMainQueryModel(); } models = new GK_OA_InFileAuditingMainBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <GK_OA_InFileAuditingMainModel> Select(GK_OA_InFileAuditingMainQueryModel qmObj) { return(this._Select(qmObj)); }
public List <GK_OA_InFileAuditingMainModel> Select() { GK_OA_InFileAuditingMainQueryModel qmObj = new GK_OA_InFileAuditingMainQueryModel(); return(this._Select(qmObj)); }
public List <GK_OA_InFileAuditingMainModel> GetModels(GK_OA_InFileAuditingMainQueryModel ObjQueryModel, SqlTransaction Transaction) { GK_OA_InFileAuditingMainDAL ndal = new GK_OA_InFileAuditingMainDAL(Transaction); return(ndal.Select(ObjQueryModel)); }