protected void CurrentUserBuyOfferGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[1].Text = L1.DATEADDED; e.Row.Cells[2].Text = L1.PRICE; e.Row.Cells[3].Text = U6010.TRANSACTIONVALUE; e.Row.Cells[4].Text = U6010.AMOUNTTOBUY; e.Row.Cells[5].Text = U6010.AMOUNTLEFT; e.Row.Cells[6].Text = L1.STATUS; } if (e.Row.RowType == DataControlRowType.DataRow) { var CurrentOffer = new CryptocurrencyTradeOffer(Int32.Parse(e.Row.Cells[0].Text)); CryptocurrencyOfferStatus Status = (CryptocurrencyOfferStatus)Convert.ToInt32(e.Row.Cells[6].Text); e.Row.Cells[2].Text = String.Format("{0} / {1}", Money.Parse(e.Row.Cells[2].Text).ToString(), AppSettings.CryptocurrencyTrading.CryptocurrencyCode); e.Row.Cells[3].Text = String.Format("{0} - {1}", CurrentOffer.MinOfferValue, CurrentOffer.MaxOfferValue); e.Row.Cells[4].Text = CryptocurrencyMoney.Parse(e.Row.Cells[4].Text).ToString(); e.Row.Cells[5].Text = CryptocurrencyMoney.Parse(e.Row.Cells[5].Text).ToString(); e.Row.Cells[6].Text = HtmlCreator.GetColoredStatus(Status); if (Status != CryptocurrencyOfferStatus.Paused) { e.Row.Cells[7].Text = " "; } if (Status != CryptocurrencyOfferStatus.Active) { e.Row.Cells[8].Text = " "; } } }
protected void LoginAdsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //Status [4] AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[4].Text); e.Row.Cells[4].Text = HtmlCreator.GetColoredStatus(Status); //Display Date[2] e.Row.Cells[2].Text = DateTime.Parse(e.Row.Cells[2].Text).ToShortDateString(); //start [5] stop [6] remove[7] if (Status != AdvertStatus.Paused) { e.Row.Cells[5].Text = " "; } if (Status != AdvertStatus.Active) { e.Row.Cells[6].Text = " "; } if (Status != AdvertStatus.Rejected && Status != AdvertStatus.Stopped) { e.Row.Cells[7].Text = " "; } } }
protected void ArticlesGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var article = new Article(Convert.ToInt32(e.Row.Cells[0].Text)); e.Row.Cells[1].Text = InputChecker.HtmlPartialDecode(article.Title); e.Row.Cells[2].Text = article.GetCategory().Text; e.Row.Cells[4].Text = String.Format("<img src='Images/Flags/{0}.png'/> {1}", article.Geolocation.ToLower(), CountryManager.GetCountryName(article.Geolocation)); e.Row.Cells[6].Text = Money.Parse(e.Row.Cells[6].Text).ToString(); e.Row.Cells[7].Text = HtmlCreator.GetColoredStatus(article.Status); if (article.Status != AdvertStatus.Paused) { e.Row.Cells[8].Text = " "; } if (article.Status != AdvertStatus.Active) { e.Row.Cells[9].Text = " "; } //Edit button ((LinkButton)e.Row.Cells[11].FindControl("ImageButton4")).ToolTip = U5007.EDIT; } else if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[5].Text = U6012.READS; e.Row.Cells[6].Text = U6012.MONEYCREDITED; } }
protected void MyUrlsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var url = e.Row.Cells[1].Text; e.Row.Cells[1].Text = url.Length > 30 ? e.Row.Cells[1].Text = url.Substring(0, 30) : url; var status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[2].Text); e.Row.Cells[2].Text = HtmlCreator.GetColoredStatus(status); // Start[3] Pause[4] Remove[5] if (status != AdvertStatus.Paused) { e.Row.Cells[3].Text = " "; } if (status != AdvertStatus.Active) { e.Row.Cells[4].Text = " "; } if (!status.CanBeRemoved()) { e.Row.Cells[5].Text = " "; } } }
protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int rowIndex = e.Row.RowIndex % DirectRefsGridView.PageSize; int ObjectId = (int)DirectRefsGridView.DataKeys[rowIndex].Value; CPAOffer BannerAd = new CPAOffer(ObjectId); //Title [0] e.Row.Cells[0].Text = (new HtmlString(BannerAd.Title)).ToHtmlString(); //Progress [4] e.Row.Cells[3].Text = HtmlCreator.GenerateCPAAdProgressHTML(BannerAd.CompletedClicks, BannerAd.CreditsBought); //category [2] e.Row.Cells[1].Text = CPAType.GetText(BannerAd.Category); // daily [5] if (BannerAd.IsDaily) { e.Row.Cells[4].Text = HtmlCreator.GetCheckboxCheckedImage(); } else { e.Row.Cells[4].Text = HtmlCreator.GetCheckboxUncheckedImage(); } //geo [7] if (BannerAd.IsGeolocated) { e.Row.Cells[5].Text = HtmlCreator.GetCheckboxCheckedImage(); } else { e.Row.Cells[5].Text = HtmlCreator.GetCheckboxUncheckedImage(); } //start[7] stop[8] Remove[9] if (BannerAd.Status != AdvertStatus.Paused) { e.Row.Cells[7].Text = " "; } if (BannerAd.Status != AdvertStatus.Active) { e.Row.Cells[8].Text = " "; } if (!BannerAd.Status.CanBeRemoved()) { e.Row.Cells[9].Text = " "; } //[7] status e.Row.Cells[6].Text = HtmlCreator.GetColoredStatus(BannerAd.Status); } }
protected void UserMiniVideosGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var status = (MiniVideoStatus)Convert.ToInt32(e.Row.Cells[3].Text); e.Row.Cells[3].Text = HtmlCreator.GetColoredStatus(status); var categoryId = Convert.ToInt32(e.Row.Cells[2].Text); e.Row.Cells[2].Text = new MiniVideoCategory(categoryId).Name; } }
protected void HistoryGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var plan = new InvestmentPlatformPlan(int.Parse(e.Row.Cells[2].Text)); e.Row.Cells[2].Text = plan.Name; //Money Returned var returnedMoney = Money.Parse(e.Row.Cells[3].Text); e.Row.Cells[3].Text = returnedMoney.ToString(); //Money to Return var moneyToReturn = Money.Parse(e.Row.Cells[4].Text); e.Row.Cells[4].Text = moneyToReturn.ToString(); //Money in System e.Row.Cells[5].Text = Money.Parse(e.Row.Cells[5].Text).ToString(); if (returnedMoney >= moneyToReturn) { e.Row.Cells[3].ForeColor = System.Drawing.Color.Green; } else { e.Row.Cells[3].ForeColor = System.Drawing.Color.DarkRed; } var Type = (PurchaseBalances)Convert.ToInt32(e.Row.Cells[6].Text); switch (Type) { case PurchaseBalances.Purchase: e.Row.Cells[6].Text = U6012.PURCHASEBALANCE; break; case PurchaseBalances.Cash: e.Row.Cells[6].Text = U5008.CASHBALANCE; break; default: break; } PlanStatus status = (PlanStatus)Convert.ToInt32(e.Row.Cells[7].Text); e.Row.Cells[7].Text = HtmlCreator.GetColoredStatus(status); } }
protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { FacebookAdvert Ad = new FacebookAdvert(Convert.ToInt32(e.Row.Cells[1].Text)); //[5] ProfilePic var check = (CheckBox)e.Row.Cells[5].Controls[0]; if (check.Checked) { e.Row.Cells[5].Text = HtmlCreator.GetCheckboxCheckedImage(); } else { e.Row.Cells[5].Text = HtmlCreator.GetCheckboxUncheckedImage(); } //Progress [13] e.Row.Cells[13].Text = HtmlCreator.GenerateAdProgressHTML(Ad).Replace("clicks", L1.LIKESSMALL); // % [14] e.Row.Cells[14].Text = Ad.ProgressInPercent + "%"; // Likes (Clicks) [15] e.Row.Cells[15].Text = Ad.Clicks.ToString(); //Status [16] e.Row.Cells[16].Text = HtmlCreator.GetColoredStatus(Ad.Status); //start [19] stop [20] remove[21] if (Ad.Status != AdvertStatus.Paused) { e.Row.Cells[19].Text = " "; } if (Ad.Status != AdvertStatus.Active) { e.Row.Cells[20].Text = " "; } if (!Ad.Status.CanBeRemoved()) { e.Row.Cells[21].Text = " "; } } }
protected void AdPacksAdGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //Shorten url [6] if (e.Row.Cells[6].Text.Length > 19) { e.Row.Cells[6].Text = e.Row.Cells[6].Text.Substring(0, 16) + "..."; } //Status [5] AdvertStatus Status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[5].Text); e.Row.Cells[5].Text = HtmlCreator.GetColoredStatus(Status); //Added as [4] PurchaseOption.Features AddedAsType = (PurchaseOption.Features)Convert.ToInt32(e.Row.Cells[4].Text); e.Row.Cells[4].Text = AddedAsType.ToString(); } }
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; } }
protected void TicketsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var level = Convert.ToInt32(e.Row.Cells[2].Text); e.Row.Cells[2].Text = InvestmentPlatformPlan.GetNameByLevel(level); var levelPrice = Money.Parse(e.Row.Cells[3].Text); e.Row.Cells[3].Text = levelPrice.ToString(); var levelFee = Money.Parse(e.Row.Cells[4].Text); e.Row.Cells[4].Text = levelFee.ToString(); var levelEarnings = Money.Parse(e.Row.Cells[5].Text); e.Row.Cells[5].Text = levelEarnings.ToString(); TicketStatus status = (TicketStatus)Convert.ToInt32(e.Row.Cells[6].Text); e.Row.Cells[6].Text = HtmlCreator.GetColoredStatus(status); } }
protected void PurchasedProductsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var Img = new Image(); if (e.Row.Cells[1].Text != " ") { Img.ImageUrl = e.Row.Cells[1].Text; Img.Width = Unit.Pixel(20); Img.Height = Unit.Pixel(20); e.Row.Cells[1].Text = ""; e.Row.Cells[1].Controls.Add(Img); } var status = (MarketplaceIPNStatus)Convert.ToInt32(e.Row.Cells[6].Text); MarketplaceIPN ipn = new MarketplaceIPN(Convert.ToInt32(e.Row.Cells[0].Text)); var link = string.Format("{0}user/advert/marketplace.aspx?h={1}", AppSettings.Site.Url, ipn.Hash); e.Row.Cells[2].Text = string.Format("<a href={0}>{1}</a>", link, e.Row.Cells[2].Text); e.Row.Cells[6].Text = HtmlCreator.GetColoredStatus(status); if (status != MarketplaceIPNStatus.Pending) { e.Row.Cells[7].Text = String.Empty; } } else if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[1].Text = L1.IMAGE; e.Row.Cells[2].Text = L1.TITLE; e.Row.Cells[3].Text = L1.PRICE; e.Row.Cells[4].Text = L1.AMOUNT; e.Row.Cells[5].Text = U5006.SELLER; e.Row.Cells[6].Text = L1.STATUS; } }
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("<", "<"); e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace(">", ">"); //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 = " "; } if (Status != AdvertStatus.Active) { e.Row.Cells[28].Text = " "; } if (Status != AdvertStatus.Finished) { e.Row.Cells[29].Text = " "; } if (!Status.CanBeRemoved()) { e.Row.Cells[31].Text = " "; } } }
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("<", "<"); e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace(">", ">"); 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 = " "; } if (Status != AdvertStatus.Active) { e.Row.Cells[32].Text = " "; } if (Status != AdvertStatus.Finished) { e.Row.Cells[33].Text = " "; } if (!Status.CanBeRemoved()) { e.Row.Cells[34].Text = " "; } //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"; } }
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 = " "; } if (Status != AdvertStatus.Active) { e.Row.Cells[21].Text = " "; } if (!Status.CanBeRemoved()) { e.Row.Cells[22].Text = " "; } //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; } }
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("<", "<"); e.Row.Cells[5].Text = e.Row.Cells[5].Text.Replace(">", ">"); //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 = " "; } if (Status != AdvertStatus.Active) { e.Row.Cells[28].Text = " "; } e.Row.Cells[29].Text = " "; if (!Status.CanBeRemoved()) { e.Row.Cells[30].Text = " "; } } }
protected void AdvertsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //[0] Id - hidden var ptpAd = new PaidToPromoteAdvert(Convert.ToInt32(e.Row.Cells[0].Text)); //[1] PackId - hidden var ptpPack = new PaidToPromotePack(Convert.ToInt32(e.Row.Cells[1].Text)); //[2] TargetUrl var link = e.Row.Cells[2].Text; e.Row.Cells[2].Text = string.Format("<a href='{0}' target='_blank'>{0}</a>", link); //[3] CreationDate //OK //[4] FinishDate - can be null //OK //[5] Creation Date - change it to progress e.Row.Cells[5].Text = HtmlCreator.GenerateProgressHTML(0m, ptpAd.EndValue, (decimal)ptpPack.Ends.Value); //[6] EndValue - change to End Mode var Mode = ptpPack.Ends.EndMode; e.Row.Cells[6].Text = Mode.ToString(); //[7] EndValue(title: Click/Days) - Depend on Pack change it to click/days if (Mode == End.Mode.Clicks) { e.Row.Cells[7].Text += string.Format(" {0}", L1.CLICKS); } else { e.Row.Cells[7].Text += string.Format(" {0}", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(L1.DAYS.ToLower())); } //[8] GeolocatedCC - check all geo and add checkBox if (ptpAd.IsGeo()) { e.Row.Cells[8].Text = HtmlCreator.GetCheckboxCheckedImage(); } else { e.Row.Cells[8].Text = HtmlCreator.GetCheckboxUncheckedImage(); } //[9] Status var status = (AdvertStatus)Convert.ToInt32(e.Row.Cells[9].Text); e.Row.Cells[9].Text = HtmlCreator.GetColoredStatus(status); //[10] Remove button //OK } else if (e.Row.RowType == DataControlRowType.Header) { AdvertsGridView.Columns[2].HeaderText = U6008.TARGETURL; AdvertsGridView.Columns[3].HeaderText = L1.CREATED; AdvertsGridView.Columns[4].HeaderText = L1.FINISHED; AdvertsGridView.Columns[5].HeaderText = L1.PROGRESS; AdvertsGridView.Columns[7].HeaderText = string.Format("{0}/{1}", L1.CLICKS, CultureInfo.CurrentCulture.TextInfo.ToTitleCase(L1.DAYS.ToLower())); AdvertsGridView.Columns[9].HeaderText = L1.STATUS; } }