Ejemplo n.º 1
0
        public List <GK_OA_CarModel> GetGK_OA_CarList(string SortColumns, int StartRecord, int MaxRecords, string Index_NumLike, string Car_IdLike, string Car_TypeLike, DateTime Buy_DateStartEqual, DateTime Buy_DateEndEqual)
        {
            List <GK_OA_CarModel> models        = new List <GK_OA_CarModel>();
            GK_OA_CarQueryModel   objQueryModel = new GK_OA_CarQueryModel();

            objQueryModel.StartRecord        = StartRecord;
            objQueryModel.MaxRecords         = MaxRecords;
            objQueryModel.SortColumns        = SortColumns;
            objQueryModel.Index_NumLike      = Index_NumLike;
            objQueryModel.Car_IdLike         = Car_IdLike;
            objQueryModel.Car_TypeLike       = Car_TypeLike;
            objQueryModel.Buy_DateStartEqual = Buy_DateStartEqual;
            objQueryModel.Buy_DateEndEqual   = Buy_DateEndEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_CarBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Ejemplo n.º 2
0
        private List <GK_OA_CarModel> _Select(GK_OA_CarQueryModel qmObj)
        {
            List <GK_OA_CarModel> list    = new List <GK_OA_CarModel>();
            StringBuilder         builder = new StringBuilder();

            builder.Append("select * from GK_OA_Car ");
            builder.Append(qmObj.QueryConditionStr);
            if (qmObj.SortColumns.Length == 0)
            {
                builder.Append(" ORDER BY Car_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_CarModel model = new GK_OA_CarModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Ejemplo n.º 3
0
        public List <GK_OA_CarModel> GetGK_OA_CarList(GK_OA_CarQueryModel QueryModel)
        {
            List <GK_OA_CarModel> models = new List <GK_OA_CarModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_CarQueryModel();
                    }
                    models = new GK_OA_CarBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Ejemplo n.º 4
0
        public List <GK_OA_CarModel> GetModels(GK_OA_CarQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OA_CarDAL rdal = new GK_OA_CarDAL(Transaction);

            return(rdal.Select(ObjQueryModel));
        }
Ejemplo n.º 5
0
 public List <GK_OA_CarModel> Select(GK_OA_CarQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Ejemplo n.º 6
0
        public List <GK_OA_CarModel> Select()
        {
            GK_OA_CarQueryModel qmObj = new GK_OA_CarQueryModel();

            return(this._Select(qmObj));
        }