Beispiel #1
0
    protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            BannerAdvert BannerAd = new BannerAdvert(Convert.ToInt32(e.Row.Cells[1].Text));

            //Image [4]
            var Imag = new Image();
            Imag.ImageUrl       = e.Row.Cells[4].Text;
            Imag.Height         = Unit.Percentage(33);
            e.Row.Cells[4].Text = "";
            e.Row.Cells[4].Controls.Add(Imag);

            //Shorten url [3]
            if (e.Row.Cells[3].Text.Length > 39)
            {
                e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, 36) + "...";
            }

            //End mode [14]
            End.Mode Mode = (End.Mode)Convert.ToInt32(e.Row.Cells[14].Text);

            //Status [15]
            AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[15].Text);
            e.Row.Cells[15].Text = HtmlCreator.GetColoredStatus(Status);

            //Remove [18]
            if (!Status.CanBeRemoved())
            {
                e.Row.Cells[18].Text = " ";
            }

            //Paused = APPROVED
            if (Status == AdvertStatus.Paused)
            {
                e.Row.Cells[15].Text = "<span style=\"color:#\">" + U4000.APPROVED + "</span>";
            }
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Cells[12].Text = AppSettings.BannerAdverts.ImpressionsEnabled ? L1.IMPRESSIONS : L1.CLICKS;
        }
    }
Beispiel #2
0
    protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //The ad id [1]
            TrafficExchangeAdvert Ad = new TrafficExchangeAdvert(Convert.ToInt32(e.Row.Cells[1].Text));

            //Description [22]
            if (string.IsNullOrEmpty(e.Row.Cells[22].Text))
            {
                e.Row.Cells[22].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }
            else
            {
                e.Row.Cells[22].Text = HtmlCreator.GetCheckboxCheckedImage();
            }

            //End mode [16]
            End.Mode Mode = (End.Mode)Convert.ToInt32(e.Row.Cells[16].Text);

            //Status [24]
            AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[24].Text);
            e.Row.Cells[24].Text = HtmlCreator.GetColoredStatus(Status);

            //Subpages [25]
            e.Row.Cells[25].Text = "0";
            var splist = TableHelper.SelectRows <TrafficExchangeSubpage>(TableHelper.MakeDictionary("PtcAdId", Ad.Id));
            if (splist.Count > 0)
            {
                e.Row.Cells[25].Text = splist.Count + " (hover)";
                foreach (var elem in splist)
                {
                    e.Row.Cells[25].ToolTip += Ad.TargetUrl + elem.SubPage + "\n";
                }
            }

            //Pack [3]
            AdvertPack Pack = new TrafficExchangeAdvertPack(Convert.ToInt32(e.Row.Cells[3].Text));

            //Displaytime [17]
            e.Row.Cells[17].Text += "s";

            //Shorten url [4]
            if (e.Row.Cells[4].Text.Length > 18)
            {
                e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, 15) + "...";
            }

            //TItle [5]
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&lt;", "<");
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&gt;", ">");

            //Progress [11]
            e.Row.Cells[11].Text = HtmlCreator.GenerateAdProgressHTML(Ad).Replace("clicks", L1.CLICKSSMALL).Replace("days", L1.DAYS);

            //Geolocation check [23]
            if (Ad.IsGeolocated)
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxCheckedImage();
            }
            else
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }

            //Add % progress [12]
            e.Row.Cells[12].Text = Ad.ProgressInPercent.ToString() + "%";

            //Add total views [13]
            e.Row.Cells[13].Text = e.Row.Cells[14].Text;

            // Start[27] Pause[28] Add [29] Remove[31]
            if (Status != AdvertStatus.Paused)
            {
                e.Row.Cells[27].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Active)
            {
                e.Row.Cells[28].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Finished)
            {
                e.Row.Cells[29].Text = "&nbsp;";
            }

            if (!Status.CanBeRemoved())
            {
                e.Row.Cells[31].Text = "&nbsp;";
            }
        }
    }
