Example #1
0
    private void ShowProperIframe()
    {
        PublishersWebsite publishersWebsite = null;

        if (WebsitesDDL.Items.Count > 0)
        {
            publishersWebsite = new PublishersWebsite(Convert.ToInt32(WebsitesDDL.SelectedValue));

            if (publishersWebsite.Status == PublishersWebsiteStatus.Accepted)
            {
                string iframeHtml = string.Format("<iframe src='{0}api/externalcpaoffer.aspx?{1}={2}&{3}={{username}}' width='{4}' height='{5}'></iframe>",
                                                  AppSettings.Site.Url, GlobalPostback.Parameters.PublishersWebsiteId,
                                                  publishersWebsite.Id, GlobalPostback.Parameters.SubId, Convert.ToInt32(WidthTextBox.Text),
                                                  Convert.ToInt32(HeightTextBox.Text));


                IframeLiteral.Text                   = HttpUtility.HtmlEncode(iframeHtml).Replace("{username}", "<span class='text-info'>{username}</span>");
                IframeLiteral.Text                   = HttpUtility.HtmlEncode(iframeHtml);
                IFramePlaceHolder.Visible            = true;
                IFrameUnavailablePlaceHolder.Visible = false;
                PreviewPlaceHolder.Visible           = true;
            }
            else
            {
                IFramePlaceHolder.Visible            = false;
                IFrameUnavailablePlaceHolder.Visible = true;
                PreviewPlaceHolder.Visible           = false;
            }
        }
    }
Example #2
0
    private void ShowProperIframe()
    {
        PublishersWebsite publishersWebsite = null;

        if (WebsitesDDL.Items.Count > 0)
        {
            publishersWebsite = new PublishersWebsite(Convert.ToInt32(WebsitesDDL.SelectedValue));

            if (publishersWebsite.Status == PublishersWebsiteStatus.Accepted)
            {
                string iframeHtml = string.Format("<script src='{0}Handlers/InText/GetAds.ashx?{1}={2}'></script>",
                                                  AppSettings.Site.Url, GlobalPostback.Parameters.PublishersWebsiteId, publishersWebsite.Id);

                JSLiteral.Text = HttpUtility.HtmlEncode(iframeHtml);

                IFramePlaceHolder.Visible            = true;
                IFrameUnavailablePlaceHolder.Visible = false;
            }
            else
            {
                IFramePlaceHolder.Visible            = false;
                IFrameUnavailablePlaceHolder.Visible = true;
            }
        }
    }
Example #3
0
    protected void WebsitesDDL_Init(object sender, EventArgs e)
    {
        var websites  = PublishersWebsite.GetActiveAndPendingWebsites(Member.CurrentId);
        var listItems = new List <ListItem>();

        WebsitesDDL.Controls.Clear();
        int?firstActiveId = null;

        for (int i = 0; i < websites.Count; i++)
        {
            if (firstActiveId == null && websites[i].Status == PublishersWebsiteStatus.Accepted)
            {
                firstActiveId = websites[i].Id;
            }

            listItems.Add(
                new ListItem
            {
                Value = websites[i].Id.ToString(),
                Text  = websites[i].Host + " (" + websites[i].Status.ToString() + ")",
            });
        }

        WebsitesDDL.Items.AddRange(listItems.ToArray());

        if (websites.Count > 0 && firstActiveId != null)
        {
            WebsitesDDL.SelectedValue = firstActiveId.ToString();
        }

        ShowProperIframe();
    }
Example #4
0
    protected void AddPostbackUrlButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                ErrorMessagePanel.Visible   = false;
                SuccessMessagePanel.Visible = false;
                var website = new PublishersWebsite(Convert.ToInt32(WebsitesDDL.SelectedValue));

                website.AddPostbackUrl(PostbackUrlTextBox.Text);

                SuccessMessagePanel.Visible = true;
                SuccessMessage.Text         = U6000.SUCCESSADDINGPOSTBACKURL;
            }
            catch (Exception ex)
            {
                if (ex is MsgException)
                {
                    ErrorMessagePanel.Visible = true;
                    ErrorMessage.Text         = ex.Message;
                }
                else
                {
                    ErrorLogger.Log(ex.Message, LogType.Publisher);
                }
            }
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AccessManager.RedirectIfDisabled(AppSettings.TitanFeatures.PublishersRoleEnabled && AppSettings.TitanFeatures.PublishBannersEnabled && Member.CurrentInCache.IsPublisher);

            ErrorMessagePanel.Visible   = false;
            SuccessMessagePanel.Visible = false;

            GetCodePlaceHolder.Visible =
                PublishersWebsite.ActiveOrPendingWebsiteExists(Member.CurrentId) &&
                TableHelper.RowExists(ExternalBannerAdvertDimensions.TableName, TableHelper.MakeDictionary("Status", (int)UniversalStatus.Active));

            if (!GetCodePlaceHolder.Visible)
            {
                GetCodeUnavailable.Visible    = true;
                GetCodeUnavailable.HeaderText = U6003.PUBLISHBANNERSUNAVAILABLEHEADER;
                GetCodeUnavailable.Reason     = U6003.PUBLISHBANNERSUNAVAILABLEREASON;
            }
            else
            {
                GetCodeUnavailable.Visible = false;
            }
        }
    }
