コード例 #1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            matchID = XID.ToString( );

            Themes.Standard.Common_Header sHeader = (Themes.Standard.Common_Header) this.FindControl("sHeader");
            sHeader.title = "比赛中心";

            if (!IsPostBack)
            {
                GameMatchInfo match = webFacade.GetMatchInfo(XID);
                if (match == null)
                {
                    this.form1.Visible      = false;
                    this.divRight.Visible   = true;
                    this.divRight.InnerHtml = "比赛不存在!";

                    return;
                }
                else
                {
                    if (match.ApplyBeginDate > DateTime.Now)
                    {
                        this.form1.Visible      = false;
                        this.divRight.Visible   = true;
                        this.divRight.InnerHtml = "报名时间:" + match.ApplyBeginDate.ToString("yyyy-MM-dd HH:mm") + " 至 " + match.ApplyEndDate.ToString("yyyy-MM-dd HH:mm");
                        return;
                    }
                    if (match.ApplyEndDate < DateTime.Now)
                    {
                        this.form1.Visible      = false;
                        this.divRight.Visible   = true;
                        this.divRight.InnerHtml = "报名已结束!";
                        return;
                    }
                }

                if (Fetch.GetUserCookie( ) != null)
                {
                    this.txtAccounts.Text = Fetch.GetUserCookie( ).Accounts;
                }
            }
        }