Пример #1
0
        public ActionResult List(Guid id)
        {
            User           user     = UserManager.LoadById(id);
            List <Bracket> brackets = BracketManager.Load().Where(b => b.Moderator.Id == user.Id || Authenticate.IsParticipant(b, user)).ToList();

            return(View(brackets));
        }
Пример #2
0
        public ActionResult Results(string searchterm)
        {
            SearchResults  sr         = new SearchResults();
            List <User>    allUsers   = UserManager.Load();
            List <Bracket> allBracket = BracketManager.Load();

            if (searchterm == null)
            {
                searchterm = "";
            }
            sr.SearchTerm = searchterm.ToLower();
            sr.Users      = allUsers.Where(u => u.FullName.ToLower().Contains(searchterm) || u.Username.ToLower().Contains(searchterm));
            sr.Brackets   = allBracket.Where(u => u.Name.ToLower().Contains(searchterm) || u.Game.ToLower().Contains(searchterm));
            if (sr.Users.Count() < 1 && sr.Brackets.Count() < 1)
            {
                ViewBag.Message = "There are no results found with that query";
            }
            return(View(sr));
        }
Пример #3
0
 // GET: Bracket
 public ActionResult Index()
 {
     return(View(BracketManager.Load()));
 }