Beispiel #1
0
        private List <TC_OA_LingYongMenonyModel> _Select(TC_OA_LingYongMenonyQueryModel qmObj)
        {
            List <TC_OA_LingYongMenonyModel> list = new List <TC_OA_LingYongMenonyModel>();
            StringBuilder builder = new StringBuilder();

            builder.Append("select * from TC_OA_LingYongMenony ");
            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)))
                        {
                            TC_OA_LingYongMenonyModel model = new TC_OA_LingYongMenonyModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Beispiel #2
0
 public List <TC_OA_LingYongMenonyModel> Select(TC_OA_LingYongMenonyQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Beispiel #3
0
        public List <TC_OA_LingYongMenonyModel> Select()
        {
            TC_OA_LingYongMenonyQueryModel qmObj = new TC_OA_LingYongMenonyQueryModel();

            return(this._Select(qmObj));
        }