public List <CachetTypeManageModel> GetCachetTypeManageList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string CachetNameEqual, string TypeEqual) { List <CachetTypeManageModel> models = new List <CachetTypeManageModel>(); CachetTypeManageQueryModel objQueryModel = new CachetTypeManageQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.CachetNameEqual = CachetNameEqual; objQueryModel.TypeEqual = TypeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new CachetTypeManageBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <CachetTypeManageModel> _Select(CachetTypeManageQueryModel qmObj) { List <CachetTypeManageModel> list = new List <CachetTypeManageModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from CachetTypeManage "); 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))) { CachetTypeManageModel model = new CachetTypeManageModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <CachetTypeManageModel> GetCachetTypeManageList(CachetTypeManageQueryModel QueryModel) { List <CachetTypeManageModel> models = new List <CachetTypeManageModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new CachetTypeManageQueryModel(); } models = new CachetTypeManageBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <CachetTypeManageModel> GetModels(CachetTypeManageQueryModel ObjQueryModel, SqlTransaction Transaction) { CachetTypeManageDAL edal = new CachetTypeManageDAL(Transaction); return(edal.Select(ObjQueryModel)); }
public List <CachetTypeManageModel> Select(CachetTypeManageQueryModel qmObj) { return(this._Select(qmObj)); }
public List <CachetTypeManageModel> Select() { CachetTypeManageQueryModel qmObj = new CachetTypeManageQueryModel(); return(this._Select(qmObj)); }