Beispiel #3
0
    protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            BannerAdvert BannerAd = new BannerAdvert(Convert.ToInt32(e.Row.Cells[1].Text));

            //Image [4]
            var Imag = new Image();
            Imag.ImageUrl = e.Row.Cells[4].Text;
            Imag.Height   = Unit.Percentage(33);

            e.Row.Cells[4].Text = "";
            e.Row.Cells[4].Controls.Add(Imag);

            //Shorten url [3]
            if (e.Row.Cells[3].Text.Length > 19)
            {
                e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, 16) + "...";
            }

            //End mode [15]
            End.Mode Mode = (End.Mode)Convert.ToInt32(e.Row.Cells[15].Text);

            //Pack [2]
            BannerAdvertPack Pack = new BannerAdvertPack(Convert.ToInt32(e.Row.Cells[2].Text));

            //Status [16]
            AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[16].Text);
            e.Row.Cells[16].Text = HtmlCreator.GetColoredStatus(Status);

            //Progress [10]
            e.Row.Cells[10].Text =
                HtmlCreator.GenerateAdProgressHTML(BannerAd).Replace("Clicks", L1.CLICKSSMALL).Replace("days", L1.DAYS);

            if (AppSettings.BannerAdverts.ImpressionsEnabled)
            {
                e.Row.Cells[10].Text = e.Row.Cells[10].Text.Replace(L1.CLICKSSMALL, L1.IMPRESSIONSSMALL);
            }

            //% [11]
            e.Row.Cells[11].Text = BannerAd.ProgressInPercent.ToString() + "%";

            //start [20] stop [21] remove[22]
            if (Status != AdvertStatus.Paused)
            {
                e.Row.Cells[20].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Active)
            {
                e.Row.Cells[21].Text = "&nbsp;";
            }

            if (!Status.CanBeRemoved())
            {
                e.Row.Cells[22].Text = "&nbsp;";
            }

            //geo [19]

            if (BannerAd.IsGeolocated)
            {
                e.Row.Cells[19].Text = HtmlCreator.GetCheckboxCheckedImage();
            }
            else
            {
                e.Row.Cells[19].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Cells[13].Text = AppSettings.BannerAdverts.ImpressionsEnabled ? L1.IMPRESSIONS : L1.CLICKS;
        }
    }
Beispiel #4
0
    protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //The ad id [1]
            TrafficGridAdvert Ad = new TrafficGridAdvert(Convert.ToInt32(e.Row.Cells[1].Text));

            //Description [22]
            if (string.IsNullOrEmpty(e.Row.Cells[22].Text))
            {
                e.Row.Cells[22].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }
            else
            {
                e.Row.Cells[22].Text = HtmlCreator.GetCheckboxCheckedImage();
            }

            //End mode [16]
            End.Mode Mode = (End.Mode)Convert.ToInt32(e.Row.Cells[16].Text);

            //Status [24]
            AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[24].Text);
            e.Row.Cells[24].Text = HtmlCreator.GetColoredStatus(Status);

            //Pack [3]
            AdvertPack Pack = new TrafficGridAdvertPack(Convert.ToInt32(e.Row.Cells[3].Text));

            //Displaytime [17]
            e.Row.Cells[17].Text += "s";

            //Shorten url [4]
            if (e.Row.Cells[4].Text.Length > 18)
            {
                e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, 15) + "...";
            }

            //TItle [5]
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&lt;", "<");
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&gt;", ">");

            //Progress [11]
            string ProgressBarStatus = "";
            if (Status == AdvertStatus.Active)
            {
                ProgressBarStatus = "active";
            }
            e.Row.Cells[11].Text = HtmlCreator.GenerateAdProgressHTML(Ad, ProgressBarStatus).Replace("clicks", L1.CLICKSSMALL).Replace("days", L1.DAYS);

            //Geolocation check [23]
            var check = (CheckBox)e.Row.Cells[23].Controls[0];
            if (check.Checked)
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxCheckedImage();
            }
            else
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }

            //Add % progress [12]
            e.Row.Cells[12].Text = Ad.ProgressInPercent.ToString() + "%";

            //Add total views [13]
            e.Row.Cells[13].Text = e.Row.Cells[14].Text;

            // Start[27] Pause[28] Add [29] Remove[30]
            if (Status != AdvertStatus.Paused)
            {
                e.Row.Cells[27].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Active)
            {
                e.Row.Cells[28].Text = "&nbsp;";
            }

            e.Row.Cells[29].Text = "&nbsp;";

            if (!Status.CanBeRemoved())
            {
                e.Row.Cells[30].Text = "&nbsp;";
            }
        }
    }
