Пример #1
0
        public JsonResult HomeSearchJSON2()
        {
            string         querystring   = Request.QueryString.Value;
            IZillowService zillowService = new ZillowService();

            try
            {
                SearchResult resultModel = zillowService.HomeSearchJSON2(querystring);

                return(Json(resultModel));
            }
            catch (Exception ex)
            {
                SearchResult result = new SearchResult();
                result.returnCode    = "-1";
                result.returnMessgae = "Fatal Error: " + ex.Message;
                return(Json(result));
            }
        }
Пример #2
0
        public JsonResult HomeSearchJSON()
        {
            string querystring = Request.QueryString.Value;

            IZillowService zillowService = new ZillowService();

            try
            {
                string  result = zillowService.HomeSearchJSON(querystring);
                JObject json   = JObject.Parse(result);
                //return result;
                return(Json(json));
            }
            catch (Exception ex)
            {
                SearchResult result = new SearchResult();
                result.returnCode    = "-1";
                result.returnMessgae = "Fatal Error: " + ex.Message;
                return(Json(result));
            }
        }
Пример #3
0
        public IActionResult IndexPost(Models.HomeAddress model)
        {
            IZillowService zillowService = new ZillowService();

            try {
                SearchResult resultModel = zillowService.HomeSearch(model);
                if (resultModel.returnCode == "0")
                {
                    return(View("SearchResult", resultModel));
                }
                else
                {
                    return(View("ErrorPage", resultModel));
                }
            }
            catch (Exception ex)
            {
                SearchResult result = new SearchResult();
                result.returnCode    = "-1";
                result.returnMessgae = "Fatal Error: " + ex.Message;
                return(View("ErrorPage", result));
            }
        }