Exemple #1
0
        public IHttpActionResult GetPOIDetail(string object_id, string radius, string parcel_type, string changwatCode, string chanod_no)
        {
            var tdRepo = new TDAssetRespository();

            dynamic o;

            if (parcel_type == "1") //CHANOD
            {
                o = tdRepo.GetChanodDetail(object_id, changwatCode, chanod_no);
            }
            else if (parcel_type == "2") //NS3K
            {
                o = tdRepo.GetNS3KDetail(object_id, changwatCode, chanod_no);
            }
            else
            {
                return(NotFound());
            }

            var data = new
            {
                PARCEL_TYPE   = GetParcelTypeName(Convert.ToString(o.PARCEL_TYPE)),
                UTMMAP1       = Convert.ToString(o.UTMMAP1),
                UTMMAP3       = Convert.ToString(o.UTMMAP3),
                SURVEY_NO     = Convert.ToInt16(o.SURVEY_NO),
                CHANOD_NO     = Convert.ToInt16(o.CHANOD_NO),
                LAND_NO       = Convert.ToInt16(o.LAND_NO),
                BRANCH_CODE   = Convert.ToString(o.BRANCH_CODE),
                CHANGWAT_CODE = o.CHANGWAT_CODE,
                CHANGWAT_NAME = o.CHANGWAT_NAME,
                AMPHUR_CODE   = o.AMPHUR_CODE,
                AMPHUR_NAME   = o.AMPHUR_NAME,
                TUMBON_CODE   = o.TUMBON_CODE,
                TUMBON_NAME   = o.TUMBON_NAME,
                NRAI          = Convert.ToInt16(o.NRAI),
                NNHAN         = Convert.ToInt16(o.NNHAN),
                NWAH          = Convert.ToInt16(o.NWAH),
                DREMAIN       = Convert.ToDecimal(o.DREMAIN),
                PASS_THROUGH  = "100%",
                OWNERS        = 0,
                VAL_AMT       = string.Format("{0:N2}", Convert.ToDecimal(o.VAL_AMT)),
            };

            return(Json(data));
        }