Example #6
0
    private void ShowProperIframe()
    {
        try
        {
            ExternalBannerAdvertDimensions dimensions = null;

            PublishersWebsite publishersWebsite = null;

            if (WebsitesDDL.Items.Count > 0 && DimensionsDDL.Items.Count > 0)
            {
                dimensions        = new ExternalBannerAdvertDimensions(Convert.ToInt32(DimensionsDDL.SelectedValue));
                publishersWebsite = new PublishersWebsite(Convert.ToInt32(WebsitesDDL.SelectedValue));

                if (publishersWebsite.Status == PublishersWebsiteStatus.Accepted)
                {
                    string iframeHtml = string.Format("<iframe src='{0}api/externalbanner.aspx?d={1}&{2}={3}' width='{4}px' height='{5}' scrolling='no'></iframe>",
                                                      AppSettings.Site.Url, dimensions.Id, GlobalPostback.Parameters.PublishersWebsiteId, publishersWebsite.Id, dimensions.Width, dimensions.Height);
                    IframeLiteral.Text                   = HttpUtility.HtmlEncode(iframeHtml);
                    IFramePlaceHolder.Visible            = true;
                    IFrameUnavailablePlaceHolder.Visible = false;
                }
                else
                {
                    IFramePlaceHolder.Visible            = false;
                    IFrameUnavailablePlaceHolder.Visible = true;
                }
            }
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
            ErrorLogger.Log(ex.Message, LogType.Publisher);
        }
    }
Example #7
0
    public static void Create(PublishersWebsite website, int offerId, string externalUsername, string loginId, string emailId, string subId2,
                              string subId3, string ip, string countryCode, Money payout)
    {
        var ExternalCpaOfferSubmission = new ExternalCpaOfferSubmission(website.UserId, offerId, website.Id, externalUsername,
                                                                        loginId, emailId, subId2, subId3, ip, countryCode, payout);

        ExternalCpaOfferSubmission.Save();
    }
Example #8
0
    protected void PostbackUrlsDDL_Init(object sender, EventArgs e)
    {
        var webistes = PublishersWebsite.GetActiveWithPostbackUrls(Member.CurrentId);

        foreach (var w in webistes)
        {
            PostbackUrlsDDL.Items.Add(new ListItem(w.PostbackUrl, w.PostbackUrl));
        }
    }
Example #9
0
 public PTCOfferWallManager(string host, string countryCode, string externalUsername,
                            int publishersWebsiteId, bool isMobile, string age = null, string gender = null)
 {
     PublishersWebsite     = PublishersWebsite.GetActiveWebsite(host, publishersWebsiteId);
     this.countryCode      = countryCode;
     this.age              = age.ToNullableInt();
     this.externalUsername = externalUsername;
     this.isMobile         = isMobile;
     if (!Enum.TryParse(gender, true, out this.Gender))
     {
         this.Gender = Gender.Null;
     }
 }
Example #10
0
    public static void Create(int userId, string url, int categoryId)
    {
        var website = GetUsersWebsite(userId, url);

        if (website == null)
        {
            website = new PublishersWebsite(userId, url, categoryId);
            website.Save();
        }
        else
        {
            website.UserUpdate(url, categoryId);
        }
    }
Example #11
0
    protected void GetCodeView_Activate(object sender, EventArgs e)
    {
        GetCodePlaceHolder.Visible = PublishersWebsite.ActiveOrPendingWebsiteExists(Member.CurrentId);

        if (!GetCodePlaceHolder.Visible)
        {
            GetCodeUnavailable.Visible = true;
            GetCodeUnavailable.Reason  = U6000.NOWEBSITES;
        }
        else
        {
            GetCodeUnavailable.Visible = false;
        }
    }
Example #12
0
    protected void TestPostbackView_Activate(object sender, EventArgs e)
    {
        TestPostbackPlaceHolder.Visible = PublishersWebsite.AreAnyActiveWithPostbackUrls(Member.CurrentId);

        if (!TestPostbackPlaceHolder.Visible)
        {
            TestPostbackUnavailable.Visible    = true;
            TestPostbackUnavailable.HeaderText = U6000.TESTPOSTBACKUNAVAILABLEHEADER;
            TestPostbackUnavailable.Reason     = U6000.TESTPOSTBACKUNAVAILABLEREASON;
        }
        else
        {
            TestPostbackUnavailable.Visible = false;
        }
    }
