Example #1
0
        public IHttpActionResult GetPriceBI(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.GetPriceBI(searchDto);

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

                row = 0;
                foreach (EstimateData result in estimateData.OrderByDescending(o => Converting.ToDecimal(o.ParcelWAHPriceMax))
                         .ThenBy(c => c.MarketWAHPriceMax).ThenBy(c => c.DisplayName))
                {
                    if (row >= overMax)
                    {
                        break;
                    }
                    barValue       = new BarchartValue();
                    barValue.name  = result.DisplayName;
                    barValue.value = Converting.ToDecimal(result.ParcelWAHPriceMax);
                    barValue.key   = result.DisplayCode;


                    value.Add(barValue);


                    barValue       = new BarchartValue();
                    barValue.name  = result.DisplayName;
                    barValue.value = Converting.ToDecimal(result.MarketWAHPriceMax);
                    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));
        }
        public IHttpActionResult GetAllProjectImpactBI(SearchMap searchDto)
        {
            var repos = new TDAssetRespository();

            GetProjectImpacteBI  resultList = new GetProjectImpacteBI();
            List <string>        data       = null;
            List <BarchartValue> value      = null;
            List <BarchartValue> value2     = null;
            BarchartValue        barValue   = null;
            var barchart = new Barchart();
            int row      = 0;

            if (searchDto.SectionType == SetionType.Region)
            {
                searchDto.RegionCode = searchDto.Code;
            }
            else if (searchDto.SectionType == SetionType.Provice)
            {
                searchDto.ProvinceCode = searchDto.Code;
            }
            var estimateData = repos.GetPROJECT_IMPACT(searchDto);

            if (estimateData != null)
            {
                resultList.EstimateData = estimateData.OrderByDescending(o => o.ParcelTotal).ToList();

                data   = new List <string>();
                value  = new List <BarchartValue>();
                value2 = new List <BarchartValue>();

                foreach (PROJECT_IMPACTDto result in estimateData.OrderByDescending(o => o.ParcelTotal))
                {
                    if (row >= overMax)
                    {
                        break;
                    }


                    barValue       = new BarchartValue();
                    barValue.name  = result.SUBJECT_NAME;
                    barValue.value = Converting.ToDecimal(result.ParcelTotal);
                    barValue.key   = result.SUBJECT_ID;


                    value.Add(barValue);


                    barValue       = new BarchartValue();
                    barValue.name  = result.SUBJECT_NAME;
                    barValue.value = Converting.ToDecimal(result.Area);
                    barValue.key   = result.SUBJECT_ID;
                    value2.Add(barValue);



                    data.Add(result.SUBJECT_NAME);

                    row++;
                }

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

            resultList.Barchart = barchart;


            return(Json(resultList));
        }
Example #3
0
        public IHttpActionResult GetPriceOfConstructionBI(SearchMap searchDto)
        {
            var                   repos      = new TDAssetRespository();
            SetionType            sectionT   = new SetionType();
            int                   row        = 0;
            GetPriceBI            resultList = new GetPriceBI();
            List <string>         data       = null;
            List <BarchartValue>  value      = null;
            List <BarchartValue2> value2     = null;
            BarchartValue         barValue   = null;
            BarchartValue2        barValue3  = null;
            var                   barchart   = new Barchart();


            var estimateData = repos.GetPriceOfConstrucionBI(searchDto);

            resultList.EstimateData = resultList.EstimateData = estimateData.OrderByDescending(o => Converting.ToDecimal(o.ParcelPrice)).ToList();

            if (estimateData != null)
            {
                data   = new List <string>();
                value  = new List <BarchartValue>();
                value2 = new List <BarchartValue2>();

                foreach (EstimateData result in estimateData.OrderByDescending(o => Converting.ToDecimal(o.ParcelPrice)))
                {
                    if (row >= overMax)
                    {
                        break;
                    }
                    barValue       = new BarchartValue();
                    barValue.name  = result.DisplayName;
                    barValue.value = Converting.ToDecimal(result.ParcelPrice);
                    barValue.key   = result.DisplayCode;


                    value.Add(barValue);



                    //  { xAxis: 0, y: 350, name: 'Line', symbolSize: 20, symbol: 'image://../asset/ico/折线图.png' }
                    barValue3            = new BarchartValue2();
                    barValue3.xAxis      = 0;
                    barValue3.y          = 350;
                    barValue3.name       = result.DisplayName;
                    barValue3.symbolSize = 20;
                    barValue3.symbol     = "";

                    barValue3.key = result.DisplayCode;
                    value2.Add(barValue3);



                    data.Add(result.DisplayName);


                    row++;
                }

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

            resultList.Barchart = barchart;


            return(Json(resultList));
        }