コード例 #1
0
    public Contests_Environment()
        : base(MenuItem.Contests)
    {
        VerifyQueryString("name", name => db.Contests.Any(c => c.UrlName == name), "Contest not found");

        VerifyQueryString("name", name => db.Contests.Any(c => c.UrlName == name &&
                                                          SqlMethods.DateDiffSecond(c.StartTime, DateTime.UtcNow) > 0), "Contest has not started.");

        VerifyQueryString("name", name => FudgeUser.IsRegisteredFor(Contest.ContestId), "You are not registered for this contest.");
    }
コード例 #2
0
ファイル: View.aspx.cs プロジェクト: fudge-project/fudge
 protected void Page_Load(object sender, EventArgs e)
 {
     Title += ".Contests." + Contest.Name + ".Details";
     if (Contest.IsRunning)
     {
         contestTip.Text       = "Contest is running.";
         contestTip.IsClosable = false;
         if (FudgeUser != null && FudgeUser.IsRegisteredFor(Contest.ContestId) && !Contest.HasEnded)
         {
             contestTip.Text += String.Format(" Click {0} to enter", Html.Link("/Contests/Environment/" + Contest.UrlName, "here"));
         }
         contestTip.Show();
     }
     else if (Contest.HasEnded)
     {
         contestTip.Text       = "Contest has ended.";
         contestTip.IsClosable = false;
         contestTip.Show();
     }
 }