public override void DataBind() { if (Member.IsLogged || DisplayMember != null) { if (!IsPostBack) { MembershipsPlaceholder.Visible = AppSettings.TitanFeatures.UpgradeEnabled && !AppSettings.Points.LevelMembershipPolicyEnabled; MembershipsLevelPlaceholder.Visible = AppSettings.Points.LevelMembershipPolicyEnabled; ExpirationPlaceHolder.Visible = !ManualDatabind; } Member member = DisplayMember != null ? DisplayMember : Member.CurrentInCache; UserProfileLinkLiteral.Text = string.Format("<a href={0}user/network/profile.aspx?userId={1}>{2}</a>", AppSettings.Site.Url, member.Id, member.Name); MembershipExpiresLiteral.Text = member.FormattedMembershipExpires; MembershipTypeLiteral1.Text = MembershipTypeLiteral2.Text = member.FormattedMembershipName; MainAvatarImage.ImageUrl = member.AvatarUrl; if (member.Membership.Id != Membership.Standard.Id && DateTime.Now.AddDays(3) > member.MembershipExpires) { //Membership expires in less than 3 days, display warning int howManyDaysLeftTillExpire = ((DateTime)member.MembershipExpires).Subtract(DateTime.Now).Days; MembershipWarningLiteral.Text = "<img src=\"Images/Misc/warning.png\" title=\"" + Resources.U3000.EXPIREWARNING2.Replace("%n%", howManyDaysLeftTillExpire.ToString()) + "\"/>"; } if (AppSettings.Points.LevelMembershipPolicyEnabled) { LevelProgressLiteral.Text = HtmlCreator.GenerateProgressHTML(member.Membership.MinPointsToHaveThisLevel, member.PointsBalance, LevelManager.NextLevelValue(member.PointsBalance), AppSettings.PointsName); } } }
public override void DataBind() { base.DataBind(); var limitsEnabled = AppSettings.InvestmentPlatform.InvestmentPlatformDailyLimitsEnabled; if (IncludedUsersEarning) { ProgressBarContainer.Visible = true; LabelProgressBar.Text = HtmlCreator.GenerateProgressHTML(0.0m, UserPlan.MoneyReturned.ToDecimal(), UserPlan.MoneyToReturn.ToDecimal()); LabelProgressBarDescription.Text = string.Format("{0}/{1}", U4200.MONEYRETURNED, U6006.MONEYTORETURN); LabelProgressBarValues.Text = string.Format("{0}/{1}", UserPlan.MoneyReturned.ToString(), UserPlan.MoneyToReturn.ToString()); if (AppSettings.InvestmentPlatform.InvestmentPlatformPlansPolicy == PlansPolicy.UnlimitedPlans) { DescriptionTable.Visible = false; } MoneyInSystemLabel.Text = string.Format("{0}: {1}", U6006.MONEYINSYSTEM, UserPlan.MoneyInSystem); WithdrawMoneyFromSystem.Attributes.Add("data-moneyinsystem", UserPlan.MoneyInSystem.ToClearString()); var isBonus = UserPlan.LastWithdrawalDate == null && PlatformPlan.EndBonus > Money.Zero; WithdrawMoneyFromSystem.Attributes.Add("data-isbonusavaible", isBonus.ToString()); WithdrawMoneyFromSystem.Visible = !limitsEnabled; WithdrawMoneyFromSystem.Text = L1.TRANSFERMONEY; InvPlanPlaceHolder.CssClass = "bordered"; if (UserPlan.MoneyInSystem == Money.Zero) { WithdrawMoneyFromSystem.Style.Add("visibility", "hidden"); } price = UserPlan.Price.ToString(); } LimitsPlaceHolder.Visible = limitsEnabled; EarningsPlaceHolder.Visible = !limitsEnabled; EarningDelayTab.Visible = !(EarningDelay == "0"); BonusTab.Visible = PlatformPlan.EndBonus > Money.Zero; switch (AppSettings.InvestmentPlatform.InvestmentPlatformSpeedUpOption) { case SpeedUpOptions.None: CreditingEarningTab.Visible = false; break; case SpeedUpOptions.Matrix: CreditingTextLabel.Text = U6006.BINARYEARNING; break; case SpeedUpOptions.Referrals: CreditingTextLabel.Text = U6010.REFERRALEARNING; break; } HeaderPrice.Visible = !TitanFeatures.IsRetireYoung; InvestmentTab.Visible = TitanFeatures.IsRetireYoung; ErrorPanel.Visible = false; SuccessPanel.Visible = false; }
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; } }