public List <GK_OA_SubmitAccountMainModel> GetGK_OA_SubmitAccountMainList(string SortColumns, int StartRecord, int MaxRecords, string SystemCodeEqual, string FileCodeEqual, string NameEqual, string DutiesEqual) { List <GK_OA_SubmitAccountMainModel> models = new List <GK_OA_SubmitAccountMainModel>(); GK_OA_SubmitAccountMainQueryModel objQueryModel = new GK_OA_SubmitAccountMainQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.SystemCodeEqual = SystemCodeEqual; objQueryModel.FileCodeEqual = FileCodeEqual; objQueryModel.NameEqual = NameEqual; objQueryModel.DutiesEqual = DutiesEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new GK_OA_SubmitAccountMainBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <GK_OA_SubmitAccountMainModel> _Select(GK_OA_SubmitAccountMainQueryModel qmObj) { List <GK_OA_SubmitAccountMainModel> list = new List <GK_OA_SubmitAccountMainModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from GK_OA_SubmitAccountMain "); 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_SubmitAccountMainModel model = new GK_OA_SubmitAccountMainModel(); 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_SubmitAccountMainModel> GetGK_OA_SubmitAccountMainList(GK_OA_SubmitAccountMainQueryModel QueryModel) { List <GK_OA_SubmitAccountMainModel> models = new List <GK_OA_SubmitAccountMainModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new GK_OA_SubmitAccountMainQueryModel(); } models = new GK_OA_SubmitAccountMainBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <GK_OA_SubmitAccountMainModel> GetModels(GK_OA_SubmitAccountMainQueryModel ObjQueryModel, SqlTransaction Transaction) { GK_OA_SubmitAccountMainDAL ndal = new GK_OA_SubmitAccountMainDAL(Transaction); return(ndal.Select(ObjQueryModel)); }
public List <GK_OA_SubmitAccountMainModel> Select(GK_OA_SubmitAccountMainQueryModel qmObj) { return(this._Select(qmObj)); }
public List <GK_OA_SubmitAccountMainModel> Select() { GK_OA_SubmitAccountMainQueryModel qmObj = new GK_OA_SubmitAccountMainQueryModel(); return(this._Select(qmObj)); }