public WSResponse GetRecipientCount(long MyUserId) { FanfareRepository repository = new FanfareRepository(); int result = repository.CurrentShareCount(MyUserId); return new WSResponse(1, result); }
protected void Page_Load(object sender, EventArgs e) { FanfareRepository repository = new FanfareRepository(); FacebookWebContext context = FaceBookHelper.GetFBSession(); if (FaceBookHelper.IsCurrentPageLike()) { if(FaceBookHelper.IsAuthorised() && FaceBookHelper.IsPromotionPostLaunch()) { if (repository.HasWonPrize(context.UserId) > 0) { Server.Transfer("Result.aspx"); } } // Only do logic if the promotion is active. if (FaceBookHelper.IsPromotionActive() && FaceBookHelper.IsAuthorised()) { if (repository.HasWonPrize(context.UserId) > 0) { Server.Transfer("Result.aspx"); } if (repository.HasEnteredComp(context.UserId)) { if (repository.CurrentShareCount(context.UserId) >= 5) { Server.Transfer("SharesDone.aspx"); } Server.Transfer("Share.aspx"); } if (FaceBookHelper.IsAuthorised()) { Server.Transfer("Register.aspx"); } } } if (FaceBookHelper.IsPromotionActive()) { BindEntrants(); BindWinners(); } }