Example #13
0
    private void ShowHideContent()
    {
        GetCodePlaceHolder.Visible =
            PublishersWebsite.ActiveOrPendingWebsiteExists(Member.CurrentId);

        if (!GetCodePlaceHolder.Visible)
        {
            GetCodeUnavailable.Visible = true;
            GetCodeUnavailable.Reason  = U6000.NOWEBSITES;
        }
        else
        {
            GetCodeUnavailable.Visible = false;
        }
    }
Example #14
0
        public PTCOfferWallSubmisson(int ptcOfferWallId, string ptcOfferWallTitle, int publishersWebsiteId, string externalUsername, string subId2,
                                     string subId3, string ip, string countryCode, Gender gender = Prem.PTC.Members.Gender.Null, int?age = null)
        {
            this.publishersWebsite = new PublishersWebsite(publishersWebsiteId);
            this.ptcOfferWallId    = ptcOfferWallId;
            this.externalUsername  = externalUsername;
            this.ptcOfferWallTitle = ptcOfferWallTitle;

            this.subId2      = subId2;
            this.subId3      = subId3;
            this.ip          = ip;
            this.countryCode = countryCode;
            this.gender      = gender;
            this.age         = age.HasValue ? age.Value : -1;
        }
Example #15
0
    public static void ChangeAllStatuses(IEnumerable <int> websitesIds, PublishersWebsiteStatus status)
    {
        foreach (var websiteId in websitesIds)
        {
            var website = new PublishersWebsite(websiteId);

            if (status == PublishersWebsiteStatus.Accepted)
            {
                website.Accept();
            }
            else if (status == PublishersWebsiteStatus.Rejected)
            {
                website.Reject();
            }
        }
    }
Example #16
0
 private GlobalPostback(GlobalPostbackType globalPostbackType, int offerId, string offerTitle, int publishersWebsiteId, string externalUsername, string subId2,
                        string subId3, string ip, string countryCode, Money payout, Gender gender = Prem.PTC.Members.Gender.Null, int age = -1)
 {
     Url                 = new PublishersWebsite(publishersWebsiteId).PostbackUrl;
     OfferId             = offerId.ToString();
     OfferName           = offerTitle;
     Ip                  = ip;
     CountryCode         = countryCode;
     SubId               = externalUsername;
     Payout              = payout;
     CurrencyCode        = AppSettings.Site.CurrencyCode;
     SubId2              = subId2;
     SubId3              = subId3;
     Status              = PostbackStatus.Notsent;
     SendAttempts        = 0;
     PublishersWebsiteId = publishersWebsiteId;
     Age                 = age;
     Gender              = gender;
     GlobalPostbackType  = globalPostbackType;
 }
Example #17
0
    protected void AddWebsiteButton_Click(object sender, EventArgs e)
    {
        ErrorMessagePanel.Visible   = false;
        SuccessMessagePanel.Visible = false;
        try
        {
            if (Page.IsValid)
            {
                AppSettings.DemoCheck();

                if (WebsiteUrlTextBox.Enabled)
                {
                    throw new MsgException(U4200.CHECKURL);
                }

                PublishersWebsite.Create(Member.CurrentId, WebsiteUrlTextBox.Text, Convert.ToInt32(CategoriesDDL.SelectedValue));

                SuccessMessagePanel.Visible = true;
                SuccessMessage.Text         = U6000.REQUESTSENTPLEASEWAIT;
                ClearNewWebsiteFields(true);
            }
        }
        catch (Exception ex)
        {
            if (ex is MsgException)
            {
                ErrorMessagePanel.Visible = true;
                ErrorMessage.Text         = ex.Message;
            }
            else
            {
                ErrorLogger.Log(ex);
            }
            ClearNewWebsiteFields(false);
        }
    }
Example #18
0
 public ExternalBannerAdvertCache(PublishersWebsite publishersWebsite, int dimensionsId)
 {
     this.publishersWebsite = publishersWebsite;
     this.dimensionsId      = dimensionsId;
 }
Example #19
0
 public ExternalOfferWallsManager(string host, int publishersWebsiteId, string countryCode, bool isPreview = false)
 {
     PublishersWebsite = PublishersWebsite.GetActiveWebsite(host, publishersWebsiteId, isPreview);
     CpaOffers         = GetTitanOffers(countryCode, isPreview);
 }
Example #20
0
 public ExternalBannerManager(string host, int dimensionsId, int publishersWebsiteId)
 {
     PublishersWebsite = PublishersWebsite.GetActiveWebsite(host, publishersWebsiteId);
     Banner            = GetBanner(dimensionsId);
 }