Example #1
0
        /// <summary>
        /// 查询车型
        /// </summary>
        /// <param name="series"></param>
        /// <param name="brands"></param>
        /// <param name="excludeVehicleIds"></param>
        /// <param name="minPrice"></param>
        /// <param name="maxPrice"></param>
        /// <returns></returns>
        public Tuple <int, List <VehicleSimpleInfo> > GetVehicles(IEnumerable <string> series,
                                                                  IEnumerable <string> brands, IEnumerable <string> excludeVehicleIds, double minPrice, double maxPrice, int index, int size)
        {
            List <VehicleSimpleInfo> result = null;
            int total = 0;

            try
            {
                var temp = dbReadScopeManager.Execute(conn => DALPackageActivity.SelectVehicles(conn, series,
                                                                                                brands, excludeVehicleIds, minPrice, maxPrice, index, size));
                result = temp.Item2?.ToList();
                total  = temp.Item1;
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message, ex);
            }
            return(Tuple.Create(total, result ?? new List <VehicleSimpleInfo>()));
        }