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

            builder.Append("select * from GK_OAPersonPolity ");
            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_OAPersonPolityModel model = new GK_OAPersonPolityModel();
                            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 <GK_OAPersonPolityModel> GetGK_OAPersonPolityList(GK_OAPersonPolityQueryModel QueryModel)
        {
            List <GK_OAPersonPolityModel> models = new List <GK_OAPersonPolityModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OAPersonPolityQueryModel();
                    }
                    models = new GK_OAPersonPolityBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #3
0
        public List <GK_OAPersonPolityModel> GetGK_OAPersonPolityList(string SortColumns, int StartRecord, int MaxRecords, string PersonIDEqual)
        {
            List <GK_OAPersonPolityModel> models        = new List <GK_OAPersonPolityModel>();
            GK_OAPersonPolityQueryModel   objQueryModel = new GK_OAPersonPolityQueryModel();

            objQueryModel.StartRecord   = StartRecord;
            objQueryModel.MaxRecords    = MaxRecords;
            objQueryModel.SortColumns   = SortColumns;
            objQueryModel.PersonIDEqual = PersonIDEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OAPersonPolityBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #4
0
        public List <GK_OAPersonPolityModel> GetModels(GK_OAPersonPolityQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OAPersonPolityDAL ydal = new GK_OAPersonPolityDAL(Transaction);

            return(ydal.Select(ObjQueryModel));
        }
Beispiel #5
0
 public List <GK_OAPersonPolityModel> Select(GK_OAPersonPolityQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Beispiel #6
0
        public List <GK_OAPersonPolityModel> Select()
        {
            GK_OAPersonPolityQueryModel qmObj = new GK_OAPersonPolityQueryModel();

            return(this._Select(qmObj));
        }