Exemple #1
0
        private void FillGameTable(Player member)
        {
            IEnumerable <Game> query          = CurrentPool.Games.OrderBy(game => game.Date);
            DateTime           comingGameDate = (DateTime)Session[Constants.GAME_DATE];

            if (comingGameDate == null)
            {
                return;
            }
            String admin = this.Request.Params[Constants.ADMIN];

            foreach (Game game in query)
            {
                if (admin == null && game.Date <= comingGameDate)
                {
                    continue;
                }
                TableRow  row      = new TableRow();
                TableCell dateCell = new TableCell();
                dateCell.Text = game.Date.ToString("ddd, MMM d, yyyy");
                row.Cells.Add(dateCell);
                TableCell statusCell = new TableCell();
                statusCell.HorizontalAlign = HorizontalAlign.Right;
                ImageButton imageBtn = new ImageButton();
                imageBtn.ID       = member.Id + "," + game.Date.ToShortDateString();
                imageBtn.ImageUrl = CurrentPool.GetMemberAttendance(member.Id, game.Date) ? "~/Icons/In.png" : "~/Icons/Out.png";
                imageBtn.Width    = new Unit(Constants.IMAGE_BUTTON_SIZE);
                imageBtn.Height   = new Unit(Constants.IMAGE_BUTTON_SIZE);
                imageBtn.Click   += new ImageClickEventHandler(MemberChangeAttendance_Click);
                //  imageBtn.CssClass = "imageBtn";
                statusCell.Controls.Add(imageBtn);
                row.Cells.Add(statusCell);
                this.GameTable.Rows.Add(row);
            }
        }