예제 #1
0
        //private FedFor01Context db = new FedFor01Context();

        // GET: RECDATAs
        public ActionResult Index()
        {
            var t = Task.Run(() => AwaitOperatorCustom.curlRequestAsync(usersearch: null, offset: 0, usercount: 50, state: null, sort: null, activity: null));

            t.Wait();
            return(View(t.Result));
        }
예제 #2
0
        public ActionResult FacilityMapSearch()
        {
            var t = Task.Run(() => AwaitOperatorCustom.curlRequestAsync(usersearch: null, offset: 0, usercount: 0, state: null, sort: null, activity: null));

            t.Wait();
            return(View(t.Result));


            //int offset = 0;
            //void IncreaseOffset()
            //{
            //    offset = offset + 50;
            //}
        }
예제 #3
0
        public ActionResult FacilitySearch(string search, string searchnumber, string stateinitial, string sort, string activity, string offset)
        {
            int searchnumberint = 50;

            if (string.IsNullOrEmpty(searchnumber) == false)
            {
                searchnumberint = Int32.Parse(searchnumber);
            }

            int offsetVal = 0;

            if (string.IsNullOrEmpty(offset) == false)
            {
                offsetVal = Int32.Parse(offset);
            }

            var t = Task.Run(() => AwaitOperatorCustom.curlRequestAsync(usersearch: search, offset: offsetVal, usercount: searchnumberint, state: stateinitial, sort: sort, activity: activity));

            t.Wait();
            return(View(t.Result));
        }
예제 #4
0
        public ActionResult Facility(string lat, string lng, string search, string searchnumber, string stateinitial, string sort, string[] activity, string offset)
        {
            ViewBag.Message = "find a site.";

            ViewBag.offsetnumber = offset;

            switch (sort)
            {
            case "Name":
                ViewBag.NameSelect = "selected";
                break;

            case "ID":
                ViewBag.IDSelect = "selected";
                break;

            case "Date":
                ViewBag.DateSelect = "selected";
                break;
            }

            string activitystring = "";

            if (activity?.Length > 0)
            {
                StringBuilder builder = new StringBuilder();
                int           i       = 1;
                foreach (string value in activity)
                {
                    if (i == activity.Length) //Use count or length as supported by your collection
                    {
                        builder.Append(value);
                    }
                    else
                    {
                        builder.Append(value);
                        builder.Append(',');
                        i++;
                    }
                }
                activitystring = builder.ToString();
            }

            int searchnumberint = 50;

            if (string.IsNullOrEmpty(searchnumber) == false)
            {
                searchnumberint = Int32.Parse(searchnumber);
            }

            int offsetVal = 0;

            if (string.IsNullOrEmpty(offset) == false)
            {
                offsetVal = Int32.Parse(offset);
            }

            ViewBag.lat = lat;
            ViewBag.lng = lng;

            var t = Task.Run(() => AwaitOperatorCustom.curlReloadAsync(usersearch: search, offset: offsetVal, usercount: searchnumberint, state: stateinitial, sort: sort, activity: activitystring, lat: lat, lng: lng));

            t.Wait();
            ViewBag.count = t.Result.Count.ToString();
            return(View(t.Result));
        }
예제 #5
0
        public ActionResult FacilityMapSearch(string search, string searchnumber, string stateinitial, string sort, string[] activity, string offset)
        {
            ViewBag.offsetnumber = offset;
            ViewBag.searchnumber = 10;

            switch (sort)
            {
            case "Name":
                ViewBag.NameSelect = "selected";
                break;

            case "ID":
                ViewBag.IDSelect = "selected";
                break;

            case "Date":
                ViewBag.DateSelect = "selected";
                break;
            }

            switch (searchnumber)
            {
            case "10":
                ViewBag.searchnumber10 = "selected";
                break;

            case "25":
                ViewBag.searchnumber25 = "selected";
                break;

            case "50":
                ViewBag.searchnumber50 = "selected";
                break;
            }

            string activitystring = "";

            if (activity?.Length > 0)
            {
                StringBuilder builder = new StringBuilder();
                int           i       = 1;
                foreach (string value in activity)
                {
                    if (i == activity.Length) //Use count or length as supported by your collection
                    {
                        builder.Append(value);
                    }
                    else
                    {
                        builder.Append(value);
                        builder.Append(',');
                        i++;
                    }
                }
                activitystring = builder.ToString();
            }

            int searchnumberint = 10;

            if (string.IsNullOrEmpty(searchnumber) == false)
            {
                searchnumberint      = Int32.Parse(searchnumber);
                ViewBag.searchnumber = searchnumber;
            }

            int offsetVal = 0;

            if (string.IsNullOrEmpty(offset) == false)
            {
                offsetVal = Int32.Parse(offset);
            }

            var t = Task.Run(() => AwaitOperatorCustom.curlRequestAsync(usersearch: search, offset: offsetVal, usercount: searchnumberint, state: stateinitial, sort: sort, activity: activitystring));

            t.Wait();
            return(View(t.Result));

            //int offset = 0;
            //void IncreaseOffset()
            //{
            //    offset = offset + 50;
            //}
        }