コード例 #1
0
        public ActionResult ViewGameAttendance()
        {
            var userInfo = Session["Users"] as Users;
            List <GameAttendance> games = attendance.getGameAttendaned();
            //get the list of users for only that team
            List <Users> users = usersBLL.GetUsers().FindAll(m => m.TeamID == userInfo.TeamID);
            //create a new list to store attendance for only that team
            List <GameAttendance> viewAttendanceByTeam = new List <GameAttendance>();

            //for each user in the coaches team
            foreach (Users user in users)
            {
                //find the users attendance
                GameAttendance game = games.Find(m => m.UserID == user.UserID);
                //add to list that sorts attendance by team
                viewAttendanceByTeam.Add(game);
            }
            return(View(viewAttendanceByTeam));
        }
コード例 #2
0
        public List <GameAttendance> GetAttendance() // gets a list of users who have attended the class
        {
            List <GameAttendance> games = attendanceBLL.getGameAttendaned();

            return(games);
        }