コード例 #1
0
        public JsonResult AjaxSearch(String searchBy)
        {
            List <object> dataReturned = new List <object>();

            Models.Tournament tournament = new Models.Tournament(service, -1);
            tournament.Search(JsonConvert.DeserializeObject <Dictionary <String, String> >(searchBy));

            foreach (TournamentModel tourny in tournament.searched)
            {
                dataReturned.Add(new
                {
                    id                 = tourny.TournamentID,
                    title              = tourny.Title,
                    game               = tourny.GameType.Title,
                    platform           = tourny.Platform != null ? tourny.Platform.PlatformName : "None",
                    startDate          = tourny.TournamentStartDate.ToShortDateString(),
                    publicRegistration = tourny.PublicRegistration,
                    publicViewing      = tourny.PublicViewing,
                    link               = Url.Action("Tournament", "Tournament", new { guid = tourny.TournamentID })
                });

                data = new
                {
                    search = dataReturned
                };
            }

            return(BundleJson());
        }
コード例 #2
0
        public ActionResult Search(Dictionary <String, String> searchBy)
        {
            Models.Tournament model = new Models.Tournament(service, -1);
            model.Search(searchBy);

            return(View("Search", model));
        }