public List <CachetManageModel> GetCachetManageList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserNameEqual, string DeptEqual, string CachetNameEqual, DateTime StartDataEqual, DateTime EndDataEqual, string StateEqual, string TypeEqual) { List <CachetManageModel> models = new List <CachetManageModel>(); CachetManageQueryModel objQueryModel = new CachetManageQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.UserNameEqual = UserNameEqual; objQueryModel.DeptEqual = DeptEqual; objQueryModel.CachetNameEqual = CachetNameEqual; objQueryModel.StartDataEqual = StartDataEqual; objQueryModel.EndDataEqual = EndDataEqual; objQueryModel.StateEqual = StateEqual; objQueryModel.TypeEqual = TypeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new CachetManageBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <CachetManageModel> _Select(CachetManageQueryModel qmObj) { List <CachetManageModel> list = new List <CachetManageModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from CachetManage "); 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))) { CachetManageModel model = new CachetManageModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <CachetManageModel> GetCachetManageList(CachetManageQueryModel QueryModel) { List <CachetManageModel> models = new List <CachetManageModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new CachetManageQueryModel(); } models = new CachetManageBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <CachetManageModel> Select(CachetManageQueryModel qmObj) { return(this._Select(qmObj)); }
public List <CachetManageModel> Select() { CachetManageQueryModel qmObj = new CachetManageQueryModel(); return(this._Select(qmObj)); }
public List <CachetManageModel> GetModels(CachetManageQueryModel ObjQueryModel, SqlTransaction Transaction) { CachetManageDAL edal = new CachetManageDAL(Transaction); return(edal.Select(ObjQueryModel)); }