Beispiel #5
0
    protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //The ad id [1]
            PtcAdvert Ad = new PtcAdvert(Convert.ToInt32(e.Row.Cells[1].Text));

            //Description [23]
            if (string.IsNullOrEmpty(e.Row.Cells[23].Text))
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }
            else
            {
                e.Row.Cells[23].Text = HtmlCreator.GetCheckboxCheckedImage();
            }

            //End mode [17]
            End.Mode Mode = (End.Mode)Convert.ToInt32(e.Row.Cells[17].Text);

            //Status [25]
            AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[25].Text);
            e.Row.Cells[25].Text = HtmlCreator.GetColoredStatus(Status);

            //Pack [3]
            AdvertPack Pack = new PtcAdvertPack(Convert.ToInt32(e.Row.Cells[3].Text));

            //Displaytime [18]
            e.Row.Cells[18].Text += "s";

            //Shorten url [4]
            if (e.Row.Cells[4].Text.Length > 18)
            {
                e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, 15) + "...";
            }

            //TItle [5]
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&lt;", "<");
            e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace("&gt;", ">");

            e.Row.Cells[5].Text = Ad.TargetUrl;

            string starredAd = Ad.IsStarredAd ? "<img src='Images/Misc/star.png' style='width:16px;height:16px;'> " : "";
            string targetUrl = Ad.TargetUrl.Length > 12 ? Ad.TargetUrl.Substring(0, 12) + "..." : Ad.TargetUrl;
            e.Row.Cells[5].Text = starredAd + Ad.Title + "<br/><i>" + targetUrl + "</i>";

            //Progress [11]
            e.Row.Cells[11].Text = HtmlCreator.GenerateAdProgressHTML(Ad).Replace("clicks", L1.CLICKSSMALL).Replace("days", L1.DAYS);

            //PointsEarnedFromViews [12]
            if (AppSettings.PtcAdverts.PTCCreditsEnabled)
            {
                e.Row.Cells[12].Text = string.Format("{0}/~{1}", Ad.PointsEarnedFromViews, Member.CurrentInCache.Membership.PointsYourPTCAdBeingViewed * Ad.Ends.Value);
            }
            else
            {
                e.Row.Cells[12].CssClass = "displaynone";
            }


            //Add % progress [13]
            e.Row.Cells[13].Text = Ad.ProgressInPercent.ToString() + "%";

            //Add total views [14]
            e.Row.Cells[14].Text = e.Row.Cells[15].Text;

            //Geolocation check [24]
            var check = (CheckBox)e.Row.Cells[24].Controls[0];
            if (check.Checked)
            {
                e.Row.Cells[24].Text = HtmlCreator.GetCheckboxCheckedImage();
            }
            else
            {
                e.Row.Cells[24].Text = HtmlCreator.GetCheckboxUncheckedImage();
            }

            // Start[31] Pause[32] Add [33] Remove [34]
            if (Status != AdvertStatus.Paused)
            {
                e.Row.Cells[31].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Active)
            {
                e.Row.Cells[32].Text = "&nbsp;";
            }

            if (Status != AdvertStatus.Finished)
            {
                e.Row.Cells[33].Text = "&nbsp;";
            }

            if (!Status.CanBeRemoved())
            {
                e.Row.Cells[34].Text = "&nbsp;";
            }

            //Edit button [35]
            ((LinkButton)e.Row.Cells[35].FindControl("ImageButton4")).ToolTip = U5007.EDIT;
            if (Ad.Status == AdvertStatus.Rejected)
            {
                e.Row.Cells[35].Controls.Clear();
            }
        }
        else if (e.Row.RowType == DataControlRowType.Header)
        {
            //PointsEarnedFromViews [12]
            DirectRefsGridView.Columns[12].HeaderText = string.Format(U5007.EARNED, AppSettings.PointsName);
        }

        if (!AppSettings.PtcAdverts.FeedbackCaptchaEnabled)
        {
            DirectRefsGridView.Columns[28].HeaderStyle.CssClass = "displaynone";
            DirectRefsGridView.Columns[29].HeaderStyle.CssClass = "displaynone";
            DirectRefsGridView.Columns[30].HeaderStyle.CssClass = "displaynone";
            DirectRefsGridView.Columns[28].ItemStyle.CssClass   = "displaynone";
            DirectRefsGridView.Columns[29].ItemStyle.CssClass   = "displaynone";
            DirectRefsGridView.Columns[30].ItemStyle.CssClass   = "displaynone";
        }


        if (!AppSettings.PtcAdverts.PTCCreditsEnabled)
        {
            DirectRefsGridView.Columns[12].HeaderStyle.CssClass = "displaynone";
        }
    }