/// <summary>
        /// 查询小区价格趋势
        /// </summary>
        /// <returns>小区价格趋势,总页数</returns>
        public IEnumerable<object> Get()
        {
            int totalPage = 0;
            List<NeighborhoodPriceTrend> result = new List<NeighborhoodPriceTrend>();

            var queryString = Request.GetQueryNameValuePairs();
            var queryConditions = new NeighborhoodPriceTrendQueryConditions();
            queryConditions.GetValues(queryString);

            NeighborhoodPriceTrendFunction neighborhoodPriceTrendFunction = new NeighborhoodPriceTrendFunction();
            neighborhoodPriceTrendFunction.QueryNeighborhoodPriceTrend(queryConditions, out result, out totalPage);

            List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } };
            return objectResult;
        }
        /// <summary>
        /// 删除小区价格趋势
        /// </summary>
        /// <param name="entity">小区价格趋势</param>
        public HttpResponseMessage Delete([FromBody]NeighborhoodPriceTrend entity)
        {
            if (entity == null)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                NeighborhoodPriceTrendFunction neighborhoodPriceTrendFunction = new NeighborhoodPriceTrendFunction();
                int error = neighborhoodPriceTrendFunction.DeleteNeighborhoodPriceTrend(entity);
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
        }
        /// <summary>
        /// 删除小区价格趋势
        /// </summary>
        /// <param name="neighborhood">小区</param>
        public HttpResponseMessage Delete(string neighborhood)
        {
            if (string.IsNullOrEmpty(neighborhood))
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                var entity = new NeighborhoodPriceTrend() { Neighborhood = neighborhood };
                NeighborhoodPriceTrendFunction neighborhoodPriceTrendFunction = new NeighborhoodPriceTrendFunction();
                int error = neighborhoodPriceTrendFunction.DeleteNeighborhoodPriceTrend(entity);
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
        }
        /// <summary>
        /// 查询单个小区价格趋势
        /// </summary>
        /// <param name="neighborhood">小区</param>
        /// <returns>小区价格趋势,总页数</returns>
        public IEnumerable<object> Get(string neighborhood)
        {
            int totalPage = 0;
            List<NeighborhoodPriceTrend> result = new List<NeighborhoodPriceTrend>();

            var queryConditions = new NeighborhoodPriceTrendQueryConditions() { Neighborhood = neighborhood };

            NeighborhoodPriceTrendFunction neighborhoodPriceTrendFunction = new NeighborhoodPriceTrendFunction();
            neighborhoodPriceTrendFunction.QueryNeighborhoodPriceTrend(queryConditions, out result, out totalPage);

            List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } };
            return objectResult;
        }
        /// <summary>
        /// 新增小区价格趋势
        /// </summary>
        /// <param name="auto">是否添加当前小区均价到价格趋势</param>
        public HttpResponseMessage Post(int auto)
        {
            if (auto == 1)
            {
                NeighborhoodPriceTrendFunction neighborhoodPriceTrendFunction = new NeighborhoodPriceTrendFunction();
                int error = neighborhoodPriceTrendFunction.AddCurrentNeighborhoodPriceTrends();
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
            else
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
        }