Exemplo n.º 1
0
    protected void ChangeCampaignButton_Click(object sender, EventArgs e)
    {
        if (AppSettings.RevShare.AdPack.EnableAdvertChange)
        {
            for (int i = 0; i < SurfAdsStatsGridView.Rows.Count; i++)
            {
                GridViewRow row       = SurfAdsStatsGridView.Rows[i];
                bool        isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;

                if (isChecked)
                {
                    int    adpackId = Convert.ToInt32(row.Cells[1].Text);
                    AdPack adpack   = new AdPack(adpackId);
                    adpack.AdPacksAdvertId = Convert.ToInt32(ddlCampaigns2.SelectedValue);

                    if (!AdPackManager.HasConstantBanner(adpack.AdPacksAdvertId))
                    {
                        adpack.TotalConstantBannerImpressions = adpack.ConstantBannerImpressionsBought;
                    }
                    if (!AdPackManager.HasNormalBanner(adpack.AdPacksAdvertId))
                    {
                        adpack.TotalNormalBannerImpressions = adpack.NormalBannerImpressionsBought;
                    }

                    adpack.Save();
                }
            }
            SurfAdsStatsGridView.DataBind();
        }
    }
Exemplo n.º 2
0
    protected void PurchaseButton_Click(object sender, EventArgs e)
    {
        SPanel.Visible = false;
        EPanel.Visible = false;

        try
        {
            User = Member.Current;

            int advertId = Convert.ToInt32(CampaignsDropDown.SelectedValue);
            surfAdsPack = new SurfAdsPack(Convert.ToInt32(PacksDropDown.SelectedValue));

            SurfAdsManager.BuySurfAds(advertId, User, surfAdsPack, TargetBalanceRadioButtonList.TargetBalance);

            SPanel.Visible = true;

            SText.Text = U5004.BUYSURFADSSUCCESS;

            SurfAdsStatsGridView.DataBind();
        }
        catch (MsgException ex)
        {
            EPanel.Visible = true;
            EText.Text     = ex.Message;
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
        }
    }
Exemplo n.º 3
0
 protected void View3_Activate(object sender, EventArgs e)
 {
     SurfAdsStatsGridView.DataBind();
 }