Exemple #1
0
        public ActionResult Index()
        {
            if (Session["Username"] != null)
            {
                PlayerLogic playerLogic = new PlayerLogic();
                Session["UserID"] = playerLogic.GetUserID((string)Session["UserName"]);

                GroupLogic   groupLogic = new GroupLogic();
                List <Group> groups     = new List <Group>();

                List <int> GroupsOfUser = groupLogic.GetGroupIdsFromPlayer((int)Session["UserID"]);
                foreach (int i in GroupsOfUser)
                {
                    groups.Add(groupLogic.GetGroupDetails(i));
                }

                ViewBag.groups = groups;
                return(View());
            }
            return(RedirectToAction("Login", "Player"));
        }