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 = " "; } } }
private IHtmlString GetSingleCheckboxHtml(IReadonlyFieldConfiguration fieldConfiguration) { var attrs = new HtmlAttributes(fieldConfiguration.HtmlAttributes); AdjustHtmlForModelState(attrs, FieldGenerator); var fieldhtml = HtmlCreator.BuildSingleCheckbox(GetFieldName(FieldGenerator), GetValue() ?? false, attrs); if (fieldConfiguration.HasInlineLabel) { if (fieldConfiguration.ShouldInlineLabelWrapElement) { var inlineLabelText = fieldConfiguration.InlineLabelText; var content = fieldhtml.ToHtmlString() + " " + (inlineLabelText != null ? inlineLabelText.ToHtmlString() : FieldGenerator.GetFieldDisplayName()); return(HtmlCreator.BuildLabel(null, new HtmlString(content), null)); } else { return(new HtmlString(string.Format("{0} {1}", fieldhtml, HtmlCreator.BuildLabel( GetFieldName(FieldGenerator), fieldConfiguration.InlineLabelText ?? FieldGenerator.GetFieldDisplayName().ToHtml(), null )))); } } else { return(fieldhtml); } }
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); } } }
protected void OfferHistoryGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[1].Text = U6010.BOUGHTFROM; e.Row.Cells[2].Text = U6010.CRYPTOCURRENCY; e.Row.Cells[5].Text = U6010.RATING; e.Row.Cells[7].Text = U6010.COMMENT_YOUR; e.Row.Cells[8].Text = U6010.COMMENT_CLIENT; } if (e.Row.RowType == DataControlRowType.DataRow) { Member User = new Member(Int32.Parse(e.Row.Cells[1].Text)); e.Row.Cells[1].Text = HtmlCreator.CreateAvatarPlusUsername(User); e.Row.Cells[2].Text = String.Format("+{0} {1}", double.Parse(e.Row.Cells[2].Text).ToString(), AppSettings.CryptocurrencyTrading.CryptocurrencySign); e.Row.Cells[2].Style.Add("color", "green"); e.Row.Cells[3].CssClass = "your-comment-column displaynone"; e.Row.Cells[4].CssClass = "comment-column displaynone"; if (!String.IsNullOrEmpty(e.Row.Cells[3].Text) && !(e.Row.Cells[3].Text == " ")) { e.Row.Cells[6].Text = String.Empty; } else { e.Row.Cells[3].Text = U6010.NOCOMMENTYET; } if (String.IsNullOrEmpty(e.Row.Cells[4].Text) || (e.Row.Cells[4].Text == " ")) { e.Row.Cells[4].Text = U6010.CLIENTNOCOMMENT; } } }
/// <summary> /// 智付支付通道苹果调用方式 /// </summary> /// <param name="apptype">风控配置表id</param> /// <param name="code">订单编号</param> /// <param name="goodsname">商品名称</param> /// <param name="price">商品价格</param> /// <param name="TableName">订单表表名</param> /// <param name="appid">应用id</param> /// <returns></returns> private InnerResponse PayZfIos(int apptype, string code, string goodsname, decimal price, int orderid, int appid) { InnerResponse inn = new InnerResponse(); SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>(); Dictionary <string, string> DPcfg = DPConfing.loadCfg(apptype, appid); if (!UpdateOrde.OrdeUpdateInfo(orderid, Int32.Parse(DPcfg["pay_id"].ToString()))) { inn = inn.ToResponse(ErrorCode.Code101); return(inn); } //调用示例 var formField = new FormField( DPcfg["partner"].ToString(), //商家账号 code, //订单编号 price.ToString("f2"), //交易金额 ConfigurationManager.AppSettings["ZFTokenUrl"].ToString().Replace("{0}", DPcfg["pay_id"].ToString()), //通知地址 "RSA-S", //签名方式 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), //订单时间 goodsname, //商品描述 new FormProperty("") //表单属性对象 ); //商家私钥 string merchantPrivateKey = DPcfg["dpkey"].ToString(); //实例化HTML构造器 var htmlCreator = new HtmlCreator(formField, new PrivateKeySignRsas(merchantPrivateKey)); //生成表单字符串 var htmlForm = htmlCreator.CreateHtmlAz(); inn = inn.ToResponse(ErrorCode.Code100); string data = "{" + htmlForm.ToString().Replace("{", "").Replace("}", "") + ",\"PaymentType\":\"3\",\"SubType\":\"1\",\"IsH5\":\"0\"}"; inn.ExtraData = JMP.TOOL.AesHelper.AesEncrypt(data, ConfigurationManager.AppSettings["encryption"].ToString()); return(inn); }
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 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 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; } }
/// <inheritdoc /> public IHtmlContent GetLabelHtml(IReadonlyFieldConfiguration fieldConfiguration) { fieldConfiguration = fieldConfiguration ?? new FieldConfiguration(); string @for; if (fieldConfiguration.HtmlAttributes.ContainsKey("id")) { @for = fieldConfiguration.HtmlAttributes["id"].ToString(); } else { @for = HtmlHelper.GetFullHtmlFieldName(FieldProperty); } var labelText = fieldConfiguration.LabelText ?? GetFieldDisplayName().ToHtml(); if (!fieldConfiguration.HasLabelElement) { return(labelText); } var labelAttrs = new HtmlAttributes(); if (!string.IsNullOrEmpty(fieldConfiguration.LabelClasses)) { labelAttrs.AddClass(fieldConfiguration.LabelClasses); } return(HtmlCreator.BuildLabel(@for, labelText, labelAttrs)); }
protected void MyBannersGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var advert = new ExternalBannerAdvert(Convert.ToInt32(e.Row.Cells[0].Text)); try { var bannerImage = advert.Image; var imageWebControl = new Image { ImageUrl = bannerImage.Path, Width = Unit.Pixel(bannerImage.Width / 10), Height = Unit.Pixel(bannerImage.Height / 10) }; e.Row.Cells[2].Text = string.Empty; e.Row.Cells[2].Controls.Add(imageWebControl); e.Row.Cells[4].Text = bannerImage.Width + " x " + bannerImage.Height; e.Row.Cells[5].Text = HtmlCreator.GenerateCPAAdProgressHTML(advert.ClicksReceived, advert.ClicksBought); } catch (Exception ex) { e.Row.Cells[2].Text = string.Empty; } } }
protected void CurrentUserTransactionsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[1].Text = L1.AMOUNT; e.Row.Cells[2].Text = U6010.EXECUTIONTIME; e.Row.Cells[3].Text = L1.STATUS; e.Row.Cells[5].Text = U4200.TIMELEFT; e.Row.Cells[6].Text = L1.DESCRIPTION; } if (e.Row.RowType == DataControlRowType.DataRow) { //Loading data for addiotional info var CurrentTransaction = new CryptocurrencyTradeTransaction(Int32.Parse(e.Row.Cells[0].Text)); var CurrentOffer = new CryptocurrencyTradeOffer(CurrentTransaction.OfferId); e.Row.Cells[1].Text = CryptocurrencyMoney.Parse(e.Row.Cells[1].Text).ToString(); if ((CryptocurrencyTransactionStatus)Int32.Parse(e.Row.Cells[3].Text) == CryptocurrencyTransactionStatus.AwaitingPaymentConfirmation) { e.Row.Cells[6].Visible = true; } else { e.Row.Cells[6].Visible = false; } e.Row.Cells[3].Text = HtmlCreator.GetColoredTransactionStatus((CryptocurrencyTransactionStatus)Int32.Parse(e.Row.Cells[3].Text)); //Count Time Left in Escrow DateTime ExecutionTime = DateTime.Parse(e.Row.Cells[2].Text); TimeSpan TimeLeft = AppSettings.ServerTime - ExecutionTime; int TimeLeftMinutes = CurrentOffer.EscrowTime - (int)TimeLeft.TotalMinutes; if (TimeLeftMinutes < 0) { TimeLeftMinutes = 0; } Label OfferTimeLeftToPayTextBox = new Label(); OfferTimeLeftToPayTextBox.Text = HtmlCreator.GetColoredTime(TimeLeftMinutes); e.Row.Cells[5].Controls.Add(OfferTimeLeftToPayTextBox); //Load Description for this offerAddToCryptocurrencyBalance Label OfferDescriptionTextBox = new Label(); //If seller description have data, that means that it is 100% buy offer and tehre is no desc, we have to load seller's description if (String.IsNullOrEmpty(CurrentTransaction.SellerDescription) || String.IsNullOrWhiteSpace(CurrentTransaction.SellerDescription)) { OfferDescriptionTextBox.Text = CurrentOffer.Description; } else { OfferDescriptionTextBox.Text = CurrentTransaction.SellerDescription; } OfferDescriptionTextBox.CssClass = "description-column displaynone"; e.Row.Cells[4].Controls.Add(OfferDescriptionTextBox); } }
public void Generate_reset_button_with_html_content() { var h = HtmlCreator.BuildButton(new HtmlString("<b>content</b>"), "reset", "name", "value", new HtmlAttributes().Attr(id => "overriddenid").AddClass("lol") ); HtmlApprovals.VerifyHtml(h.ToHtmlString()); }
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 ClosedGroupsGridView2_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int userId = Convert.ToInt32(e.Row.Cells[0].Text); int userCustomGroupId = Convert.ToInt32(e.Row.Cells[7].Text); //userId e.Row.Cells[0].Text = new Member(userId).Name; //Name e.Row.Cells[1].BackColor = System.Drawing.Color.FromName(e.Row.Cells[2].Text); //insert link e.Row.Cells[1].Text = string.Format("<span style='font-weight:bold'><a style='color:white;' href='{0}user/advert/groups/customgroup.aspx?g={1}'>{2}<a/><span/>", AppSettings.Site.Url, userCustomGroupId, e.Row.Cells[1].Text); //Color e.Row.Cells[2].Visible = false; //AdPacksAdded e.Row.Cells[3].Text = HtmlCreator.GenerateCPAAdProgressHTML(Convert.ToInt32(e.Row.Cells[3].Text), Convert.ToInt32(e.Row.Cells[4].Text), AppSettings.RevShare.AdPack.AdPackNamePlural); //AdPacksLimit e.Row.Cells[4].Visible = false; //Percentage e.Row.Cells[5].Visible = false; //Daily profit if (AppSettings.RevShare.AdPack.CustomReturnOption == CustomReturnOption.Increase) { e.Row.Cells[6].Text = "+" + Convert.ToInt32(e.Row.Cells[6].Text).ToString(); } e.Row.Cells[6].Text += "%"; //UserGroupId - > Number of participants e.Row.Cells[7].Text = AdPackManager.GetNumberOfParticipantsInGroup(userCustomGroupId).ToString(); // e.Row.Cells[8].Visible = false; } else if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[2].Visible = false; e.Row.Cells[4].Visible = false; e.Row.Cells[5].Visible = false; if (AppSettings.RevShare.AdPack.CustomReturnOption == CustomReturnOption.Accelerate) { ClosedGroupsGridView2.Columns[6].HeaderText = U4200.DAILYPROFITRAISEDBY; } else if (AppSettings.RevShare.AdPack.CustomReturnOption == CustomReturnOption.Increase) { ClosedGroupsGridView2.Columns[6].HeaderText = U5001.PROFITRAISEDBY; } } }
/// <summary> /// Creates the HTML for a submit <input> (or optionally <button>) that submits a value in the form post when clicked. /// </summary> /// <remarks> /// Uses an <input> by default so the submitted value works in IE7. /// <see cref="http://rommelsantor.com/clog/2012/03/12/fixing-the-ie7-submit-value/"/> /// </remarks> /// <param name="name">The name (and id - use htmlAttributes to overwrite) of the element</param> /// <param name="value">The value to submit with the form</param> /// <param name="buttonText">If you want to use a <button> rather than <input> then specify this to set the text the user sees</param> /// <param name="htmlAttributes">Any HTML attributes that should be applied to the button</param> /// <returns>The HTML for the submit button</returns> public Nancy.ViewEngines.Razor.IHtmlString Submit(string name, string value, Nancy.ViewEngines.Razor.IHtmlString buttonText = null, HtmlAttributes htmlAttributes = null) { if (buttonText != null) { return(HtmlCreator.BuildButton(buttonText, "submit", name, value, htmlAttributes)); } return(HtmlCreator.BuildInput(name, value, "submit", htmlAttributes)); }
private void LoadPost() { PostImage.ImageUrl = Post.ImagePath; PostText.InnerText = Post.Text; PostDate.InnerText = Post.DateTime.ToShortDateString(); PostTime.InnerText = Post.DateTime.ToShortTimeString(); PostAuthor.InnerHtml = string.Format("<a href=\"{0}\">{1}</a>", HtmlCreator.GetProfileURL(Author.Id, Author.Name), Author.Name); PostAuthorImage.ImageUrl = Author.AvatarUrl; }
protected void SurfAdsStatsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (!AppSettings.RevShare.AdPack.EnableAdvertChange) { e.Row.Cells[0].ControlStyle.CssClass = "displaynone"; } if (!AppSettings.RevShare.AdPack.IsStartPageEnabled) { e.Row.Cells[4].ControlStyle.CssClass = "displaynone"; } AdPack adPack = new AdPack(Convert.ToInt32(e.Row.Cells[1].Text)); e.Row.Cells[2].Text = HtmlCreator.GenerateCPAAdProgressHTML(Convert.ToInt32(e.Row.Cells[2].Text), Convert.ToInt32(adPack.ClicksBought), L1.CLICKS.ToLower()); if ((e.Row.Cells[4].Text.ToLower() == " ")) { e.Row.Cells[4].Text = "-"; } else { try { DateTime StartPageDate = Convert.ToDateTime(e.Row.Cells[4].Text); if (StartPageDate < DateTime.Now.AddDays(-3)) { //We do not show older then 3 days e.Row.Cells[4].Text = "-"; } else { e.Row.Cells[4].Text = StartPageDate.ToShortDateString(); } } catch { } } } else if (e.Row.RowType == DataControlRowType.Header) { if (!AppSettings.RevShare.AdPack.EnableAdvertChange) { SurfAdsStatsGridView.Columns[0].HeaderStyle.CssClass = "displaynone"; } if (!AppSettings.RevShare.AdPack.IsStartPageEnabled) { SurfAdsStatsGridView.Columns[4].HeaderStyle.CssClass = "displaynone"; } SurfAdsStatsGridView.Columns[4].HeaderText = U5001.STARTPAGE; } }
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; } }
private void LoadFriends() { FriendTitle.InnerText = Friend.Name; FriendUrlLinkButton.ImageUrl = Friend.AvatarUrl; FriendUrlLinkButton.PostBackUrl = HtmlCreator.GetProfileURL(Friend); if (RedirectToMessenger) { FriendUrlLinkButton.PostBackUrl = AppSettings.Site.Url + "user/network/messenger.aspx?recipientId=" + Friend.Id; } }
public void ThenICanGenerateTheHtmlReport() { var watch = new Stopwatch(); watch.Start(); Thread.Sleep(100); var t1 = new TestResult { TestStatus = Status.Pass, ElapsedTime = (watch.ElapsedMilliseconds).ToString(), Comment = "Comment 1", TestStep = "Test Step 1" }; Thread.Sleep(300); var t2 = new TestResult { TestStatus = Status.Pass, ElapsedTime = (watch.ElapsedMilliseconds).ToString(), Comment = "Comment 2", TestStep = "Test Step 2" }; Thread.Sleep(400); var t3 = new TestResult { TestStatus = Status.Fail, ElapsedTime = (watch.ElapsedMilliseconds).ToString(), Comment = "Comment 3", TestStep = "Test Step 3" }; Thread.Sleep(500); var t4 = new TestResult { TestStatus = Status.Pending, ElapsedTime = (watch.ElapsedMilliseconds).ToString(), Comment = "Comment 4", TestStep = "Test Step 4" }; Thread.Sleep(300); _testresults.Add(t1); _testresults.Add(t2); _testresults.Add(t3); _testresults.Add(t4); watch.Stop(); var report = new HtmlCreator(); report.BuildReport(_testresults, watch); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //Create an instance of the datarow var rowData = e.Row.Cells[2].Text; //Lets generate avatar + colored login Member User = new Member(rowData); e.Row.Cells[2].Text = HtmlCreator.CreateAvatarPlusUsername(User); e.Row.Cells[4].Text = "<img src=\"Images/Flags/" + User.CountryCode.ToLower() + ".png\" />"; } }
protected void DirectRefsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var chbox = ((HtmlInputCheckBox)e.Row.FindControl("chkSelect")); chbox.Attributes.Add("onclick", SelectedPanel.ClientID + ".style.display = 'block';hideIfUnchecked('" + SelectedPanel.ClientID + "');"); //Expires[4] DateTime expires = Convert.ToDateTime(e.Row.Cells[4].Text); int daysLeft = expires.Subtract(DateTime.Now).Days; e.Row.Cells[4].Text = daysLeft.ToString() + " " + L1.DAYS; //Last click[5] string output; if (string.IsNullOrEmpty(e.Row.Cells[5].Text) || e.Row.Cells[5].Text == " ") { output = "<i>" + L1.NEVER + "</i>"; } else { DateTime lastActivity = Convert.ToDateTime(e.Row.Cells[5].Text); int days = (int)Math.Ceiling(DateTime.Now.Subtract(lastActivity).TotalDays); switch (days) { case 1: output = L1.TODAY; break; case 2: output = L1.YESTERDAY; break; default: output = days.ToString() + " " + L1.DAYSAGO; break; } } e.Row.Cells[5].Text = output; //6 AutoPay check image var check = (CheckBox)e.Row.Cells[7].Controls[0]; if (check.Checked) { e.Row.Cells[7].Text = HtmlCreator.GetCheckboxCheckedImage(); } else { e.Row.Cells[7].Text = HtmlCreator.GetCheckboxUncheckedImage(); } } }
/// <inheritdoc /> /// <remarks> /// Uses an <input> by default so the submitted value works in IE7. /// See http://rommelsantor.com/clog/2012/03/12/fixing-the-ie7-submit-value/ /// </remarks> public virtual IHtmlContent Button(IHtmlContent content, string type, string id, string value, HtmlAttributes htmlAttributes) { if (content == null && value == null) { throw new ArgumentNullException("content", "Expected one of content or value to be specified"); } if (content == null) { return(HtmlCreator.BuildInput(id, value, type ?? "button", htmlAttributes)); } return(HtmlCreator.BuildButton(content, type, id, value, htmlAttributes)); }
private Nancy.ViewEngines.Razor.IHtmlString GetSingleCheckboxHtml() { var attrs = new HtmlAttributes(FieldConfiguration.HtmlAttributes); AdjustHtmlForModelState(attrs); var fieldhtml = HtmlCreator.BuildSingleCheckbox(GetFieldName(), GetValue() ?? false, attrs); var labelHtml = HtmlCreator.BuildLabel( GetFieldName(), FieldConfiguration.InlineLabelText ?? new NonEncodedHtmlString(FieldGenerator.GetFieldDisplayName()), null ); return(new NonEncodedHtmlString(string.Format("{0} {1}", fieldhtml, labelHtml))); }
private IHtmlString GetSingleCheckboxHtml(IReadonlyFieldConfiguration fieldConfiguration) { var attrs = new HtmlAttributes(fieldConfiguration.HtmlAttributes); AdjustHtmlForModelState(attrs, FieldGenerator); var fieldhtml = HtmlCreator.BuildSingleCheckbox(GetFieldName(FieldGenerator), GetValue() ?? false, attrs); var labelHtml = HtmlCreator.BuildLabel( GetFieldName(FieldGenerator), fieldConfiguration.InlineLabelText ?? FieldGenerator.GetFieldDisplayName().ToHtml(), null ); return(new HtmlString(string.Format("{0} {1}", fieldhtml, labelHtml))); }
protected void UserS4DSPacksGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { String Addon = Convert.ToDecimal(e.Row.Cells[1].Text) >= 120 ? "Finished: " : "Purchased: "; AdPack adPack = new AdPack(Convert.ToInt32(e.Row.Cells[0].Text)); AdPackTypesCache cache = new AdPackTypesCache(); var adPackTypes = (Dictionary <int, AdPackType>)cache.Get(); e.Row.Cells[1].Text = HtmlCreator.GenerateCPAAdProgressHTML( new Money(Convert.ToDecimal(e.Row.Cells[1].Text)).ToDecimal(), adPack.MoneyToReturn.ToDecimal(), AppSettings.Site.CurrencySign); e.Row.Cells[2].Text = Addon + e.Row.Cells[2].Text; } }
protected void AllSellOffersGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var CurrentOffer = new CryptocurrencyTradeOffer(Int32.Parse(e.Row.Cells[0].Text)); Member User = new Member(Int32.Parse(e.Row.Cells[1].Text)); e.Row.Cells[1].Text = String.Format("<span style=\"float:left; margin-right: 10px\">{0}</span>{1}", HtmlCreator.CreateAvatarPlusUsername(User), CryptocurrencyPlatformManager.GetHtmlRatingStringForUser(User.Id)); e.Row.Cells[3].Text = String.Format("<b>{0}</b>/{1}", Money.Parse(e.Row.Cells[3].Text).ToString(), AppSettings.CryptocurrencyTrading.CryptocurrencyCode); e.Row.Cells[4].Text = CurrentOffer.MinOfferValue + " - " + CurrentOffer.MaxOfferValue; e.Row.Cells[5].Text = CryptocurrencyMoney.Parse(e.Row.Cells[5].Text).ToString(); } }
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 = " "; } } }
public void Run() { //调用示例 var formField = new FormField("2110020007", "1000201555", "0.01", "", "", "http://test.dunxingpay.com/DinpayToMer_notify.aspx", "", "2016-09-23 13:55:00", "图书", new FormProperty("")) { ReturnUrl = "http://test.dunxingpay.com/callback.aspx" }; //商家私钥 const string merchantPrivateKey = ""; //实例化HTML构造器 var htmlCreator = new HtmlCreator(formField, new PrivateKeySignRsas(merchantPrivateKey)); //生成表单字符串 var htmlForm = htmlCreator.CreateHtmlForm(); }