示例#1
0
    protected void Page_Init(object sender, EventArgs e)
    {
        if (Request.QueryString["autosharewallpost"] != null && Request.QueryString["autosharewallpost"].ToString().ToLower().Equals("true"))
        {
            CalculatedAutoSharePost = true;
        }

        if (Session["ie6alert"] == null && Request.Browser.IsBrowser("ie") && Request.Browser.MajorVersion == 6)
        {
            ShowOnceOnly.Visible = true;
            Session["ie6alert"] = true;
        }

        FacebookWebContext fbWebContext = FacebookFanfare.FaceBookHelper.GetFBSession();

        if (fbWebContext.UserId > 0)
        {
            ActiveFaceBookUserID = fbWebContext.UserId.ToString();

            FanfareRepository repository = new FanfareRepository();

            decimal amount = repository.HasWonPrize(fbWebContext.UserId);
            if (amount > 0)
            {
                CurrentPrizeWon = amount;
            }
            DataTable entrant = repository.GetEntrant(fbWebContext.UserId);
            if (entrant.Rows.Count > 0)
            {
                CurrentEntrantFirstName = entrant.Rows[0]["UserFirstName"].ToString();
            }

            TotalPrizesAwarded = repository.TotalPrizeWin();
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FanfareRepository fanfareRepository = new FanfareRepository();

        BindEntrants();
        BindWinners();

        decimal prizewin = fanfareRepository.TotalPrizeWin();
        if (prizewin == decimal.Zero)
        {
            prizeLabel.Visible = false;
            noprizeLabel.Visible = true;
        }

        totalWinLabel.Text = prizewin.ToString("C");
    }