Esempio n. 1
0
 public ActionResult Index(SearchDirectModel search)
 {
     if (search.keySearch != null)
     {
         MyMapSerVices map_services = new MyMapSerVices();
         try
         {
             search.results = map_services.SearchAll(search.keySearch, 1);
         }
         catch (Exception e)
         {
             ViewBag.hasResult = false;
             ViewBag.message   = "Error:" + e.ToString();
         }
         if (search.results == null || search.results.Length == 0)
         {
             ViewBag.hasResult = false;
             ViewBag.message   = "No result!";
             return(View(search));
         }
         else
         {
             ViewBag.hasResult = true;
             return(View(search));
         }
     }
     else
     {
         ViewBag.hasResult = false;
         ViewBag.message   = "search key not found!";
         return(View());
     }
 }
Esempio n. 2
0
        public JsonResult SearchDirect(string keySearch)
        {
            SearchDirectModel search = new SearchDirectModel();

            search.keySearch = keySearch;
            MyMapSerVices map_services = new MyMapSerVices();

            search.results = map_services.SearchAll(search.keySearch, 1);
            return(Json(search, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public JsonResult SearchDirect(string keySearch)
        {
            string errMessage = null;

            SearchDirectModel search = new SearchDirectModel();

            search.keySearch = keySearch;
            MyMapSerVices map_services = new MyMapSerVices();

            try
            {
                search.results = map_services.SearchAll(search.keySearch, 1);
            }
            catch (Exception e)
            {
                errMessage = e.ToString();
            }
            return(Json(search, errMessage, JsonRequestBehavior.AllowGet));
        }