public List <GK_OA_OilModel> GetGK_OA_OilList(string SortColumns, int StartRecord, int MaxRecords, string IndexNumLike, string Car_idLike, DateTime GetDateStartEqual, DateTime GetDateEndEqual) { List <GK_OA_OilModel> models = new List <GK_OA_OilModel>(); GK_OA_OilQueryModel objQueryModel = new GK_OA_OilQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.Car_idLike = Car_idLike; objQueryModel.GetDateStartEqual = GetDateStartEqual; objQueryModel.GetDateEndEqual = GetDateEndEqual; objQueryModel.IndexNumLike = IndexNumLike; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new GK_OA_OilBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <GK_OA_OilModel> _Select(GK_OA_OilQueryModel qmObj) { List <GK_OA_OilModel> list = new List <GK_OA_OilModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from GK_OA_Oil "); 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_OilModel model = new GK_OA_OilModel(); 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_OilModel> GetGK_OA_OilList(GK_OA_OilQueryModel QueryModel) { List <GK_OA_OilModel> models = new List <GK_OA_OilModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new GK_OA_OilQueryModel(); } connection.Open(); models = new GK_OA_OilBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <GK_OA_OilModel> GetModels(GK_OA_OilQueryModel ObjQueryModel, SqlTransaction Transaction) { GK_OA_OilDAL ldal = new GK_OA_OilDAL(Transaction); return(ldal.Select(ObjQueryModel)); }
public List <GK_OA_OilModel> Select(GK_OA_OilQueryModel qmObj) { return(this._Select(qmObj)); }
public List <GK_OA_OilModel> Select() { GK_OA_OilQueryModel qmObj = new GK_OA_OilQueryModel(); return(this._Select(qmObj)); }