示例#1
0
        public IHttpActionResult GetPriceOfCondoBI(SearchMap searchDto)
        {
            var                  repos      = new TDAssetRespository();
            SetionType           sectionT   = new SetionType();
            GetPriceBI           resultList = new GetPriceBI();
            List <string>        data       = null;
            List <BarchartValue> value      = null;
            List <BarchartValue> value2     = null;
            BarchartValue        barValue   = null;
            var                  barchart   = new Barchart();
            int                  row        = 0;

            var estimateData = repos.GetPriceOfCondoBI(searchDto);

            resultList.EstimateData = estimateData.OrderByDescending(o => Converting.ToDecimal(o.ParcelPriceMax)).ToList();
            if (estimateData != null)
            {
                data   = new List <string>();
                value  = new List <BarchartValue>();
                value2 = new List <BarchartValue>();

                foreach (EstimateData result in estimateData.OrderByDescending(o => Converting.ToDecimal(o.ParcelPriceMax)))
                {
                    if (row >= overMax)
                    {
                        break;
                    }


                    barValue       = new BarchartValue();
                    barValue.name  = result.DisplayName;
                    barValue.value = Converting.ToDecimal(result.ParcelPriceMax);
                    barValue.key   = result.DisplayCode;


                    value.Add(barValue);


                    barValue       = new BarchartValue();
                    barValue.name  = result.DisplayName;
                    barValue.value = Converting.ToDecimal(result.MarketPriceMax);
                    barValue.key   = result.DisplayCode;
                    value2.Add(barValue);



                    data.Add(result.DisplayName);

                    row++;
                }

                barchart.Data   = data;
                barchart.Value  = value;
                barchart.Value2 = value2;
            }

            resultList.Barchart = barchart;

            return(Json(resultList));
        }