protected override void AttachChildControls() { int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.keyWord = System.Web.HttpUtility.UrlDecode(this.Page.Request.QueryString["keyWord"]); if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); if (HiContext.Current.User.UserId > 0) { HistorySearchHelp.NewSearchHistory(this.keyWord.Trim(), HiContext.Current.User.UserId, Entities.ClientType.WAP); } } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); //this.rptCategories = (WapTemplatedRepeater)this.FindControl("rptCategories"); this.txtSearch = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("txtSearch"); if (this.categoryId > 0) { this.txtSearch.InnerText = CategoryBrowser.GetCategory(this.categoryId).Name; } else if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.txtSearch.InnerText = this.keyWord; } //System.Collections.Generic.IList<CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000); //this.rptCategories.DataSource = maxSubCategories; //this.rptCategories.DataBind(); //this.txtTotalPages.SetWhenIsNotNull(num.ToString()); PageTitle.AddSiteNameTitle("分类搜索页"); }
protected void dgChangeList_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { switch (e.Item.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: DataRowView ud_drvItem = (DataRowView)e.Item.DataItem; Label lblAuditedTotalChangeMoney = (Label)e.Item.FindControl("lblAuditedTotalChangeMoney"); System.Web.UI.HtmlControls.HtmlAnchor Alink = e.Item.FindControl("ALink") as System.Web.UI.HtmlControls.HtmlAnchor; //if (ud_drvItem["changetype"].ToString() == "结算") //{ // Alink.Style.Add("color", "red"); //} if (ud_drvItem["Status"].ToString() == "0") { lblAuditedTotalChangeMoney.Text = (RmsPM.BLL.ConvertRule.ToDecimal(ud_drvItem["TotalChangeMoney"]) + RmsPM.BLL.ConvertRule.ToDecimal(ud_drvItem["ChangeMoney"])).ToString("N"); } else { lblAuditedTotalChangeMoney.Text = ""; } break; case ListItemType.Footer: ((Label)e.Item.FindControl("lblChangeMoney")).Text = "共:" + RmsPM.BLL.MathRule.GetDecimalShowString(ViewState["SumChangeMoney"]); break; } }
protected void listOrders_ItemDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "OrderStatus"); string a = ""; if (System.Web.UI.DataBinder.Eval(e.Row.DataItem, "Gateway") != null && !(System.Web.UI.DataBinder.Eval(e.Row.DataItem, "Gateway") is System.DBNull)) { a = (string)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "Gateway"); } System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("hplinkorderreview"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("hlinkPay"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Row.FindControl("lkbtnConfirmOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Row.FindControl("lkbtnCloseOrder"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lkbtnApplyForRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lkbtnApplyForReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor4 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lkbtnApplyForReplace"); if (hyperLink != null) { hyperLink.Visible = (orderStatus == OrderStatus.Finished); } htmlAnchor.Visible = (orderStatus == OrderStatus.WaitBuyerPay && a != "hishop.plugins.payment.podrequest"); imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent); imageLinkButton2.Visible = (orderStatus == OrderStatus.WaitBuyerPay); htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid); htmlAnchor3.Visible = (orderStatus == OrderStatus.SellerAlreadySent); htmlAnchor4.Visible = (orderStatus == OrderStatus.SellerAlreadySent); } }
protected void Page_Load(object sender, EventArgs e) { string categoryId = Request.QueryString["categoryId"]; if (!string.IsNullOrEmpty(categoryId)) { // process Home Page link HtmlAnchor lnkHome = new HtmlAnchor(); lnkHome.InnerText = "Home"; lnkHome.HRef = "~/Default.aspx"; plhControl.Controls.Add(lnkHome); plhControl.Controls.Add(GetDivider()); // Process Product page link HtmlAnchor lnkProducts = new HtmlAnchor(); lnkProducts.InnerText = WebUtility.GetCategoryName(categoryId); lnkProducts.HRef = string.Format(PRODUCTS_URL, categoryId); plhControl.Controls.Add(lnkProducts); string productId = Request.QueryString["productId"]; if (!string.IsNullOrEmpty(productId)) { // Process Item page link plhControl.Controls.Add(GetDivider()); HtmlAnchor lnkItemDetails = new HtmlAnchor(); lnkItemDetails.InnerText = WebUtility.GetProductName(productId); lnkItemDetails.HRef = string.Format(ITEMS_URL, categoryId, productId); plhControl.Controls.Add(lnkItemDetails); } } // Add cache dependency this.CachePolicy.Dependency = DependencyFacade.GetItemDependency(); }
/// <summary> /// Adds the item. /// </summary> /// <param name="text"> /// The text string. /// </param> /// <param name="url"> /// The URL string. /// </param> public void AddItem(string text, string url) { var a = new HtmlAnchor { InnerHtml = string.Format("<span>{0}</span>", text), HRef = url }; string adminRootFolder = string.Format("{0}admin", Utils.RelativeWebRoot); var startIndx = url.LastIndexOf("/admin/") > 0 ? url.LastIndexOf("/admin/") : 0; var endIndx = url.LastIndexOf(".") > 0 ? url.LastIndexOf(".") : url.Length; var nodeDir = url.Substring(startIndx, endIndx - startIndx); if (Request.RawUrl.IndexOf(nodeDir, StringComparison.OrdinalIgnoreCase) != -1) { a.Attributes["class"] = "current"; } // if "page" has its own subfolder (comments, extensions) should // select parent tab when navigating through child tabs if (!SubUrl(Request.RawUrl, true).Equals(adminRootFolder, StringComparison.OrdinalIgnoreCase) && SubUrl(Request.RawUrl, true) == SubUrl(url, false)) { a.Attributes["class"] = "current"; } var li = new HtmlGenericControl("li"); li.Controls.Add(a); ulMenu.Controls.Add(li); }
protected void MasterDetail_Item_List_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { WebModuleInfo MasterDetailModule = (WebModuleInfo)e.Row.DataItem; WebpageInfo page = MasterDetailModule.Webpage; MasterDetailItem item = MasterDetailItem.GetSafeResource(MasterDetailModule.Id); System.Web.UI.HtmlControls.HtmlAnchor selectLink = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("SelectLink"); selectLink.HRef = ResolveUrl(MasterDetailModule.GetEditUrl()) //cheesy + "&returnTo=" + Server.UrlEncode(Request.Url.PathAndQuery); selectLink.InnerHtml = MasterDetailItem.Chop(page.Title, 45, true); Literal postDateCtl = (Literal)e.Row.FindControl("PostDateCtl"); if (page.PostDate.HasValue) { postDateCtl.Text = page.PostDate.Value.ToShortDateString(); if (page.PostDate.Value.TimeOfDay.TotalSeconds > .001) { postDateCtl.Text = string.Format("{0} {1}", postDateCtl.Text, page.PostDate.Value.ToShortTimeString()); } } CheckBox visibleCtl = (CheckBox)e.Row.FindControl("VisibleCtl"); visibleCtl.Checked = page.Visible; CheckBox featuredCtl = (CheckBox)e.Row.FindControl("FeaturedCtl"); featuredCtl.Checked = item.IsFeatured; } }
protected override void AddedControl(System.Web.UI.Control control, int index) { base.AddedControl(control, index); if (control is TabItem) { if (_ul == null) { _ul = new HtmlGenericControl("ul") { EnableViewState = false }; Controls.AddAt(0, _ul); _tabItemAnchorDictionary = new Dictionary<TabItem, HtmlAnchor>(); } TabItem tabItem = (TabItem) control; HtmlGenericControl li = new HtmlGenericControl("li"); _ul.Controls.Add(li); HtmlAnchor a = new HtmlAnchor(); li.Controls.Add(a); a.HRef = "#" + tabItem.ClientID; a.InnerText = tabItem.ToolTip; _tabItemAnchorDictionary.Add(tabItem, a); } }
private void AddEmailAnchor(Panel p) { emailAnchor = new HtmlAnchor(); emailAnchor.ID = "SendEmailAnchor"; emailAnchor.InnerHtml = "<img src='" + MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPReportParameters", "EmailIcon") + "' />"; p.Controls.Add(emailAnchor); }
protected void Page_Load(object sender, EventArgs e) { if (pairs != null && pairs.Count > 0) { for(int i=0; i<pairs.Count; i++) { HtmlGenericControl control = new HtmlGenericControl("li"); Pair pair = pairs[i]; HtmlAnchor anchor = new HtmlAnchor(); anchor.HRef = pair.Second as string; anchor.InnerText = pair.First as string; // assign last anchor id if (i == pairs.Count - 1) { anchor.ID = "__breadcrumb_lastanchor"; } control.Controls.Add(anchor); this.breadcrumb.Controls.Add(control); } HtmlGenericControl emptySpan = new HtmlGenericControl("span"); emptySpan.InnerHtml = " "; this.breadcrumb.Controls.Add(emptySpan); } }
protected void listOrders_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus"); System.DateTime t = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate") == System.DBNull.Value) ? System.DateTime.Now.AddYears(-1) : ((System.DateTime)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate")); string a = ""; if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull)) { a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway"); } System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hplinkorderreview"); System.Web.UI.HtmlControls.HtmlAnchor linkNowPay = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("hlinkPay"); ImageLinkButton confirmOrder = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); ImageLinkButton cancelOrder = (ImageLinkButton)e.Item.FindControl("lkbtnCloseOrder"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForRefund = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReturn = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReturn"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnNotPay = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnNotPay"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReplace = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReplace"); System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rpProduct"); //查看物流 System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("Logistics"); if (hyperLink != null) { hyperLink.Visible = (orderStatus == OrderStatus.Finished); } SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); //未付款 lkbtnNotPay.Visible = (orderStatus == OrderStatus.WaitBuyerPay); //退货 lkbtnApplyForReturn.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays))); //退款 lkbtnApplyForRefund.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || orderStatus == OrderStatus.SellerAlreadySent); //换货 lkbtnApplyForReplace.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays))); /*1.等待买家付款(WaitBuyerPay) -> 未付款/取消 * 2.已付款,等待发货(BuyerAlreadyPaid) -> 退款 * 3.已发货(SellerAlreadySent) ->退款,确认收货,查看物流 * 4.订单已完成(Finished) -> 退货/换货 查看物流 */ if (repeater != null) { string orderId = ((DataRowView)e.Item.DataItem).Row["OrderId"].ToString(); if (!string.IsNullOrEmpty(orderId)) { DataTable dt = TradeHelper.GetOrderItemThumbnailsUrl(orderId); repeater.DataSource = dt; repeater.DataBind(); } } } }
private void dlstRefund_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblHandleStatus"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnReceive = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnReceive"); if (label.Text == "0") { label.Text = "待处理"; lkbtnReceive.Visible = true; return; } if (label.Text == "1") { label.Text = "已完成"; return; } else if (label.Text == "3") { htmlAnchor.Visible = true; label.Text = "已受理"; return; } if (label.Text == "2") { label.Text = "已拒绝"; return; } } }
public void AddLink(HtmlAnchor link) { if(HtmlAnchors == null) HtmlAnchors = new List<HtmlAnchor>(); HtmlAnchors.Add(link); }
protected void Page_Load(object sender, EventArgs e) { var temp = new Movie(); var movies = temp.getAll(); Table table = new Table(); foreach (int moid in movies.Keys) { TableRow row = new TableRow(); TableCell imageCell = new TableCell(); Image image = new Image(); image.ImageUrl = movies[moid].read("imgurl").ToString(); HtmlAnchor anchor = new HtmlAnchor(); anchor.HRef = "/show_movie.aspx?moid=" + movies[moid].id; anchor.Controls.Add(image); imageCell.Controls.Add(anchor); row.Controls.Add(imageCell); TableCell cell = new TableCell(); cell.VerticalAlign = VerticalAlign.Top; cell.Text = "<h2>" + movies[moid].read("title").ToString() + "</h2>"; row.Controls.Add(cell); cell.Text += (movies[moid].read("description").ToString().Length > 1024) ? movies[moid].read("description").ToString().Substring(0, 1024) + "..." : movies[moid].read("description").ToString(); row.Controls.Add(cell); table.Controls.Add(row); } PlaceHolder1.Controls.Add(table); }
void CreateLink() { if (HyperLink == null) { HyperLink = new System.Web.UI.HtmlControls.HtmlAnchor(); Controls.AddAt(0, HyperLink); } HyperLink.Target = Target ?? ""; HyperLink.HRef = NavigateUrl ?? "#"; //HyperLink.InnerText = Text; var spanText = (HtmlGenericControl)HyperLink.Controls.Cast <Control>().FirstOrDefault(c => c is HtmlGenericControl && ((HtmlGenericControl)c).Attributes["class"].Contains("menuText")); if (spanText == null) { spanText = new HtmlGenericControl("SPAN"); spanText.Attributes["class"] = "menuText"; HyperLink.Controls.Add(spanText); } spanText.InnerHtml = text; if (!string.IsNullOrEmpty(iconCssClass)) { var span = (HtmlGenericControl)HyperLink.Controls.Cast <Control>().FirstOrDefault(c => c is HtmlGenericControl && ((HtmlGenericControl)c).Attributes["class"].Contains("iconSpan")); if (span == null) { span = new HtmlGenericControl("SPAN"); span.Attributes["class"] = "iconSpan " + iconCssClass; HyperLink.Controls.AddAt(0, span); } } }
/* * this function and CreatePagesNo (the previous function) are to do pagination of patients list, setting style and events for each page no and first, prev, next and last icons. */ private void AddPageNavigator(string strNavigateCode, bool ShowFlag) { if (!ShowFlag) { return; } System.Web.UI.HtmlControls.HtmlAnchor aPage = new System.Web.UI.HtmlControls.HtmlAnchor(); switch (strNavigateCode) { case "F": aPage.InnerText = "<<"; break; case "P": aPage.InnerText = "<"; break; case "N": aPage.InnerText = ">"; break; case "L": aPage.InnerText = ">>"; break; case "G": aPage.InnerText = "Go"; break; } aPage.Attributes.Add("class", "squareBtn"); aPage.Attributes.Add("style", "font-size:7.5pt;font-weight:normal"); aPage.HRef = "#"; aPage.Attributes.Add("onclick", "javascript:PageNavigator('" + strNavigateCode + "')"); div_PagesNo.Controls.Add(aPage); }
/// <summary> /// Initializes a new instance of the <see cref="GeoPicker" /> class. /// </summary> public GeoPicker() { RequiredFieldValidator = new HiddenFieldValidator(); HelpBlock = new HelpBlock(); _btnSelect = new HtmlAnchor(); _btnSelectNone = new HtmlAnchor(); }
private void AddAttachmentAnchor(HtmlGenericControl h) { if (this.DisplayAttachmentButton) { if (this.GetTranId().Equals("0")) { return; } if (string.IsNullOrWhiteSpace(this.AttachmentBookName)) { return; } string overridePath = this.OverridePath; if (string.IsNullOrWhiteSpace(overridePath)) { overridePath = PageUtility.GetCurrentPageUrl(this.Page); } string attachmentUrl = string.Format(CultureInfo.InvariantCulture, "~/Modules/BackOffice/AttachmentManager.mix?OverridePath={0}&Book={1}&Id={2}", overridePath, this.AttachmentBookName, this.GetTranId()); using (HtmlAnchor anchor = new HtmlAnchor()) { anchor.ID = "AttachmentAnchor"; anchor.InnerHtml = "<i class='icon cloud upload'></i>" + Titles.UploadAttachmentsForThisTransaction; anchor.Attributes.Add("class", "item"); anchor.HRef = attachmentUrl; h.Controls.Add(anchor); } } }
protected override void CreateChildControls() { if (RenderLink) { var link = new HtmlAnchor {InnerText = Text, HRef = "#"}; link.Attributes.Add("onclick", "ImportUsersManager.ShowImportControl();"); if (!string.IsNullOrEmpty(LinkStyle)) link.Attributes.Add("class", LinkStyle); Controls.Add(link); } Controls.Add(Page.LoadControl(ImportUsersTemplate.Location)); _users = new ImportUsers(); _users = (ImportUsers)_users.LoadControl(ImportUsers.Location); Controls.Add(new LiteralControl("<div id=\"importAreaBlock\" class=\"importAreaBlock\" style=\"display:none\">")); _localContainer = new Container { Body = new PlaceHolder(), Header = new PlaceHolder() }; _localContainer.Body.Controls.Add(_users); var html = new HtmlGenericControl("DIV") { InnerHtml = CustomNamingPeople.Substitute<Resources.Resource>("ImportContactsHeader").HtmlEncode() }; _localContainer.Header.Controls.Add(html); Controls.Add(_localContainer); Controls.Add(new LiteralControl("</div>")); Controls.Add(Page.LoadControl(TariffLimitExceed.Location)); base.CreateChildControls(); ChildControlsCreated = true; }
protected void Page_Init(object sender, EventArgs e) { this.IsLandingPage = true; using (HtmlGenericControl header = new HtmlGenericControl("h1")) { header.InnerText = Titles.RestrictedTransactionMode; this.Placeholder1.Controls.Add(header); } using (HtmlGenericControl divider = HtmlControlHelper.GetDivider()) { this.Placeholder1.Controls.Add(divider); } using (HtmlGenericControl p = new HtmlGenericControl("p")) { p.InnerText = Warnings.RestrictedTransactionMode; this.Placeholder1.Controls.Add(p); } using (HtmlAnchor anchor = new HtmlAnchor()) { anchor.InnerText = Titles.BackToPreviousPage; anchor.HRef = "javascript:history.go(-1);"; anchor.Attributes.Add("class", "ui pink button"); this.Placeholder1.Controls.Add(anchor); } }
private void AddEmailAnchor(Panel p) { emailAnchor = new HtmlAnchor(); emailAnchor.ID = "SendEmailAnchor"; emailAnchor.InnerHtml = "<img src='" + this.Page.ResolveUrl(MixERP.Net.Common.Helpers.ConfigurationHelper.GetReportParameter("EmailIcon")) + "' />"; p.Controls.Add(emailAnchor); }
/// <summary> /// Adds the item. /// </summary> /// <param name="text"> /// The text string. /// </param> /// <param name="url"> /// The URL string. /// </param> public void AddItem(string text, string url) { var a = new HtmlAnchor { InnerHtml = string.Format("<span>{0}</span>", text), HRef = url }; var li = new HtmlGenericControl("li"); li.Controls.Add(a); ulMenu.Controls.Add(li); }
protected void Page_Load(object sender, EventArgs e) { ltrSuccessMessage.Text = "Paymrnt Success "; HtmlAnchor anc = new HtmlAnchor(); anc.HRef = Web.Components.WebConfigSettings.SiteRoot; anc.InnerText = "Go to home"; dvmessage.Controls.Add(anc); }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lkbtnSendGoods"); object obj = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway"); string a = ""; if (obj != null && !(obj is System.DBNull)) { a = obj.ToString(); } ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkbtnEditPurchaseOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litClosePurchaseOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseReplace"); ImageLinkButton imageLinkButton3 = (ImageLinkButton)e.Item.FindControl("lkbtnOrderMatch"); if (orderStatus == OrderStatus.WaitBuyerPay) { literal.Visible = true; htmlGenericControl.Visible = true; if (a != "hishop.plugins.payment.podrequest") { imageLinkButton2.Visible = true; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")) { imageLinkButton3.Visible = true; } if (orderStatus == OrderStatus.ApplyForRefund) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.ApplyForReturns) { htmlAnchor2.Visible = true; } if (orderStatus == OrderStatus.ApplyForReplacement) { htmlAnchor3.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); SalesHelper.GetPurchaseOrder(purchaseOrderId); label.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")); imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent); string orderid = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseOrderId"); if (Methods.Supplier_ShipOrderHasAllSendGood(orderid) && orderStatus == OrderStatus.SellerAlreadySent) { imageLinkButton.Visible = true; return; } imageLinkButton.Visible = false; } }
private void AddCloseAnchor(Panel p) { closeAnchor = new HtmlAnchor(); closeAnchor.ID = "CloseAnchor"; closeAnchor.HRef = "#"; closeAnchor.Attributes.Add("onclick", "window.close();"); closeAnchor.InnerHtml = "<img src='" + this.Page.ResolveUrl(MixERP.Net.Common.Helpers.ConfigurationHelper.GetReportParameter("CloseIcon")) + "' />"; p.Controls.Add(closeAnchor); }
/// <summary> /// Renders the contents of the control to the specified writer. This method is used primarily by control developers. /// </summary> /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param> protected override void RenderContents(HtmlTextWriter writer) { writer.AddPrevalueRow("Add prevalue:", this.TextControl, this.RequiredControl); // get the existing prevalues var prevalues = PreValues.GetPreValues(this.m_DataType.DataTypeDefinitionId).GetValueList(); // check if there are any prevalues if (prevalues != null && prevalues.Count > 0) { // create placeholder DIV tag var placeholder = new HtmlGenericControl("div"); // loop through each of the prevalues foreach (PreValue value in prevalues) { // if the value is empty, then remove it if (string.IsNullOrEmpty(value.Value)) { value.Delete(); break; } // create row var row = new HtmlGenericControl("div"); row.Attributes.Add("class", "row clearfix"); // create the label var label = new HtmlGenericControl("div"); label.Attributes.Add("class", "label"); label.InnerText = value.Value; // create the field var field = new HtmlGenericControl("div"); field.Attributes.Add("class", "field"); // create the anchor var anchor = new System.Web.UI.HtmlControls.HtmlAnchor(); anchor.HRef = string.Concat("?id=", this.m_DataType.DataTypeDefinitionId, "&delete=", value.Id); anchor.InnerText = ui.Text("delete"); anchor.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete this value?');"); // add the anchor to the field field.Controls.Add(anchor); // add the label and field to the row row.Controls.Add(label); row.Controls.Add(field); // add the row to the placeholder placeholder.Controls.Add(row); } // render the placeholder writer.AddPrevalueRow("Values:", placeholder); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } System.Web.UI.HtmlControls.HtmlAnchor i = (System.Web.UI.HtmlControls.HtmlAnchor)Master.FindControl("assistencia"); i.Attributes.Remove("class"); i.Attributes.Add("class", "item active"); }
public void AddCell(TableRow row, string cellText, string hyperlink) { TableCell cell1 = new TableCell(); HtmlAnchor anchor1 = new HtmlAnchor(); anchor1.HRef = hyperlink; anchor1.InnerText = cellText; cell1.Controls.Add(anchor1); row.Cells.Add(cell1); }
private static Control AppendAnchor(Control container, string name, string url, bool exists) { HtmlAnchor a = new HtmlAnchor(); a.HRef = url; a.InnerHtml = name; a.Attributes["class"] = exists ? null : "new"; container.Controls.Add(a); return a; }
protected override void AttachChildControls() { this.orderId = this.Page.Request.QueryString["orderId"]; this.order = ShoppingProcessor.GetOrderInfo(this.orderId); if (this.order == null) { base.GotoResourceNotFound(""); } if (!this.Page.IsPostBack) { //string text = System.Web.HttpContext.Current.Request.QueryString["action"]; //if (!string.IsNullOrEmpty(text) && text == "topay") //{ // this.GotoPay(); //} this.GotoPay(); } this.litOrderId = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId"); this.litOrderTotal = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal"); this.litPaymentType = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litPaymentType"); this.litPaymentName = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentName"); this.litPaymentType.SetWhenIsNotNull(this.order.PaymentTypeId.ToString()); this.litOrderId.SetWhenIsNotNull(this.orderId); this.litOrderTotal.SetWhenIsNotNull(this.order.GetTotal().ToString("F2")); //if (TradeHelper.CheckIsUnpack(order.OrderId)) //{ // decimal childOrdertotal = ShoppingProcessor.GetChildOrderTotal(order.OrderId); // this.litOrderTotal.Text = childOrdertotal.ToString("F2"); //} this.litPaymentName.Text = this.order.PaymentType; this.divhelper = (System.Web.UI.HtmlControls.HtmlGenericControl) this.FindControl("helper"); if (this.order.Gateway != "ecdev.plugins.payment.bankrequest") { this.divhelper.Visible = false; } else { this.divhelper.Visible = true; this.litHelperText = (System.Web.UI.WebControls.Literal) this.FindControl("litHelperText"); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent); } this.btnToPay = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("btnToPay"); if (this.btnToPay != null) { this.btnToPay.HRef = "FinishOrder.aspx?orderId=" + this.orderId + "&action=topay"; } else { this.GotoPay(); } if (this.btnToPay != null && (this.order.Gateway == "ecdev.plugins.payment.podrequest" || this.order.Gateway == "ecdev.plugins.payment.bankrequest")) { this.btnToPay.Visible = false; } PageTitle.AddSiteNameTitle("下单成功"); }
public void InstantiateIn(Control container) { selectAnchor = new HtmlAnchor(); selectAnchor.HRef = "#"; selectAnchor.Attributes.Add("class", MixERP.Net.Common.Helpers.ConfigurationHelper.GetScrudParameter("ItemSelectorSelectAnchorCssClass")); selectAnchor.DataBinding += this.BindData; selectAnchor.InnerText = Resources.ScrudResource.Select; container.Controls.Add(selectAnchor); }
public void InstantiateIn(Control container) { selectAnchor = new HtmlAnchor(); selectAnchor.HRef = "#"; selectAnchor.Attributes.Add("class", "linkbutton");//Todo: parameterize this later. selectAnchor.DataBinding += this.BindData; selectAnchor.InnerText = Resources.ScrudResource.Select; container.Controls.Add(selectAnchor); }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnPay"); System.Web.UI.WebControls.HyperLink hyperLink2 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnSendGoods"); System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkBtnCancelPurchaseOrder"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); string orderId = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderId"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPayment"); if (orderStatus == OrderStatus.SellerAlreadySent) { OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId); if (orderInfo != null && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) { hyperLink2.Visible = true; } else { imageLinkButton.Visible = true; } htmlAnchor2.Visible = true; htmlAnchor3.Visible = true; } if (orderStatus == OrderStatus.WaitBuyerPay) { hyperLink.Visible = true; htmlGenericControl.Visible = true; if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != System.DBNull.Value && "hishop.plugins.payment.podrequest" == (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway")) { hyperLink.Visible = false; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid) { htmlAnchor.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId); if (string.IsNullOrEmpty(purchaseOrder.PaymentType)) { if (orderStatus == OrderStatus.BuyerAlreadyPaid) { literal.Text = "<br>支付方式:预付款"; return; } } else { literal.Text = "<br>支付方式:" + purchaseOrder.PaymentType; } } }
/// <summary> /// Creates the template for the repeater item /// </summary> /// <param name="container"></param> public void InstantiateIn(Control container) { var itemDiv = new HtmlGenericControl("div"); itemDiv.ID = "Item"; itemDiv.Attributes.Add("class", "item"); var page = (Page)HttpContext.Current.CurrentHandler; var imgPreview = (ImageViewer)page.LoadControl( string.Concat(SystemDirectories.Umbraco, "/controls/Images/ImageViewer.ascx")); imgPreview.ID = "ImgPreview"; imgPreview.Visible = false; //hidden by default imgPreview.ViewerStyle = ImageViewer.Style.Basic; itemDiv.Controls.Add(imgPreview); var infoBtn = new HtmlAnchor(); infoBtn.ID = "InfoButton"; infoBtn.HRef = "javascript:void(0);"; infoBtn.Attributes.Add("class", "info"); itemDiv.Controls.Add(infoBtn); var innerDiv = new HtmlGenericControl("div"); innerDiv.ID = "InnerItem"; innerDiv.Attributes.Add("class", "inner"); innerDiv.Controls.Add( new LiteralControl(@"<ul class=""rightNode"">")); var liSelectNode = new HtmlGenericControl("li"); liSelectNode.Attributes.Add("class", "closed"); liSelectNode.ID = "SelectedNodeListItem"; innerDiv.Controls.Add(liSelectNode); var selectedNodeLink = new HtmlAnchor(); selectedNodeLink.ID = "SelectedNodeLink"; selectedNodeLink.Attributes.Add("class", "sprTree"); selectedNodeLink.Attributes.Add("title", "Sync tree"); innerDiv.Controls.Add(selectedNodeLink); var selectedNodeText = new Literal(); selectedNodeText.ID = "SelectedNodeText"; innerDiv.Controls.Add(selectedNodeText); selectedNodeLink.Controls.Add(new LiteralControl("<div>")); selectedNodeLink.Controls.Add(selectedNodeText); selectedNodeLink.Controls.Add(new LiteralControl("</div>")); liSelectNode.Controls.Add(selectedNodeLink); innerDiv.Controls.Add( new LiteralControl(@"</ul><a class='close' title='Remove' href='javascript:void(0);'></a>")); itemDiv.Controls.Add(innerDiv); container.Controls.Add(itemDiv); }
protected void relatedImages_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //get the ImageReference object that is bound to the current row. ImageReference imageDetails = (ImageReference)e.Item.DataItem; if (imageDetails != null) { System.Web.UI.HtmlControls.HtmlImage termImage = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("termImage"); if (termImage != null) { termImage.Alt = imageDetails.AltText; if (!string.IsNullOrEmpty(imageDetails.Filename)) { System.Web.UI.HtmlControls.HtmlAnchor termEnlargeImage = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("termEnlargeImage"); //if either the regular image size or the enlarge image size is not in the config file //default to the full image in the database if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageRegular"]) || string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageEnlarge"])) { termImage.Src = imageDetails.Filename; if (termEnlargeImage != null) { termEnlargeImage.HRef = imageDetails.Filename; termEnlargeImage.InnerText = DictionaryLanguage == "es" ? "Ampliar" : "Enlarge"; } //log a warning log.WarnFormat("Web.Config file does not specify image sizes for term id: {0}. Display full image.", CdrID); } else { string[] regularTermImage = imageDetails.Filename.Split('.'); if (regularTermImage.Length == 2) { //termImage image size is 571 //example format CDR526538-571.jpg termImage.Src = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageRegular"] + "." + regularTermImage[1]; //enlarge image size is 750 //example format CDR526538-750.jpg if (termEnlargeImage != null) { termEnlargeImage.HRef = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageEnlarge"] + "." + regularTermImage[1]; termEnlargeImage.InnerText = DictionaryLanguage == "es" ? "Ampliar" : "Enlarge"; } } } } } } } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["AfficheId"], out this.affichesId)) { base.GotoResourceNotFound(); } this.litAffichesAddedDate = (FormatedTimeLabel) this.FindControl("litAffichesAddedDate"); this.litContent = (Literal) this.FindControl("litContent"); this.litTilte = (Literal) this.FindControl("litTilte"); this.lblFront = (Label) this.FindControl("lblFront"); this.lblNext = (Label) this.FindControl("lblNext"); this.aFront = (HtmlAnchor) this.FindControl("front"); this.aNext = (HtmlAnchor) this.FindControl("next"); this.lblFrontTitle = (Label) this.FindControl("lblFrontTitle"); this.lblNextTitle = (Label) this.FindControl("lblNextTitle"); if (!this.Page.IsPostBack) { AfficheInfo affiche = CommentBrowser.GetAffiche(this.affichesId); if (affiche != null) { PageTitle.AddTitle(affiche.Title, HiContext.Current.Context); this.litTilte.Text = affiche.Title; string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("AffichesDetails", new object[] { this.affichesId }); this.litContent.Text = affiche.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litAffichesAddedDate.Time = affiche.AddedDate; AfficheInfo frontOrNextAffiche = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Front"); AfficheInfo info3 = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Next"); if ((frontOrNextAffiche != null) && (frontOrNextAffiche.AfficheId > 0)) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche.AfficheId; this.lblFrontTitle.Text = frontOrNextAffiche.Title; } } else if (this.lblFront != null) { this.lblFront.Visible = false; } if ((info3 != null) && (info3.AfficheId > 0)) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "AffichesDetails.aspx?afficheId=" + info3.AfficheId; this.lblNextTitle.Text = info3.Title; } } else if (this.lblNext != null) { this.lblNext.Visible = false; } } } }
public Control AddTo(Control container, ViewContext context) { string[] link = context.Fragment.ToString().Trim('[', ']').Split('|'); HtmlAnchor a = new HtmlAnchor(); a.HRef = link[0]; a.InnerHtml = link.Length > 1 ? link[1] : link[0]; a.Attributes["rel"] = "nofollow"; // fight linkspam container.Controls.Add(a); return a; }
private void ProcessHomePageLink() { HtmlAnchor lnkHome = new HtmlAnchor(); lnkHome.InnerText = "Home"; lnkHome.HRef = "~/Default.aspx"; plhControl.Controls.Add(lnkHome); plhControl.Controls.Add(GetDivider()); }
public void InstantiateIn(Control container) { this.selectAnchor = new HtmlAnchor(); this.selectAnchor.HRef = "#"; this.selectAnchor.Attributes.Add("class", ConfigurationHelper.GetScrudParameter("ItemSelectorSelectAnchorCssClass")); this.selectAnchor.DataBinding += this.BindData; this.selectAnchor.InnerText = Titles.Select; container.Controls.Add(this.selectAnchor); }
/// <summary> /// Adds the item. /// </summary> /// <param name="text"> /// The text string. /// </param> /// <param name="url"> /// The URL string. /// </param> public void AddItem(string text, string url) { var a = new HtmlAnchor { InnerHtml = string.Format("<span>{0}</span>", text), HRef = url }; System.Diagnostics.Debug.WriteLine("AddItem: " + a.HRef.ToString()); var li = new HtmlGenericControl("li"); li.Controls.Add(a); ulMenu.Controls.Add(li); }
private void AddBackAnchor(HtmlGenericControl h) { using (HtmlAnchor anchor = new HtmlAnchor()) { anchor.InnerHtml = "<i class='icon backward'></i>" + Titles.Back; anchor.Attributes.Add("class", "item"); anchor.HRef = "javascript:history.go(-1);"; h.Controls.Add(anchor); } }
/// <summary> /// Creates the image link. /// </summary> /// <param name="url">The URL.</param> /// <param name="title">The title.</param> /// <param name="image">The image.</param> /// <returns></returns> protected HtmlAnchor CreateImageLink(string url, string title, string image) { HtmlAnchor a = new HtmlAnchor(); a.HRef = url; Image img = new Image(); img.ImageUrl = image; img.AlternateText = title; img.ToolTip = title; a.Controls.Add(img); return a; }
private void AddExcelAnchor(Panel p) { excelAnchor = new HtmlAnchor(); excelAnchor.ID = "ExcelAnchor"; excelAnchor.HRef = "#"; excelAnchor.InnerHtml = "<img src='" + this.Page.ResolveUrl(MixERP.Net.Common.Helpers.ConfigurationHelper.GetReportParameter("ExcelIcon")) + "' />"; excelAnchor.ServerClick += ExcelAnchor_ServerClick; excelAnchor.Attributes.Add("onclick", this.GetReportHtmlScript()); p.Controls.Add(excelAnchor); }
private void SetButtonText(HtmlAnchor link, IArticle article) { if (article == null) { link.Visible = false; } else { link.InnerText = article.Title; link.HRef = library.NiceUrl(article.Id); } }
private System.Web.UI.HtmlControls.HtmlAnchor GetHtmlLink(string name, System.Web.UI.WebControls.RepeaterItem ri) { System.Web.UI.HtmlControls.HtmlAnchor obj = null; try { obj = (System.Web.UI.HtmlControls.HtmlAnchor)ri.FindControl(name); } catch { } return(obj); }
public void DefaultProperties () { HtmlAnchor a = new HtmlAnchor (); Assert.AreEqual (0, a.Attributes.Count, "Attributes.Count"); Assert.AreEqual (String.Empty, a.HRef, "HRef"); Assert.AreEqual (String.Empty, a.Name, "Name"); Assert.AreEqual (String.Empty, a.Target, "Target"); Assert.AreEqual (String.Empty, a.Title, "Title"); Assert.AreEqual ("a", a.TagName, "TagName"); }
protected override void AttachChildControls() { this.linDevelopReferrals = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("linDevelopReferrals"); this.imgQRCode = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgQRCode"); Member member = HiContext.Current.User as Member; if (member.ReferralStatus != 2) { this.Page.Response.Redirect("ReferralRegisterAgreement.aspx"); } System.Uri url = System.Web.HttpContext.Current.Request.Url; string text = (url.Port == 80) ? string.Empty : (":" + url.Port.ToString(System.Globalization.CultureInfo.InvariantCulture)); this.linDevelopReferrals.HRef = string.Concat(new object[] { string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}://{1}{2}/VShop/Login.aspx", new object[] { url.Scheme, HiContext.Current.SiteSettings.SiteUrl, text }), Globals.ApplicationPath, "?ReferralUserId=", HiContext.Current.User.UserId, "&action=register" }); string text2 = this.Page.Request.MapPath(Globals.ApplicationPath + "/Storage/master/QRCode_VShop/"); if (System.IO.File.Exists(string.Concat(new object[] { text2, "referral_", member.UserId, ".png" }))) { this.imgQRCode.Src = string.Concat(new object[] { Globals.ApplicationPath, "/Storage/master/QRCode_VShop/referral_", member.UserId, ".png" }); return; } if (this.linDevelopReferrals.HRef.IndexOf("/VShop/Login.aspx") == -1) { this.imgQRCode.Src = this.CreateQRCode(this.linDevelopReferrals.HRef.Replace("/Login.aspx", "/VShop/Login.aspx"), member.UserId); return; } this.imgQRCode.Src = this.CreateQRCode(this.linDevelopReferrals.HRef, member.UserId); }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkbtnClosePurchaseOrder"); System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnPay"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litTbOrderDetailLink"); System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPayment"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); if (orderStatus == OrderStatus.WaitBuyerPay) { htmlGenericControl.Visible = true; if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") == System.DBNull.Value || "hishop.plugins.payment.podrequest" != (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway")) { hyperLink.Visible = true; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.SellerAlreadySent) { htmlAnchor2.Visible = true; htmlAnchor3.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId); if (string.IsNullOrEmpty(purchaseOrder.PaymentType)) { if (orderStatus == OrderStatus.BuyerAlreadyPaid) { literal2.Text = "<br>支付方式:预付款"; } } else { literal2.Text = "<br>支付方式:" + purchaseOrder.PaymentType; } imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent); object obj = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "TaobaoOrderId"); if (obj != null && obj != System.DBNull.Value && obj.ToString().Length > 0) { literal.Text = string.Format("<a target=\"_blank\" href=\"http://trade.taobao.com/trade/detail/trade_item_detail.htm?bizOrderId={0}\"><span>来自淘宝</span></a>", obj); } } }
private void GetHtmlLink(string name, Page p, bool b) { try { System.Web.UI.HtmlControls.HtmlAnchor obj = (System.Web.UI.HtmlControls.HtmlAnchor)p.Page.FindControl(name); if (obj != null) { obj.Visible = b; } } catch { } }
/// <summary> /// 翻页事件 /// </summary> /// <param name="source"></param> /// <param name="e"></param> private void dgTaskList_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e) { System.Web.UI.WebControls.CheckBox chkWBS; try { StringBuilder strBuilder = new StringBuilder(); StringBuilder strBuilderName = new StringBuilder(); foreach (DataGridItem oDataGridItem in this.dgTaskList.Items) { chkWBS = (CheckBox)oDataGridItem.FindControl("checkTask"); if (chkWBS.Checked == true) { strBuilder.Append(this.dgTaskList.DataKeys[oDataGridItem.ItemIndex].ToString()); strBuilder.Append(","); System.Web.UI.HtmlControls.HtmlAnchor anchor = (System.Web.UI.HtmlControls.HtmlAnchor) this.dgTaskList.Items[oDataGridItem.ItemIndex].FindControl("taskName"); strBuilderName.Append(anchor.Attributes["name"]); strBuilderName.Append(","); } } ViewState["SelectCode"] = ViewState["SelectCode"] + "," + strBuilder.ToString(); ViewState["SelectName"] = ViewState["SelectName"] + "," + strBuilderName.ToString(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "保存相关工作项失败"); } this.dgTaskList.CurrentPageIndex = e.NewPageIndex; LoadData(); try { int i = 0; foreach (DataGridItem oDataGridItem in this.dgTaskList.Items) { chkWBS = (CheckBox)oDataGridItem.FindControl("checkTask"); if (ViewState["SelectCode"].ToString().IndexOf(this.dgTaskList.DataKeys[i].ToString()) > 0) { chkWBS.Checked = true; } i++; } } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "保存相关工作项失败"); } }
private void dlstOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus"); System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnEditPrice"); System.Web.UI.WebControls.HyperLink hyperLink2 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnSendGoods"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnCreatePurchaseOrder"); ImageLinkButton imageLinkButton3 = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litCloseOrder"); int num = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId"); int num2 = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseOrders"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReplace"); if (orderStatus == OrderStatus.WaitBuyerPay) { literal.Visible = true; hyperLink.Visible = true; imageLinkButton.Visible = true; } if (orderStatus == OrderStatus.ApplyForRefund) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.ApplyForReturns) { htmlAnchor2.Visible = true; } if (orderStatus == OrderStatus.ApplyForReplacement) { htmlAnchor3.Visible = true; } if (num > 0) { GroupBuyStatus groupBuyStatus = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus"); hyperLink2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && groupBuyStatus == GroupBuyStatus.Success); imageLinkButton2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && groupBuyStatus == GroupBuyStatus.Success && num2 == 0); } else { hyperLink2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid); } imageLinkButton3.Visible = (orderStatus == OrderStatus.SellerAlreadySent); } }
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here cornerImage.ImageUrl = "images/style" + CssStyleNum.ToString() + "/tab_corn.gif"; cornerImage.CssClass = "t_act"; if (IsRoot == true) { Table.Rows[0].Cells[0].CssClass = "t_white"; Table.Rows[0].Cells[1].CssClass = "t_white"; if (EnableLogoutButton == true && IsRoot == true) { System.Web.UI.WebControls.Literal capt = new System.Web.UI.WebControls.Literal(); capt.Text = WelcomeNote + " "; System.Web.UI.HtmlControls.HtmlAnchor anch = new System.Web.UI.HtmlControls.HtmlAnchor(); anch.HRef = LogoutHref; System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage(); img.Alt = "Logout"; img.Src = "images/logout.gif"; img.Border = 0; anch.Controls.Add(img); Table.Rows[0].Cells[0].HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Right; Table.Rows[0].Cells[0].Controls.Add(capt); Table.Rows[0].Cells[1].Controls.Add(anch); } Table.Rows[0].Cells[2].CssClass = "t_white"; } else { Table.Rows[0].Cells[0].CssClass = "t_act"; Table.Rows[0].Cells[1].CssClass = "t_act"; Table.Rows[0].Cells[2].CssClass = "t_act"; } Table.Rows[1].Cells[0].CssClass = "t_white"; Table.Rows[1].Cells[1].CssClass = "t_white"; Table.Rows[1].Cells[2].CssClass = "t_white"; Table.Rows[2].Cells[0].CssClass = "t_act"; Table.Rows[2].Cells[1].CssClass = "t_act"; Table.Rows[2].Cells[2].CssClass = "t_act"; }
protected override void AttachChildControls() { this.rptvShipping = (AliOHTemplatedRepeater)this.FindControl("rptvShipping"); this.aLinkToAdd = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("aLinkToAdd"); this.aLinkToAdd.HRef = Globals.ApplicationPath + "/Vshop/AddShippingAddress.aspx"; if (!string.IsNullOrEmpty(this.Page.Request.QueryString["returnUrl"])) { System.Web.UI.HtmlControls.HtmlAnchor expr_6D = this.aLinkToAdd; expr_6D.HRef = expr_6D.HRef + "?returnUrl=" + Globals.UrlEncode(this.Page.Request.QueryString["returnUrl"]); } System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses(); if (shippingAddresses != null) { this.rptvShipping.DataSource = shippingAddresses; this.rptvShipping.DataBind(); } PageTitle.AddSiteNameTitle("收货地址"); }
/// <summary> ///返回选中工作项的编码字符串,以","分隔 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SaveToolsButton_ServerClick(object sender, System.EventArgs e) { System.Web.UI.WebControls.CheckBox chkWBS; StringBuilder strBuilder = new StringBuilder(); StringBuilder strBuilderName = new StringBuilder(); try { foreach (DataGridItem oDataGridItem in this.dgTaskList.Items) { chkWBS = (CheckBox)oDataGridItem.FindControl("checkTask"); if (chkWBS.Checked == true) { strBuilder.Append(this.dgTaskList.DataKeys[oDataGridItem.ItemIndex].ToString()); strBuilder.Append(","); System.Web.UI.HtmlControls.HtmlAnchor anchor = (System.Web.UI.HtmlControls.HtmlAnchor) this.dgTaskList.Items[oDataGridItem.ItemIndex].FindControl("taskName"); strBuilderName.Append(anchor.Attributes["name"]); strBuilderName.Append(","); } } } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "保存相关工作项失败"); } string Code = (string)ViewState["SelectCode"] + "," + strBuilder.ToString(); string Name = (string)ViewState["SelectName"] + "," + strBuilderName.ToString(); if (Code.Length > 0) { Code = Code.Substring(0, Code.Length - 1); Response.Write(JavaScript.ScriptStart); Response.Write("window.opener.SelectTaskReturn('" + CutRepeat(Code) + "','" + CutRepeat(Name) + "');"); Response.Write("window.close();"); Response.Write(JavaScript.ScriptEnd); } else { Response.Write(JavaScript.ScriptStart); Response.Write("window.close();"); Response.Write(JavaScript.ScriptEnd); } }
private void dlstReturns_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReturns"); System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblHandleStatus"); if (label.Text == "0") { htmlAnchor.Visible = true; label.Text = "待处理"; return; } if (label.Text == "1") { label.Text = "已处理"; return; } label.Text = "已拒绝"; } }
protected void YanMenuOlustur() { IEnumerable <Kategori> kategoriler = eticaretDB.Kategoris; for (int i = 0; i < kategoriler.Count(); i++) { Kategori kategori = new Kategori(); kategori = kategoriler.ElementAt(i); IEnumerable <Alt_Kategori> alt_kategoriler = eticaretDB.Alt_Kategoris.Where(ak => ak.KategoriID == kategori.KategoriID); HtmlGenericControl li_kategori = new HtmlGenericControl("li"); li_kategori.Attributes.Add("class", "li_yanMenu"); ul_yanMenu.Controls.Add(li_kategori); HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor(); anchor.InnerText = kategori.KategoriAdi; string altKategoriPage = "AltKategori.aspx?KategoiID=" + kategori.KategoriID.ToString(); anchor.Attributes.Add("href", altKategoriPage); li_kategori.Controls.Add(anchor); HtmlGenericControl ul = new HtmlGenericControl("ul"); li_kategori.Controls.Add(ul); HtmlGenericControl li_altKategori = new HtmlGenericControl("li"); ul.Controls.Add(li_altKategori); for (int j = 0; j < alt_kategoriler.Count(); j++) { Alt_Kategori alt_kategori = new Alt_Kategori(); alt_kategori = alt_kategoriler.ElementAt(j); HtmlGenericControl anchor1 = new HtmlGenericControl("a"); string urunPage = "Urun.aspx?AltKategoriID=" + alt_kategori.AltKategoriID.ToString(); anchor1.Attributes.Add("href", urunPage); anchor1.InnerText = alt_kategori.AltKategoriAdi; li_altKategori.Controls.Add(anchor1); } } }
private void RepeaterCheck(string name, System.Web.UI.WebControls.Repeater rpt, bool b) { if (rpt != null) { foreach (RepeaterItem ri in rpt.Items) { System.Web.UI.WebControls.LinkButton lb = GetLinkButton("lnkb" + name, ri); if (lb != null) { lb.Visible = b; continue; } System.Web.UI.HtmlControls.HtmlAnchor hl = GetHtmlLink("lnk" + name, ri); if (hl != null) { hl.Visible = b; continue; } GetButton("btn" + name, ri, b); } } }
protected void YanMenuOlustur(IEnumerable <Alt_Kategori> altKategoriler) { List <Urun> urunler = new List <Urun>(); for (int i = 0; i < altKategoriler.Count(); i++) { #region Yan Menü Alt_Kategori altKategori = new Alt_Kategori(); altKategori = altKategoriler.ElementAt(i); HtmlGenericControl li_altKategori = new HtmlGenericControl("li"); li_altKategori.Attributes.Add("class", "li_yanMenu"); ul_altKategoriMenu.Controls.Add(li_altKategori); HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor(); anchor.InnerText = altKategori.AltKategoriAdi; string urunPage = "Urun.aspx?AltKategoriID=" + altKategori.AltKategoriID.ToString(); anchor.Attributes.Add("href", urunPage); li_altKategori.Controls.Add(anchor); #endregion } }
public void VendorLogoMainPage(Properties P) { try { using (cmd = new SqlCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_UI_VendorLogos_MainPage"; cmd.Connection = Getconnected.getconnecting(); using (sdr = cmd.ExecuteReader()) { if (sdr.HasRows) { while (sdr.Read()) { System.Web.UI.HtmlControls.HtmlGenericControl div1 = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); div1.Attributes["class"] = "col-md-3"; P.UI_VendorControl.Controls.Add(div1); System.Web.UI.HtmlControls.HtmlAnchor a = new System.Web.UI.HtmlControls.HtmlAnchor(); a.HRef = "#slider1"; a.Attributes["onclick"] = "#slider1"; div1.Controls.Add(a); System.Web.UI.HtmlControls.HtmlImage timerimag = new System.Web.UI.HtmlControls.HtmlImage(); //timerimag.Width = 292; //timerimag.Height = 90; timerimag.Src = sdr[1].ToString() + sdr[0].ToString(); timerimag.Alt = sdr[0].ToString(); a.Controls.Add(timerimag); } } } } } catch (Exception ex) { } }
protected void repList_ItemDataBound(object sender, RepeaterItemEventArgs e) { EyouSoft.Model.PlanStructure.TicketInfo model = (EyouSoft.Model.PlanStructure.TicketInfo)e.Item.DataItem; System.Web.UI.HtmlControls.HtmlAnchor ChuPiao = e.Item.FindControl("ChuPiao") as System.Web.UI.HtmlControls.HtmlAnchor; System.Web.UI.HtmlControls.HtmlAnchor TuiPiao = e.Item.FindControl("TuiPiao") as System.Web.UI.HtmlControls.HtmlAnchor; System.Web.UI.HtmlControls.HtmlAnchor Show = e.Item.FindControl("Show") as System.Web.UI.HtmlControls.HtmlAnchor; if (model.TicketType == EyouSoft.Model.EnumType.PlanStructure.TicketType.订单退票) { Show.Visible = false; TuiPiao.Visible = true; TuiPiao.Attributes.Add("goUrl", "JiPiao_tuipiao.aspx?id=" + model.Id.ToString()); ChuPiao.Visible = false; } if (model.State == EyouSoft.Model.EnumType.PlanStructure.TicketState.审核通过) { ChuPiao.Visible = true; TuiPiao.Visible = false; ChuPiao.Attributes.Add("goUrl", "JiPiao_chupiao.aspx?tourid=" + model.TourId + "&id=" + model.RefundId); Show.Visible = false; } Show.Attributes.Add("goUrl", "/caiwuguanli/JiPiaoAuditShow.aspx?id=" + model.RefundId); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["helpId"], out this.helpId)) { base.GotoResourceNotFound(); } this.litHelpAddedDate = (FormatedTimeLabel)this.FindControl("litHelpAddedDate"); this.litHelpDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpDescription"); this.litHelpContent = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpContent"); this.litHelpTitle = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpTitle"); this.lblFront = (System.Web.UI.WebControls.Label) this.FindControl("lblFront"); this.lblNext = (System.Web.UI.WebControls.Label) this.FindControl("lblNext"); this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle"); this.lblNextTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle"); this.aFront = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front"); this.aNext = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next"); if (!this.Page.IsPostBack) { HelpInfo help = CommentBrowser.GetHelp(this.helpId); if (help != null) { PageTitle.AddSiteNameTitle(help.Title); if (!string.IsNullOrEmpty(help.MetaKeywords)) { MetaTags.AddMetaKeywords(help.MetaKeywords, HiContext.Current.Context); } if (!string.IsNullOrEmpty(help.MetaDescription)) { MetaTags.AddMetaDescription(help.MetaDescription, HiContext.Current.Context); } this.litHelpTitle.Text = help.Title; this.litHelpDescription.Text = help.Description; string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("HelpDetails", new object[] { this.helpId }); this.litHelpContent.Text = help.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litHelpAddedDate.Time = help.AddedDate; HelpInfo frontOrNextHelp = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Front"); if (frontOrNextHelp != null && frontOrNextHelp.HelpId > 0) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "HelpDetails.aspx?helpId=" + frontOrNextHelp.HelpId; this.lblFrontTitle.Text = frontOrNextHelp.Title; } } else { if (this.lblFront != null) { this.lblFront.Visible = false; } } HelpInfo frontOrNextHelp2 = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Next"); if (frontOrNextHelp2 != null && frontOrNextHelp2.HelpId > 0) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "HelpDetails.aspx?helpId=" + frontOrNextHelp2.HelpId; this.lblNextTitle.Text = frontOrNextHelp2.Title; return; } } else { if (this.lblNext != null) { this.lblNext.Visible = false; } } } } }