상속: WebControl
예제 #1
0
 protected override void AttachChildControls()
 {
     this.hlkDetails   = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkDetails");
     this.lblPaystatus = (System.Web.UI.WebControls.Label) this.FindControl("lblPayStatus");
     if (!this.Page.IsPostBack)
     {
         if (string.IsNullOrEmpty(this.Page.Request.QueryString["orderId"]))
         {
             this.lblPaystatus.Text  = "无效访问";
             this.hlkDetails.Visible = false;
         }
         else
         {
             OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.Page.Request.QueryString["orderId"]);
             if (orderInfo == null || orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid)
             {
                 this.lblPaystatus.Text  = "订单不存在或订单状态不是已付款";
                 this.hlkDetails.Visible = false;
             }
             else
             {
                 this.hlkDetails.NavigateUrl = Globals.ApplicationPath + "/user/UserOrders.aspx?orderStatus=" + 2;
             }
         }
     }
 }
예제 #2
0
        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();
                    }
                }
            }
        }
예제 #3
0
 private void grdPurchaseOrders_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
 {
     if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow)
     {
         System.Web.UI.WebControls.HyperLink           hyperLink          = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnSendGoods");
         System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("lkBtnCancelPurchaseOrder");
         System.Web.UI.WebControls.HyperLink           hyperLink2         = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnPay");
         OrderStatus       orderStatus     = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "PurchaseStatus");
         string            purchaseOrderId = (string)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "PurchaseOrderId");
         PurchaseOrderInfo purchaseOrder   = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (!purchaseOrder.IsManualPurchaseOrder && orderStatus == OrderStatus.SellerAlreadySent)
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(purchaseOrder.OrderId);
             if (orderInfo != null && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid)
             {
                 hyperLink.Visible = true;
             }
         }
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             htmlGenericControl.Visible    = true;
             htmlGenericControl.InnerHtml += "<br />";
             hyperLink2.Visible            = true;
         }
     }
 }
예제 #4
0
 protected void grdOrders_RowDataBound(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");
         System.Web.UI.WebControls.HyperLink hyperLink  = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnEditPrice");
         System.Web.UI.WebControls.HyperLink hyperLink2 = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnSendGoods");
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             hyperLink.Visible = true;
             hyperLink.Text   += "<br />";
         }
         if (orderStatus == OrderStatus.BuyerAlreadyPaid)
         {
             int num = (int)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "GroupBuyId");
             if (num > 0)
             {
                 GroupBuyStatus groupBuyStatus = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "GroupBuyStatus");
                 if (groupBuyStatus == GroupBuyStatus.Success)
                 {
                     hyperLink2.Visible = true;
                     hyperLink2.Text   += "<br />";
                     return;
                 }
             }
             else
             {
                 hyperLink2.Visible = true;
                 hyperLink2.Text   += "<br />";
             }
         }
     }
 }
예제 #5
0
        public void SEEKLabel_Ld(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.HyperLink myLabel = (System.Web.UI.WebControls.HyperLink)sender;

            if (userRole == -1)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(-1);");
            }
            else if (userRole == 0)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(0);");
            }
            else if (userRole == 1)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(0);");
            }
            else if (userRole == 2)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(2);");
            }
            else if (userRole == 3)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(3);");
            }
            else if (userRole == 4)
            {
                myLabel.Attributes.Add("OnMouseOver", "javascript:displaySEEK(4);");
            }
            myLabel.Attributes.Add("OnMouseOut", "javascript:undisplaySEEK();");
        }
예제 #6
0
        //============================================================
        // Methods
        //============================================================

        ///
        /// <summary>
        /// Notifies server controls that use composition-based implementation to create any child controls they
        /// contain in preparation for posting back or rendering.
        /// </summary>
        /// <remarks>
        /// When you develop a composite or templated server control, you must override this method.
        /// </remarks>
        ///
        protected override void CreateChildControls()
        {
            _titleStyle = new EnhancedStyle();
            _bodyStyle  = new EnhancedStyle();

            _titleLinkButton = new LinkButton();
            _titleHyperLink  = new System.Web.UI.WebControls.HyperLink();

            // Need to explicitly set the IDs for them to be output in HTML.
            _titleLinkButton.ID = _titleLinkButton.ID;
            _titleHyperLink.ID  = _titleHyperLink.ID;

            _titleRow = new TableRow();
            Controls.Add(_titleRow);

            _titleCell = new TableCell();
            _titleRow.Controls.Add(_titleCell);

            _bodyRow = new TableRow();
            Controls.Add(_bodyRow);

            _bodyCell = new TableCell();
            _bodyRow.Controls.Add(_bodyCell);
            _bodyCell.ID = _bodyCell.ID;
            _bodyCell.Attributes.Add("id", _bodyCell.ClientID);
            _bodyCell.Width = new Unit(100, UnitType.Percentage);

            _hiddenState      = new HtmlInputHidden();
            _hiddenState.ID   = _hiddenState.ID;
            _hiddenState.Name = _hiddenState.ID;

            return;
        }
		public override Control AddTo(Control container, PluginContext context)
		{
			var requiredPermission = context.Selected.State == ContentState.Published ? Permission.Publish : Permission.Write;
			if (!context.Engine.SecurityManager.IsAuthorized(context.HttpContext.User, context.Selected, requiredPermission))
				return null;

			if(!ActiveFor(container, context.State)) return null;
			
			if (!context.Selected.VersionOf.HasValue) 
				return base.AddTo(container, context);

			HyperLink hl = new HyperLink();
			hl.Text = GetInnerHtml(context, "{IconsUrl}/cross_orange.png", ToolTip, Title);
			hl.NavigateUrl = Url.Parse("{ManagementUrl}/Content/DiscardPreview.aspx").ResolveTokens()
				.AppendQuery("selectedUrl", context.Selected.Url)
				.AppendQuery(PathData.ItemQueryKey, context.Selected.VersionOf.ID)
				.AppendQuery(PathData.VersionIndexQueryKey, context.Selected.VersionIndex);
			hl.CssClass = "cancel";
			hl.Attributes["onclick"] = "return confirm('Are you certain?');";

			hl.ToolTip = Utility.GetResourceString(GlobalResourceClassName, Name + ".ToolTip") ?? context.Format("Delete this version", false);

			container.Controls.Add(hl);

			return hl;
		}
예제 #8
0
 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);
     }
 }
예제 #9
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                if (OnSelectUserRoleID == 1)
                {
                    System.Web.UI.WebControls.Panel pnlForAdminUser = ((System.Web.UI.WebControls.Panel)Master.FindControl("PanelAdminUser"));
                    System.Web.UI.WebControls.Panel pnlForAlluser   = ((System.Web.UI.WebControls.Panel)Master.FindControl("PanelForAlluser"));

                    pnlForAdminUser.Visible = true;
                    pnlForAlluser.Visible   = false;

                    //System.Web.UI.WebControls.LinkButton  lnklogin = ((System.Web.UI.WebControls.LinkButton)Master.FindControl("loginLink"));
                    //lnklogin.Text = "Logout";

                    System.Web.UI.WebControls.HyperLink NyHyperLinkLogin = ((System.Web.UI.WebControls.HyperLink)Master.FindControl("HyperLinkLogin"));
                    NyHyperLinkLogin.Text = "Log off";

                    System.Web.UI.WebControls.Label Lbl_loginStatus = ((System.Web.UI.WebControls.Label)Master.FindControl("Label_loginStatus"));
                    Lbl_loginStatus.Visible = true;
                    Lbl_loginStatus.Text    = Session["UserName"].ToString();

                    System.Web.UI.WebControls.Label Lbl_RoleName = ((System.Web.UI.WebControls.Label)Master.FindControl("Label_RoleName"));
                    Lbl_RoleName.Visible = true;
                    Lbl_RoleName.Text    = Session["RoleName"].ToString();


                    //PanelAdminUser.Visible = true;
                }
            }
        }
        public override Control AddTo(Control container, PluginContext context)
        {
            var selector = context.Engine.Resolve<LanguageGatewaySelector>();
            if (!selector.Enabled || selector.LanguagesPerSite /*avoid showing options that might not be relevant */)
                return null;

            ILanguageGateway gateway = selector.GetAllLanguages();

            HtmlGenericControl div = new HtmlGenericControl("div");
            div.Attributes["class"] = "languages";
            container.Controls.Add(div);

            base.AddTo(div, context);

            foreach (ILanguage language in gateway.GetAvailableLanguages())
            {
                Url url = Engine.ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Content/Globalization/Translate.aspx");
                url = url.AppendQuery("language", language.LanguageCode);
                url = url.AppendQuery(SelectionUtility.SelectedQueryKey + "={selected}");

                HyperLink h = new HyperLink();
                h.ID = language.LanguageCode.Replace('-', '_').Replace(' ', '_');
                h.Target = Targets.Preview;
                h.NavigateUrl = context.Rebase(context.Format(url, true));
                h.CssClass = "templatedurl language";
                h.ToolTip = language.LanguageTitle;
                h.Text = string.Format("<img src='{0}' alt=''/>", Url.ToAbsolute(language.FlagUrl));
                h.Attributes["data-url-template"] = context.Rebase(url);
                div.Controls.Add(h);
            }

            return div;
        }
예제 #11
0
        private void SetupLinks()
        {
            Panel pnlContent = unavContent;
            HyperLink linkToAdd;

            Image navDiv;

            Int32 controlsToAdd = 0;
            if (Page.Request.Url.ToString().ToLower().Contains("index")) { controlsToAdd++; } //We don't want to show the Home link if we are on home
            for (Int32 i = controlsToAdd; i < pageNames.Length; i++)
            {
                linkToAdd = new HyperLink();
                linkToAdd.NavigateUrl = pageLinks[i];
                linkToAdd.Text = linkText[i];
                if (Page.Request.Url.ToString().ToLower().Contains(pageNames[i]))
                {
                    linkToAdd.Attributes.Add("class", "unavon");
                }
                pnlContent.Controls.Add(linkToAdd);

                if (i < (pageNames.Length - 1))
                {
                    navDiv = new Image();
                    navDiv.ImageUrl = "../Images/nav_div.gif";
                    navDiv.AlternateText = string.Empty;
                    navDiv.Width = 1;
                    navDiv.Height = 17;
                    navDiv.BorderWidth = 0;
                    pnlContent.Controls.Add(navDiv);
                }
            }
        }
 public virtual void Init (PortalModuleBase module, GridView gridView, HyperLink addButton, int pageSize)
 {
     Grid = gridView;
     Grid.PageSize = pageSize;
     AddButton = addButton;
     AddButton.NavigateUrl = Utils.EditUrl (module, EditKey);
 }
예제 #13
0
        private void AddMethod(Control parent, IRpcMethodDescriptor method)
        {
            JsonRpcObsoleteAttribute obsoleteAttribute = JsonRpcObsoleteAttribute.Get(method.AttributeProvider);

            Control methodSpan = AddSpan(parent, 
                obsoleteAttribute == null ? "method" : "method obsolete-method", null);
    
            HyperLink link = new HyperLink();
            link.CssClass = "method-name";
            link.Text = Server.HtmlEncode(method.Name);
            methodSpan.Controls.Add(link);

            AddSignature(methodSpan, method);
            string summary = JsonRpcHelpAttribute.GetText(method.AttributeProvider);

            if (summary.Length > 0)
            {
                AddSpan(parent, "method-summary-sep", " - ");
                AddSpan(parent, "method-summary", summary);
            }

            if (obsoleteAttribute != null)
            {
                AddSpan(parent, "obsolete-message", " This method has been obsoleted. " + obsoleteAttribute.Message);
            }
        }
예제 #14
0
		protected virtual HyperLink AddAnchor(Control container, PluginContext context)
		{
			string tooltip = Utility.GetResourceString(GlobalResourceClassName, Name + ".ToolTip") ?? ToolTip;
			string title = Utility.GetResourceString(GlobalResourceClassName, Name + ".Title") ?? Title;
			string alternative = Utility.GetResourceString(GlobalResourceClassName, Name + ".AlternativeText") ?? AlternativeText;

			HyperLink a = new HyperLink();
			a.ID = "h" + Name;
			a.NavigateUrl = context.Rebase(context.Format(UrlFormat, true));
			a.SkinID = "ToolBarLink_" + Name;

			a.Target = Target;
			a.Attributes["class"] = Name + " " + RequiredPermission.ToString() + (string.IsNullOrEmpty(IconUrl) ? "" : " iconed");				
			if (UrlFormat.Contains("{"))
			{
				a.Attributes["class"] += " templatedurl";
				a.Attributes["data-url-template"] = context.Rebase(UrlFormat);
			}
			a.ToolTip = tooltip;
			a.Text = title;
			ApplyStyles(context, a);

			container.Controls.Add(a);
			return a;
		}
예제 #15
0
        public void dlAssignments_ItemDataBound(Object sender, DataListItemEventArgs e)
        {
            // this event fires as individual items are bound to the datalist
            // we dynamically change the 'Get Starter' icon and hyperlink depending upon starter availability for the assignment

            // ensure item is type item
            ListItemType itemType = e.Item.ItemType;

            if (!(itemType.Equals(ListItemType.AlternatingItem) || itemType.Equals(ListItemType.Item)))
            {
                return;
            }

            // grab handle to data row
            DataRowView dr = (DataRowView)e.Item.DataItem;

            // evaluate the dataitem value and show applicable image
            if (Convert.ToBoolean(dr["StarterProjectFlag"]) == true)
            {
                System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hlStarterAvailable");
                hl.Visible      = true;
                hl.NavigateUrl += "?Action=downloadstarter&AssignmentID=" + dr["AssignmentID"] + "&CourseID=" + courseId.ToString();
            }
            else
            {
                e.Item.FindControl("imgStarterNotAvailable").Visible = true;
            }
        }
예제 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SRDel.SRSql srSql = new SRDel.SRSql();

            srSql.conn.Open();

            srSql.cmd.CommandText = "select * from tpTB where tpEndTime > @nowDate and tpStartTime < @nowDate order by tpStartTime desc";

            string nowDate = DateTime.Now.ToString();
            srSql.cmd.Parameters.AddWithValue("@nowDate", nowDate);
            srSql.cmd.Parameters.AddWithValue("@nowDate", nowDate);

            srSql.da.Fill(srSql.ds, "tb_tp");
            foreach (DataRow dr in srSql.ds.Tables["tb_tp"].Rows)
            {
                HyperLink hl = new HyperLink();
                hl.Text = dr["tpName"].ToString();
                hl.NavigateUrl =  "/slip/tpNotice.aspx?tpid="+dr["tpID"];
                hl.CssClass = "logo_tips";
                Panel1.Controls.Add(hl);
            }
               // this.HyperLinkTp.Text = srSql.ds.Tables["tb_tp"].Rows[0]["tpName"].ToString();
            //this.HyperLinkTp.NavigateUrl = srSql.ds.Tables["tb_tp"].Rows[0]["tpNotice"].ToString();

            srSql.conn.Close();
        }
예제 #17
0
        /// <summary>
        /// Overrides <see cref="Control.CreateChildControls"/>
        /// </summary>
        protected override void CreateChildControls()
        {
            layout  = new Table();
            textBox = new TextBox();
            up      = new HyperLink();
            down    = new HyperLink();

            this.textBox.TextChanged        += new EventHandler(bubbleTextChanged);
            this.textBox.Style["text-align"] = "right";
            this.textBox.ID = "textBox";
            this.textBox.Style["margin"] = "0px";

            this.up.Text   = Resources.Standard_Up;
            this.down.Text = Resources.Standard_Down;


            layout.CellPadding = 0;
            layout.CellSpacing = 0;
            layout.BorderWidth = 0;
            layout.Rows.Add(new TableRow());
            layout.Rows.Add(new TableRow());
            layout.Rows[0].Cells.Add(new TableCell());
            layout.Rows[0].Cells[0].RowSpan = 2;
            layout.Rows[0].Cells[0].Attributes["valign"] = "middle";
            layout.Rows[0].Cells.Add(new TableCell());
            layout.Rows[1].Cells.Add(new TableCell());

            layout.Rows[0].Cells[0].Controls.Add(textBox);
            layout.Rows[0].Cells[1].Controls.Add(up);
            layout.Rows[1].Cells[layout.Rows[1].Cells.Count - 1].Controls.Add(down);

            this.Controls.Add(layout);
        }
        protected void initPage()
        {
            RegistedUser MySelf = new RegistedUser();
            MySelf = (RegistedUser)Session["User"];
            MySelf.Userservice = new UserServiceClasses.RegisterUserService();
            List<Message> PublishMessageList =  MySelf.Userservice.GetUserUreadPublicMessages(MySelf.UserName);
            Panel single = new Panel();
            foreach (Message singleMessage in PublishMessageList)
            {

                HyperLink MessageFrom = new HyperLink();
                MessageFrom.Text = singleMessage.userFrom.NickName;
                MessageFrom.NavigateUrl = "~/WebPage/UserOwnZonePage/UserOwnZonePage/UserOwnZonePage.aspx?VisitedUserID=" + singleMessage.userFrom.UserName; ;
                single.Controls.Add(MessageFrom);
                Label MessageCon = new Label();
                MessageCon.Text = singleMessage.content;
                single.Controls.Add(MessageCon);

                ImageButton deleteButton = new ImageButton();
                deleteButton.ImageUrl = "~/newpng/Trash.png";
                deleteButton.Height = new Unit(48);
                deleteButton.ID = singleMessage.ID.ToString();
                deleteButton.OnClientClick += "DeleteItem";
                deleteButton.Click += new ImageClickEventHandler(deleteButton_Click);
                single.Controls.Add(deleteButton);

            }
            this.ALLPublicMessage.Controls.Add(single);
        }
 void ITemplate.InstantiateIn(Control container)
 {
     HyperLink itemlbl = new HyperLink();
     itemlbl.Width = 110;
     itemlbl.DataBinding += new EventHandler(itemlbl_DataBinding);
     container.Controls.Add(itemlbl);
 }
예제 #20
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            String       texto_tex_box = TextBox1.Text;
            var          json1         = new WebClient().DownloadString("https://api.mercadolibre.com/sites/MLM/search?q=" + texto_tex_box.Replace(" ", "+"));
            mercadolibre r_json1       = JsonConvert.DeserializeObject <mercadolibre>(json1);


            for (int i = 0; i < 10; i++)
            {
                System.Web.UI.WebControls.Label     lbl = new System.Web.UI.WebControls.Label();
                System.Web.UI.WebControls.HyperLink hyp = new System.Web.UI.WebControls.HyperLink();
                hyp.NavigateUrl = r_json1.results[i].permalink;
                hyp.ImageUrl    = r_json1.results[i].thumbnail;

                /*
                 * string url = url_api + r_json1.results[i].address.city_name.Replace(" ", "+") + url_key + apikey;
                 * var json = new WebClient().DownloadString(url);
                 * Resultado_Geo r_json = JsonConvert.DeserializeObject<Resultado_Geo>(json);
                 */
                string tabla = "<table style=\"width:100%; border-collapse:collapse; border: 1px solid black; \" >";
                tabla   += "<tr>";
                tabla   += "<th padding: 15px; bgcolor=yellow>Produto</th>";
                tabla   += "<td padding: 15px; bgcolor=gray>" + r_json1.results[i].title + "</td>";
                tabla   += "<tr/>";
                tabla   += "<tr>";
                tabla   += "<th padding: 15px; bgcolor=yellow>Precio</th>";
                tabla   += "<td padding: 15px; bgcolor=gray>" + r_json1.results[i].price + "</td>";
                tabla   += "<tr/>";
                lbl.Text = tabla;
                this.Panel1.Controls.Add(lbl);
                this.Panel1.Controls.Add(hyp);
            }
        }
        private void SearchTask2Json(string task)
        {
            DataTable dtSearchTask = Library.Data.JSONToDataTable(task);
               int searchTotal = dtSearchTask.Rows.Count;

            for (int i = 0; i < searchTotal; i++)
               {
               ImageButton imgBtn = new ImageButton();
               imgBtn.ID = i.ToString();
               imgBtn.ImageUrl = "/img/poster.png";
               imgBtn.Width = 50;
               imgBtn.Height = 50;

               HyperLink hl = new HyperLink();
               hl.ID = i.ToString();
               hl.Text = dtSearchTask.Rows[i]["TaskTitle"].ToString();

               Label lbl = new Label();
               lbl.ID = i.ToString();
               lbl.Text = dtSearchTask.Rows[i]["TaskDetail"].ToString()+"<br /> <hr />";

               pnlSearchTask.Controls.Add(imgBtn);
               pnlSearchTask.Controls.Add(hl);
               pnlSearchTask.Controls.Add(lbl);

               }
        }
예제 #22
0
        protected void DateArrowLink_Load(Object sender, EventArgs e)
        {
            DateArrowLink = (HyperLink)sender;
            int paramIndex;

            if (sortingParamStr == null || sortingParamStr == "")
            {
                if ((categoryParamStr == null || categoryParamStr == ""))
                {
                    DateArrowLink.NavigateUrl = Request.Url.PathAndQuery + "?SortedBy=Date";
                }
                else
                {
                    DateArrowLink.NavigateUrl = Request.Url.PathAndQuery + "&SortedBy=Date";
                }
            }
            else if (sortingParamStr.IndexOf("Date") == -1)
            {
                paramIndex = Request.Url.PathAndQuery.IndexOf("SortedBy");
                DateArrowLink.NavigateUrl = Request.Url.PathAndQuery.Substring(0, paramIndex)
                                            + "SortedBy=Date";
            }
            else
            {
                DateArrowLink.ImageUrl = "DotWiki/images/uparrow.jpg";

                paramIndex = Request.Url.PathAndQuery.IndexOf("SortedBy");
                DateArrowLink.NavigateUrl = Request.Url.PathAndQuery.Substring(0, paramIndex)
                                            + "SortedBy=DatRev";
            }
        }
예제 #23
0
        protected void ModArrowLink_Load(Object sender, EventArgs e)
        {
            ModArrowLink = (HyperLink)sender;
            int sortIndex = Request.Url.PathAndQuery.IndexOf("SortedBy");

            if (sortIndex != -1)
            {
//				if( Request.Url.PathAndQuery.IndexOf( "Reverse" ) != -1 ) {

//				}

                ModArrowLink.NavigateUrl = Request.Url.PathAndQuery.Substring(0, sortIndex - 1);
            }
            else
            {
                ModArrowLink.ImageUrl = "DotWiki/images/uparrow.jpg";

                ModArrowLink.NavigateUrl = Request.Url.PathAndQuery;

                if ((categoryParamStr == null || categoryParamStr == ""))
                {
                    ModArrowLink.NavigateUrl += "?SortedBy=Reverse";
                }
                else
                {
                    ModArrowLink.NavigateUrl += "&SortedBy=Reverse";
                }
            }
        }
예제 #24
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            var contentPath    = string.Empty;
            var currentUrlList = GetSiteUrlList(ref contentPath);
            var protocol       = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Scheme);

            #region template

            if (IsTemplated)
            {
                Try2AddUrlLinks(contentPath, currentUrlList, protocol);
                base.RenderContents(writer);
                return;
            }

            #endregion

            foreach (var siteUrl in currentUrlList)
            {
                var url  = string.Concat(protocol, siteUrl, contentPath);
                var link = new System.Web.UI.WebControls.HyperLink();
                link.NavigateUrl = url;
                link.Text        = url;
                link.Target      = "new";
                link.CssClass    = this.CssClass;
                link.RenderControl(writer);
                writer.WriteBreak();
            }
        }
예제 #25
0
 private void grdHeaderMenu_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
 {
     if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow)
     {
         int num = (int)this.grdMyHeaderMenu.DataKeys[e.Row.RowIndex].Value;
         System.Web.UI.WebControls.HyperLink hyperLink = e.Row.FindControl("lkbEdit") as System.Web.UI.WebControls.HyperLink;
         hyperLink.NavigateUrl = string.Format("EditMyHeaderMenu.aspx?Id={0}&ThemName={1}", num, this.themName);
         System.Web.UI.WebControls.Literal literal = e.Row.FindControl("litCategory") as System.Web.UI.WebControls.Literal;
         string text = literal.Text;
         if (text == "1")
         {
             text = "系统页面";
         }
         else
         {
             if (text == "2")
             {
                 text = "商品搜索链接";
             }
             else
             {
                 text = "自定义链接";
             }
         }
         literal.Text = text;
     }
 }
예제 #26
0
        private TableCell CreateCell(string title, string url, bool selected, string imageUrlS, string imageUrlL)
        {
            TableCell cell = new TableCell();
              Image img = new Image();
              if(selected)
              {
            img.ImageUrl = imageUrlL;
            img.Width = Unit.Pixel(40);
            img.Height = Unit.Pixel(20);
            Label lbl = new Label();
            lbl.Text = title;
            cell.Controls.Add(img);
            cell.Controls.Add(lbl);
              }
              else
              {
            img.ImageUrl = imageUrlS;
            img.Width = Unit.Pixel(20);
            img.Height = Unit.Pixel(10);
            HyperLink link = new HyperLink();
            link.Text = title;
            link.NavigateUrl = url;
            cell.Controls.Add(img);
            cell.Controls.Add(link);
              }

              return cell;
        }
예제 #27
0
 /// <summary>
 /// Take a list of faults and append them into the fault table, putting hte parentProfileTitle into the appropriate column
 /// </summary>
 /// <param name="faultList">List of SafetyCheckCombinedResultsFault items</param>
 /// <param name="parentProfileTitle">Name of the profile to which these faults relate</param>
 private void appendFaultListIntoTable(List <Orchestrator.Entities.SafetyCheckCombinedResultsFault> faultList, string parentProfileTitle)
 {
     foreach (SafetyCheckCombinedResultsFault fault in faultList)
     {
         TableRow faultRow = new TableRow();
         if (faultListRowCount % 2 == 1)
         {
             faultRow.CssClass = "odd";
         }
         faultRow.TableSection = TableRowSection.TableBody;
         faultRow.Cells.Add(newCell(parentProfileTitle));
         faultRow.Cells.Add(newCell(fault.Title));
         faultRow.Cells.Add(newCell(fault.StatusTerm));
         faultRow.Cells.Add(newCell(fault.Comment));
         System.Web.UI.WebControls.TableCell photoCell = newCell(NON_BREAKING_SPACE_ENTITYREF);
         if (fault.HasPhotosYN)
         {
             photoCell = new System.Web.UI.WebControls.TableCell();
             System.Web.UI.WebControls.HyperLink viewLink = new System.Web.UI.WebControls.HyperLink();
             viewLink.NavigateUrl = "javascript:openNewPopupWindow('Fault Photos','/Resource/SafetyChecks/ViewSafetyCheckFaultPhotos.aspx?scfId=" + fault.SafetyCheckFaultId + "');";
             viewLink.Text        = PHOTOS_VIEW_LINK_TEXT;
             photoCell.Controls.Add(viewLink);
         }
         faultRow.Cells.Add(photoCell);
         safetyCheckFaultListTable.Rows.Add(faultRow);
         faultListRowCount++;
     }
 }
        protected void grdCurrentStud_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[0].Visible = false;

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //id="btnEdit" data-toggle="modal" data-target="#EditModal" runat="server" cssclass="btn  icon-edit" xmlns:asp="#unknown"

                string nStudentID = e.Row.Cells[0].Text;
                HyperLink lb = new HyperLink();
                lb.NavigateUrl = "#EditModal";
                lb.ID = "lbStudents";
                lb.Text = "View Details";

                //lb.Attributes.Add("ID", "lnkStudent");
                lb.Attributes.Add("data-id", nStudentID);
                lb.Attributes.Add("title", "Select");
                lb.Attributes.Add("class", "open-myModal btn-mini btn-primary");
                lb.Attributes.Add("data-target", "#EditModal");
                lb.Attributes.Add("data-toggle", "modal");
                lb.Attributes.Add("onclick", "CallGetData('" + nStudentID + "');");
                lb.Attributes.Add("runat", "server");

                e.Row.Cells[7].Controls.Add(lb);
            }
        }
예제 #29
0
        protected override void OnLoad(LoadModuleEventArgs e)
        {
            #if DEBUG
            Context.Trace.Write("StaticModule", "QueryString Edit Present: " + (Context.Request.QueryString["edit"] != null));
            #endif
            // checks to see if user is an administrator and is in edit mode
            if (Context.Request.QueryString["edit"] != null && IsInTask("Editor"))
                e.CenterTop.Add(new Edit());
            else
            {
                // add edit button for users with access to edit
                if (IsInTask("Editor"))
                {
                    HyperLink editLink = new HyperLink();
                    editLink.Text = "Edit This Page's Content";
                    editLink.NavigateUrl = Common.Path.GetPortalUrl("Edit.aspx").ToString();

                    // add link to page
                    e.CenterTop.AddAt(0, editLink);
                }

                // add body of page
                e.CenterTop.Add(new LiteralControl(this.Properties["Content"]));
            }
        }
예제 #30
0
        private void fillCoursesList()
        {
            CoursesTable.Rows.Clear();
            foreach (TblCourses course in TeacherHelper.CurrentUserCourses())
            {
                TableRow courseRow = new TableRow();
                TableCell courseCell = new TableCell();
                HyperLink courseHyperLink = new HyperLink();
                courseHyperLink.Text = course.Name;
                courseHyperLink.NavigateUrl = ServerModel.Forms.BuildRedirectUrl<TeachersListController>(
                    new TeachersListController { CourseId = course.ID, CurriculumId = -1, BackUrl = RawUrl });
                courseCell.Controls.Add(courseHyperLink);
                courseRow.Cells.Add(courseCell);
                CoursesTable.Rows.Add(courseRow);
            }

            if (CoursesTable.Rows.Count == 0)
            {
                TableRow courseRow = new TableRow();
                TableCell courseCell = new TableCell();
                HyperLink courseLink = new HyperLink();
                courseLink.Text = noCourses;
                courseLink.NavigateUrl = ServerModel.Forms.BuildRedirectUrl<CourseEditController>
                    (new CourseEditController { BackUrl = RawUrl });
                courseCell.Controls.Add(courseLink);
                courseRow.Cells.Add(courseCell);
                CoursesTable.Rows.Add(courseRow);
            }
        }
예제 #31
0
 protected void rptProduct_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item)
     {
         DataRowView arg_37_0 = (DataRowView)e.Item.DataItem;
         System.Web.UI.WebControls.Label label         = (System.Web.UI.WebControls.Label)e.Item.Controls[0].FindControl("lbBundlingID");
         FormatedMoneyLabel formatedMoneyLabel         = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lbltotalPrice");
         FormatedMoneyLabel formatedMoneyLabel2        = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lblbundlingPrice");
         FormatedMoneyLabel formatedMoneyLabel3        = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lblsaving");
         System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[0].FindControl("hlBuy");
         System.Web.UI.WebControls.Repeater  repeater  = (System.Web.UI.WebControls.Repeater)e.Item.Controls[0].FindControl("rpbundlingitem");
         System.Collections.Generic.List <BundlingItemInfo> bundlingItemsByID = ProductBrowser.GetBundlingItemsByID(System.Convert.ToInt32(label.Text));
         decimal num = 0m;
         foreach (BundlingItemInfo current in bundlingItemsByID)
         {
             num += current.ProductNum * current.ProductPrice;
         }
         formatedMoneyLabel.Money  = num;
         formatedMoneyLabel3.Money = System.Convert.ToDecimal(formatedMoneyLabel.Money) - System.Convert.ToDecimal(formatedMoneyLabel2.Money);
         if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && !Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsOpenSiteSale)
         {
             hyperLink.Visible = false;
         }
         repeater.DataSource = bundlingItemsByID;
         repeater.DataBind();
     }
 }
예제 #32
0
        private void fillCurriculumsList()
        {
            CurriculumsTable.Rows.Clear();
            foreach (TblCurriculums curriculum in TeacherHelper.CurrentUserCurriculums())
            {
                TableRow curriculumRow = new TableRow();
                TableCell curriculumCell = new TableCell();
                HyperLink curriculumHyperLink = new HyperLink();
                curriculumHyperLink.Text = curriculum.Name;
                curriculumHyperLink.NavigateUrl = ServerModel.Forms.BuildRedirectUrl<TeachersListController>(
                    new TeachersListController { CourseId = -1, CurriculumId = curriculum.ID, BackUrl = RawUrl });
                curriculumCell.Controls.Add(curriculumHyperLink);
                curriculumRow.Cells.Add(curriculumCell);
                CurriculumsTable.Rows.Add(curriculumRow);
            }

            if (CurriculumsTable.Rows.Count == 0)
            {
                TableRow curriculumRow = new TableRow();
                TableCell curriculumCell = new TableCell();
                HyperLink curriculumLink = new HyperLink();
                curriculumLink.Text = noCurriculums;
                curriculumLink.NavigateUrl = ServerModel.Forms.BuildRedirectUrl<CurriculumEditController>
                    (new CurriculumEditController { BackUrl = RawUrl });
                curriculumCell.Controls.Add(curriculumLink);
                curriculumRow.Cells.Add(curriculumCell);
                CurriculumsTable.Rows.Add(curriculumRow);
            }
        }
예제 #33
0
        public void cargar_noti_oferta()
        {
            Oferta[] ofertas = new Oferta().cargar_notificacion(Convert.ToString(Session["r_muro"]));
            if(ofertas !=null){
                for (int i = 0; i < ofertas.Length;i++ )
                {
                    TableRow fila_nombre_foro = new TableRow();
                    TableCell celda1 = new TableCell();
                    HyperLink link = new HyperLink();
                    link.Text = ofertas[i].Usuario;
                    link.NavigateUrl = Global.ruta + "/perfil.aspx?cod=" + ofertas[i].Cod_usuario;
                    celda1.Controls.AddAt(0, link);
                    fila_nombre_foro.Cells.Add(celda1);
                    celda1.Attributes.Add("style", "BORDER-TOP:solid 2px blue");

                    TableRow espacio = new TableRow();
                    TableCell celda7 = new TableCell();
                    celda7.Text = "<br />";
                    espacio.Cells.Add(celda7);

                    TableRow ofertat = new TableRow();
                    TableRow oficio_oferta = new TableRow();
                    TableRow fecha_oferta = new TableRow();
                    TableRow fecha_limite = new TableRow();
                    TableRow ir_oferta = new TableRow();

                    TableCell celda2 = new TableCell();
                    celda2.Text = "Oferta : " + ofertas[i].Tipo;

                    TableCell celda3 = new TableCell();
                    celda3.Text = "Oficio : " + ofertas[i].Oficio;

                    TableCell celda4 = new TableCell();
                    celda4.Text = "Oferta Limte hasta el : " + Convert.ToDateTime(ofertas[i].Fecha_limite).ToString("dd-MM-yyyy");

                    TableCell celda6 = new TableCell();
                    celda6.Text = "Oferta creada el : " + Convert.ToDateTime(ofertas[i].Fecha).ToString("dd-MM-yyyy");

                    TableCell celda5 = new TableCell();
                    HyperLink link_ir = new HyperLink();
                    link_ir.Text = "Ir a la oferta";
                    celda5.Controls.AddAt(0, link_ir);
                    link_ir.NavigateUrl = Global.ruta + "/mostrar_oferta.aspx?id=" + ofertas[i].Id;

                    ofertat.Cells.Add(celda2);
                    oficio_oferta.Cells.Add(celda3);
                    fecha_oferta.Cells.Add(celda4);
                    fecha_limite.Cells.Add(celda6);
                    ir_oferta.Cells.Add(celda5);

                    Table1.Rows.Add(espacio);
                    Table1.Rows.Add(fila_nombre_foro);
                    Table1.Rows.Add(ofertat);
                    Table1.Rows.Add(oficio_oferta);
                    Table1.Rows.Add(fecha_limite);
                    Table1.Rows.Add(fecha_oferta);
                    Table1.Rows.Add(ir_oferta);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {	
			if(Request.QueryString["filename"] == null)
        	{
				DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/downloads"));
	        	int i = 0;
	        	
	        	foreach(FileInfo fi in di.GetFiles())
	        	{
	            	HyperLink HL = new HyperLink();
	            	HL.ID = "HyperLink" + i++;
	            	HL.Text = fi.Name;
	            	HL.NavigateUrl = Request.FilePath + "?filename="+fi.Name;
	            	ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("BodyContentPlaceholder");
	            	cph.Controls.Add(HL);
	            	cph.Controls.Add(new LiteralControl("<br/>"));
	        	}
        	}
        	else
        	{
        		string filename = Request.QueryString["filename"];
        		if(filename != null)
        		{
        			ResponseFile(Request, Response, filename, MapPath("~/Downloads/" + filename), 100);
        		}
        	}
        }
예제 #35
0
 public static void SetWhenIsNotNull(this System.Web.UI.Control control, string value)
 {
     if (control != null)
     {
         if (control is System.Web.UI.ITextControl)
         {
             System.Web.UI.ITextControl textControl = (System.Web.UI.ITextControl)control;
             textControl.Text = value;
         }
         else if (control is System.Web.UI.HtmlControls.HtmlInputControl)
         {
             System.Web.UI.HtmlControls.HtmlInputControl htmlInputControl = (System.Web.UI.HtmlControls.HtmlInputControl)control;
             htmlInputControl.Value = value;
         }
         else
         {
             if (!(control is System.Web.UI.WebControls.HyperLink))
             {
                 throw new System.ApplicationException("未实现" + control.GetType().ToString() + "的SetWhenIsNotNull方法");
             }
             System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)control;
             hyperLink.NavigateUrl = value;
         }
     }
 }
예제 #36
0
        public HyperLink CreateControlLink(DataControlFieldCell cell
            , String IdPropertyName
            , String controllerObjectName
            , String onClickClientEvent
            , String imageUrl
            , String altText
            , Int32 columnIndex
            , String businessKeyProperty
            )
        {
            GridViewRow row = (GridViewRow)cell.BindingContainer;
            if (row == null)
                return null;

            String value = GetObjectValue(row.DataItem, IdPropertyName);
            String businessKeyPropertyValue = GetObjectValue(row.DataItem, businessKeyProperty);

            if (String.IsNullOrEmpty(cell.Text) || String.Compare(cell.Text, "&nbsp;") == 0 ||
                    String.IsNullOrEmpty(value))
                return null;

            HyperLink link = new HyperLink();

            link.Text = cell.Text;
            link.NavigateUrl = GetNavigationUrl(value, businessKeyPropertyValue, controllerObjectName, onClickClientEvent, columnIndex);

            if (!String.IsNullOrEmpty(imageUrl))
                link.Controls.Add(CreateImage(imageUrl, altText));

            _navigateURL = link.NavigateUrl;
            _text = link.Text;
            _image = imageUrl;

            return link;
        }
예제 #37
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List<string> paths=GetImagePaths();
            List<string> names = GetImageNames();

            Panel panel = (Panel)this.Master.FindControl("ContentPlaceHolder1").FindControl("pnlImages");
            for (int i = 0; i < paths.Count; i++)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl div = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                div.Attributes["class"] = "Frame";

                Image image = new Image();
                image.ImageUrl = paths[i];
                image.Attributes["class"] = "Image";
                image.Attributes["title"] = names[i];

                HyperLink hyperlik = new HyperLink();
                hyperlik.NavigateUrl = paths[i];
                hyperlik.Controls.Add(image);

              //  System.Web.UI.HtmlControls.HtmlGenericControl span = new System.Web.UI.HtmlControls.HtmlGenericControl("span");
               // span.InnerText = names[i];
                div.Controls.Add(hyperlik);
              //  div.Controls.Add(span);
                panel.Controls.Add(div);
            }
        }
예제 #38
0
        private void PopulateCarousel()
        {
            List<BLCategory> categories = BLCategory.RetrieveListFromDB(connectionString);
            foreach (BLCategory category in categories)
            {
                Image image = new Image
                {
                    CssClass = "carousel-image",
                    ImageUrl = $"ImgHandler.ashx?categoryId={category.Id}"
                };
                HyperLink link = new HyperLink
                {
                    NavigateUrl = $"/Result.aspx?categoryId={category.Id}"
                };
                link.Controls.Add(image);

                Label captionLabel = new Label
                {
                    Text = $"<h3 style = 'color: #FFFFFF' > {category.Name} </ h3 >"
                };
                Panel captionPanel = new Panel { CssClass = "carousel-caption" };
                captionPanel.Controls.Add(captionLabel);

                Panel itemPanel = new Panel { CssClass = "item" };
                itemPanel.Controls.Add(link);
                itemPanel.Controls.Add(captionPanel);

                categoryCarousel.Controls.Add(itemPanel);
            }
        }
예제 #39
0
 private void FindControls()
 {
     this.rptProductImages      = (WapTemplatedRepeater)this.FindControl("rptProductImages");
     this.litProdcutName        = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
     this.litShortDescription   = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
     this.litDescription        = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
     this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("soldCount");
     this.litprice              = (System.Web.UI.WebControls.Literal) this.FindControl("price");
     this.litcontent            = (System.Web.UI.WebControls.Literal) this.FindControl("content");
     this.litminCount           = (System.Web.UI.WebControls.Literal) this.FindControl("minCount");
     this.litGroupBuyId         = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("litGroupbuyId");
     this.litLeftSeconds        = (System.Web.UI.WebControls.Literal) this.FindControl("leftSeconds");
     this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
     this.linkDescription       = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription");
     this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
     this.salePrice             = (System.Web.UI.WebControls.Literal) this.FindControl("salePrice");
     this.leftCount             = (System.Web.UI.WebControls.Literal) this.FindControl("leftCount");
     this.minSuccessCount       = (System.Web.UI.WebControls.Literal) this.FindControl("minSuccessCount");
     this.txtProductId          = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("txtProductId");
     this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
     this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
     this.litMaxCount           = (System.Web.UI.WebControls.Literal) this.FindControl("litMaxCount");
     this.startTime             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("startTime");
     this.endTime                = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("endTime");
     this.groupBuySoldCount      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litGroupbuyDescription");
     this.groupBuyMaxCount       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuyMaxCount");
 }
 /// <summary>
 /// Creates a link pointing to a tool visible in the dashboard.
 /// </summary>
 /// <param name="linkText">The text of the link.</param>
 /// <param name="toolValue">The value of the tool <c>QueryString</c> key for this tool.</param>
 /// <returns></returns>
 private HyperLink GetDashboardLink(string linkText, string toolValue)
 {
     HyperLink hl = new HyperLink();
     hl.NavigateUrl = this.BuildLinkUrl("&amp;mid=" + this.ModuleId + "&amp;ctl=admincontainer&amp;adminType=admintools&amp;tool=" + toolValue);
     hl.Text = linkText;
     return hl;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            session = (SessionObject)Session["SessionObject"];
            userid = session.LoggedInUser.UserId;
  
               
                if (Request.QueryString["StandardID"] != null && Request.QueryString["StudentID"] != null && Request.QueryString["WorksheetID"] != null)
                {
                    StandardId = Convert.ToInt32(Request.QueryString["StandardID"]);
                    StudentId = Convert.ToInt32(Request.QueryString["StudentID"]);
                    WorksheetId = Convert.ToInt32(Request.QueryString["WorksheetID"]);
                }
                if (!IsPostBack)
                {
                    radGridHistory.Visible = true;
                    radGridComments.Visible = true;
                    RadScriptManager scriptManager = (RadScriptManager)ScriptManager.GetCurrent(this.Page);

                    DataSet ds = CompetencyWorkSheet.GetCompetencyWorksheetSingleStudentStandard(StandardId, StudentId, WorksheetId);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        lblStudentName.Text = ds.Tables[0].Rows[0]["StudentName"].ToString();
                        lblStandardDesc.Text = ds.Tables[0].Rows[0]["StandardDesc"].ToString();
                        StandardName = ds.Tables[0].Rows[0]["StandardName"].ToString();
                        lnkStandard.Text = StandardName;
                        HyperLink link = new HyperLink();
                        ID_Encrypted = Encryption.EncryptInt(StandardId);
                        link.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + ID_Encrypted;
                        lnkStandard.Attributes.Add("onclick", "window.open('" + link.ResolveClientUrl(link.NavigateUrl) + "');");
                        lnkStandard.Attributes.Add("style", "cursor:pointer; text-decoration: underline; color: #034AF3");
                        BindPerformanceGrid();
                        BindCommentGrid();
                    }
                }
        }
예제 #42
0
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            System.Web.UI.WebControls.Label lblZtmc = Grid1.Rows[e.RowIndex].FindControl("lblZtmc") as System.Web.UI.WebControls.Label;
            string zt = lblZtmc.Text;

            switch (zt)
            {
            case "未提交":
                lblZtmc.ForeColor = Color.Black;
                break;

            case "已提交":
                lblZtmc.ForeColor = Color.Blue;
                break;

            case "已删除":
            case "审核拒绝":
            case "退回修改":
                lblZtmc.ForeColor = Color.Red;
                break;

            case "审核通过":
            case "已归档":
            default:
                lblZtmc.ForeColor = Color.Green;
                break;
            }

            System.Web.UI.WebControls.HyperLink lblXmmc = Grid1.Rows[e.RowIndex].FindControl("lblXmmc") as System.Web.UI.WebControls.HyperLink;
            lblXmmc.Attributes["onclick"] = wndView.GetShowReference(String.Format("XmsbEdit.aspx?pkid={0}", Grid1.DataKeys[e.RowIndex][0].ToString()), "弹出窗-浏览");
        }
예제 #43
0
        public static Panel BuildCategoryPanel(BlogEntry entry)
        {
            Panel categoriesPanel = new Panel();
            categoriesPanel.CssClass = "blogPostLabel";
            categoriesPanel.Style.Add(HtmlTextWriterStyle.TextAlign, "right");

            if (entry.Categories.Count > 0)
            {
                String category = entry.Categories[0];
                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            for (int i = 1; i < entry.Categories.Count; i++)
            {
                String category = entry.Categories[i];
                Literal labelSeparator = new Literal();
                labelSeparator.Text = ", ";
                categoriesPanel.Controls.Add(labelSeparator);

                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            return categoriesPanel;
        }
        public override Control AddTo(Control container, PluginContext context)
        {
            ILanguageGateway gateway = N2.Context.Current.Resolve<ILanguageGateway>();
            if (!gateway.Enabled)
                return null;

            HtmlGenericControl div = new HtmlGenericControl("div");
            div.Attributes["class"] = "languages";
            container.Controls.Add(div);

            base.AddTo(div, context);

            foreach (ILanguage language in gateway.GetAvailableLanguages())
            {
                Url url = Engine.ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Content/Globalization/Translate.aspx");
                url = url.AppendQuery("language", language.LanguageCode);
                url = url.AppendQuery("selected={selected}");

                HyperLink h = new HyperLink();
                h.ID = language.LanguageCode.Replace('-', '_').Replace(' ', '_');
                h.Target = Targets.Preview;
                h.NavigateUrl = context.Rebase(context.Format(url, true));
                h.CssClass = "language";
                h.ToolTip = language.LanguageTitle;
                h.Text = string.Format("<img src='{0}' alt=''/>", Url.ToAbsolute(language.FlagUrl));
                div.Controls.Add(h);

                RegisterToolbarUrl(container, h.ClientID, url);
            }

            return div;
        }
예제 #45
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Table tb = new Table();
            tb.Width = new Unit( 100, UnitType.Percentage );
            TableRow row;
            TableCell cell;

            HyperLink lnk;

            if( Context.User.Identity.IsAuthenticated )
            {
                //create a new blank table row
                row = new TableRow();

                //set up the news link
                lnk = new HyperLink();
                lnk.Text = "News";
                lnk.NavigateUrl = "News.aspx";

                //create the cell and add the link
                cell = new TableCell();
                cell.Controls.Add(lnk);

                //add the new cell to the row
                row.Cells.Add(cell);
            }
            else
            {
                //code for unauthenticated users here
            }

            //finally, add the table to the placeholder
            phNav.Controls.Add(tb);
        }
예제 #46
0
파일: File.aspx.cs 프로젝트: meixger/n2cms
		private void LoadSizes()
		{
			var imageConfig = Engine.Resolve<EditSection>().Images;
			string baseImagePath, imageSize;
			ImagesUtility.SplitImageAndSize(Selection.SelectedItem.Url, imageConfig.Sizes.GetSizeNames(), out baseImagePath, out imageSize);
			foreach (var size in imageConfig.Sizes.AllElements.Where(s => s.Announced))
			{
				var hl = new HyperLink();
				hl.ID = size.Name + "Size";
				bool exists;
				var path = ImagesUtility.GetExistingImagePath(Engine.Resolve<IFileSystem>(), baseImagePath, size.Name, out exists);
				if (exists)
				{
					var file = (SelectedFile.Parent as File) ?? SelectedFile;

					hl.NavigateUrl = "File.aspx?selected=" + file.GetChild(VirtualPathUtility.GetFileName(path)).Path;
					hl.Text = Utility.GetResourceString("ImageSizes", size.Name + ".Text") ?? (string.IsNullOrEmpty(size.Description) ? size.Name : size.Description);
					hl.Text += GetSizeText(size.Width, size.Height);
					hl.CssClass = "command";
					if (path == Selection.SelectedItem.Url)
						omSizes.Controls.AddAt(0, hl);
					else
						omSizes.Controls.Add(hl);
				}
			}
			omSizes.Visible = omSizes.Controls.Count > 1;
		}
예제 #47
0
 private void FindControls()
 {
     this.rptProductImages = (VshopTemplatedRepeater) this.FindControl("rptProductImages");
     this.litProdcutName = (Literal) this.FindControl("litProdcutName");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litDescription = (Literal) this.FindControl("litDescription");
     this.litSoldCount = (Literal) this.FindControl("soldCount");
     this.litprice = (Literal) this.FindControl("price");
     this.litcontent = (Literal) this.FindControl("content");
     this.litminCount = (Literal) this.FindControl("minCount");
     this.litGroupBuyId = (HtmlInputControl) this.FindControl("litGroupbuyId");
     this.litLeftSeconds = (Literal) this.FindControl("leftSeconds");
     this.skuSelector = (Common_SKUSelector) this.FindControl("skuSelector");
     this.linkDescription = (HyperLink) this.FindControl("linkDescription");
     this.expandAttr = (Common_ExpandAttributes) this.FindControl("ExpandAttributes");
     this.salePrice = (Literal) this.FindControl("salePrice");
     this.leftCount = (Literal) this.FindControl("leftCount");
     this.minSuccessCount = (Literal) this.FindControl("minSuccessCount");
     this.txtProductId = (HtmlInputControl) this.FindControl("txtProductId");
     this.litConsultationsCount = (Literal) this.FindControl("litConsultationsCount");
     this.litReviewsCount = (Literal) this.FindControl("litReviewsCount");
     this.litMaxCount = (Literal) this.FindControl("litMaxCount");
     this.startTime = (HtmlInputHidden) this.FindControl("startTime");
     this.endTime = (HtmlInputHidden) this.FindControl("endTime");
     this.groupBuySoldCount = (HtmlInputHidden) this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount = (HtmlInputHidden) this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (Literal) this.FindControl("litGroupbuyDescription");
     this.nowTime = (HtmlInputHidden) this.FindControl("nowTime");
 }
        private void CreateIndex()
        {
            try
            {
                DirectoryInfo di = new DirectoryInfo(Server.MapPath(Constants.GeneratedControlsDirectory));
                FileInfo[] files = di.GetFiles(string.Concat("*", Constants.ControlFileExtenstion), SearchOption.TopDirectoryOnly);

                foreach (FileInfo file in files)
                {
                    HyperLink link = new HyperLink();
                    link.NavigateUrl = Utilities.ConstructUrl(Constants.ControlKey, 
                      file.Name.Replace(string.Concat(Constants.ControlPostfix, Constants.ControlFileExtenstion), string.Empty));

                    link.Text = file.Name.Replace(
                        string.Concat(Constants.ControlPostfix, Constants.ControlFileExtenstion), string.Empty);

                    NavigationMenuStripPlaceHolder.Controls.Add(link);
                    NavigationMenuStripPlaceHolder.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;"));
                }
            }

            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
		public override Control AddTo(Control container, PluginContext context)
		{
			if(!ActiveFor(container, context.State)) return null;
			if (context.Selected == null) return null;
			if (context.Selected.VersionOf.HasValue) return null;

			IEngine engine = Context.Current;
			//TODO: fixme, cause items to be deserialized always
			//ContentItem latestVersion = engine.Resolve<IVersionManager>().GetVersionsOf(context.Selected, 0, 1)[0];
			var draft = engine.Resolve<DraftRepository>().GetDraftInfo(context.Selected);
			if (draft == null)
				return null;
			var latestVersion = engine.Resolve<DraftRepository>().FindDrafts(context.Selected).Select(v => v.Version).FirstOrDefault();
			if (latestVersion == null)
				return null;

			Url versionPreviewUrl = engine.GetContentAdapter<NodeAdapter>(latestVersion).GetPreviewUrl(latestVersion);
			versionPreviewUrl = versionPreviewUrl.SetQueryParameter("edit", context.HttpContext.Request["edit"]);

			HyperLink hl = new HyperLink();
			hl.NavigateUrl = versionPreviewUrl;
			hl.Text = GetInnerHtml(context, latestVersion.State == ContentState.Waiting ? "{IconsUrl}/clock_play.png".ResolveUrlTokens() : IconUrl, ToolTip, Title);
			hl.CssClass = "preview";
			hl.ToolTip = Utility.GetResourceString(GlobalResourceClassName, Name + ".ToolTip") ?? context.Format(ToolTip, false);
			container.Controls.Add(hl);

			return hl;
		}
예제 #50
0
파일: SendInfo.cs 프로젝트: zwkjgs/XKD
 protected void rptList_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.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rptSubList");
         OrderInfo orderInfo = OrderHelper.GetOrderInfo(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID").ToString());
         if (orderInfo != null && orderInfo.LineItems.Count > 0)
         {
             repeater.DataSource = orderInfo.LineItems.Values;
             repeater.DataBind();
         }
         OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         if (!(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
         {
             string arg_CE_0 = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
         }
         int num = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId") != System.DBNull.Value) ? ((int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId")) : 0;
         System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnEditPrice");
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             hyperLink.Visible = true;
         }
         if (num > 0)
         {
             GroupBuyStatus arg_14A_0 = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus");
         }
     }
 }
예제 #51
0
 protected void ButtonQuery_Click(object sender, EventArgs e)
 {
     Table.Rows.Clear();
     List<Order> allOrders = OrderService.FindOrdersByStatusAndDate(Int32.Parse(DropDownListStatus.SelectedValue), Int32.Parse(DropDownListDate.SelectedValue));
     foreach (Order order in allOrders)
     {
         TableRow tr = new TableRow();
         TableCell tc = new TableCell();
         tc.Text = order.OrderSerialNumber.ToString();
         tr.Cells.Add(tc);
         tc = new TableCell();
         tc.Text = order.OrderID;
         tr.Cells.Add(tc);
         tc = new TableCell();
         tc.Text = order.UserID.ToString();
         tr.Cells.Add(tc);
         tc = new TableCell();
         tc.Text = order.ModiefiedDate.ToString();
         tr.Cells.Add(tc);
         tc = new TableCell();
         HyperLink hl = new HyperLink();
         hl.Text = "操作";
         hl.NavigateUrl = "/Admin/OrderInfo.aspx?orderID=" + order.OrderID;
         tc.Controls.Add(hl);
         tr.Cells.Add(tc);
         Table.Rows.Add(tr);
     }
 }
예제 #52
0
        public void InstantiateIn(System.Web.UI.Control container)
        {
            var linkField = new System.Web.UI.WebControls.HyperLink();

            linkField.DataBinding += linkField_DataBinding;
            linkField.Target       = "_blank";
            linkField.CssClass     = _cssStyle;
            container.Controls.Add(linkField);
        }
예제 #53
0
 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;
         }
     }
 }
예제 #54
0
        /// <summary>
        /// Handles the "Rate Material" link to determine if the user can rate materials
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Rate_Ld(Object sender, EventArgs e)
        {
            System.Web.UI.WebControls.HyperLink rateMaterialLink = (System.Web.UI.WebControls.HyperLink)sender;

            if (!Context.User.Identity.IsAuthenticated || isAuthor || isSubmitter)
            {
                rateMaterialLink.Enabled = false;
            }
        }
예제 #55
0
 public void AddContraint(System.Web.UI.WebControls.PlaceHolder list, string key, string value, string returnPage)
 {
     System.Web.UI.WebControls.HyperLink hyperlink = new System.Web.UI.WebControls.HyperLink();
     System.Web.UI.WebControls.Label     separator = new System.Web.UI.WebControls.Label();
     hyperlink.Text        = "   " + key + "  [" + value.Replace(",", " - ") + "]";
     hyperlink.NavigateUrl = "search_remove_key.aspx?key=" + key + "&return=" + returnPage;
     separator.Text        = "  |  ";
     list.Controls.Add(hyperlink);
     list.Controls.Add(separator);
 }
예제 #56
0
		protected void Page_Load(object sender, System.EventArgs e)
		{
			int.TryParse(base.Request.QueryString["productId"], out this.productId);
			int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId);
			if (!this.Page.IsPostBack)
			{
				System.Collections.Generic.IList<int> list = null;
				System.Collections.Generic.IList<int> list2 = null;
				System.Collections.Generic.Dictionary<int, System.Collections.Generic.IList<int>> attrs;
				ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list, out list2);
				if (productDetails == null)
				{
					base.GotoResourceNotFound();
					return;
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"]))
				{
					this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId);
					this.ViewState["ProductCategoryId"] = this.categoryId;
					this.lnkEditCategory.NavigateUrl = "Supplier_ProductSelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
				}
				else
				{
					this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId);
					this.ViewState["ProductCategoryId"] = productDetails.CategoryId;
					this.lnkEditCategory.NavigateUrl = "Supplier_ProductSelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
				}
				System.Web.UI.WebControls.HyperLink expr_146 = this.lnkEditCategory;
				expr_146.NavigateUrl = expr_146.NavigateUrl + "&productId=" + productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture);
				this.litralProductTag.SelectedValue = list2;
				if (list2.Count > 0)
				{
					foreach (int current in list2)
					{
						TrimTextBox expr_19E = this.txtProductTag;
						expr_19E.Text = expr_19E.Text + current.ToString() + ",";
					}
					this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1);
				}
				this.dropProductTypes.DataBind();
				this.dropProductLines.DataBind();
				this.dropBrandCategories.DataBind();
				this.LoadProduct(productDetails, attrs);
				System.Data.DataTable dataTable = Methods.Supplier_PtGet(this.productId);
				if (dataTable != null && dataTable.Rows.Count > 0)
				{
					System.Data.DataRow dataRow = dataTable.Rows[0];
					int num = (int)dataRow["checkstatus"];
					if (num == 3)
					{
						this.btnSave.Visible = false;
					}
				}
			}
		}
예제 #57
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["ProductId"], out this.productId))
     {
         base.GotoResourceNotFound();
         return;
     }
     int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId);
     if (!this.Page.IsPostBack)
     {
         ProductInfo product = SubSiteProducthelper.GetProduct(this.productId);
         if (product == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"]))
         {
             this.litCategoryName.Text           = SubsiteCatalogHelper.GetFullCategory(this.categoryId);
             this.ViewState["ProductCategoryId"] = this.categoryId;
             this.lnkEditCategory.NavigateUrl    = "SelectMyCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         }
         else
         {
             this.litCategoryName.Text           = SubsiteCatalogHelper.GetFullCategory(product.CategoryId);
             this.ViewState["ProductCategoryId"] = product.CategoryId;
             this.lnkEditCategory.NavigateUrl    = "SelectMyCategory.aspx?categoryId=" + product.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         }
         System.Web.UI.WebControls.HyperLink expr_148 = this.lnkEditCategory;
         expr_148.NavigateUrl = expr_148.NavigateUrl + "&productId=" + product.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>();
         list = SubSiteProducthelper.GetProductTags(this.productId);
         this.litralProductTag.SelectedValue = list;
         if (list.Count > 0)
         {
             foreach (int current in list)
             {
                 TrimTextBox expr_1B4 = this.txtProductTag;
                 expr_1B4.Text = expr_1B4.Text + current.ToString() + ",";
             }
             this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1);
         }
         this.dropProductTypes.Enabled = false;
         this.dropProductTypes.DataBind();
         this.dropProductTypes.SelectedValue = product.TypeId;
         this.dropProductLines.Enabled       = false;
         this.dropProductLines.DataBind();
         this.dropProductLines.SelectedValue = new int?(product.LineId);
         this.dropBrandCategories.Enabled    = false;
         this.dropBrandCategories.DataBind();
         this.dropBrandCategories.SelectedValue = product.BrandId;
         this.LoadProudct(product);
     }
 }
예제 #58
0
 private void dlstOrderItems_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
 {
     Hidistro.Membership.Context.SettingsManager.GetSiteSettings(Hidistro.Membership.Context.HiContext.Current.User.UserId);
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.HyperLink arg_46_0 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hpkBuyToSend");
         System.Web.UI.WebControls.HyperLink arg_5C_0 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hpkBuyDiscount");
         System.Web.UI.WebControls.Literal   arg_72_0 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPurchaseGiftId");
         System.Web.UI.WebControls.Literal   arg_88_0 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litWholesaleDiscountId");
     }
 }
예제 #59
0
 private static void Ico(Control Tools, int Name, string ToolTip, string Cmd, string E = "')")
 {
     System.Web.UI.WebControls.HyperLink Icon = new System.Web.UI.WebControls.HyperLink();
     Icon.CssClass = "icon";
     Icon.Style.Add("font-size", "xx-large");
     Icon.Style.Add("text-decoration", "none!important");
     Icon.ToolTip     = ToolTip;
     Icon.NavigateUrl = "javascript:var status=document.execCommand('" + Cmd + E;
     Icon.Text        = char.ConvertFromUtf32(Name);
     Tools.Controls.Add(Icon);
 }
예제 #60
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     int.TryParse(base.Request.QueryString["productId"], out this.productId);
     int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId);
     this.btnRemark.Click += new System.EventHandler(this.btnRemark_Click);
     if (!this.Page.IsPostBack)
     {
         System.Collections.Generic.IList <int> list  = null;
         System.Collections.Generic.IList <int> list2 = null;
         System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs;
         ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list, out list2);
         if (productDetails == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"]))
         {
             this.litCategoryName.Text           = CatalogHelper.GetFullCategory(this.categoryId);
             this.ViewState["ProductCategoryId"] = this.categoryId;
             this.lnkEditCategory.NavigateUrl    = "SelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         }
         else
         {
             this.litCategoryName.Text           = CatalogHelper.GetFullCategory(productDetails.CategoryId);
             this.ViewState["ProductCategoryId"] = productDetails.CategoryId;
             this.lnkEditCategory.NavigateUrl    = "SelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         }
         System.Web.UI.WebControls.HyperLink expr_15D = this.lnkEditCategory;
         expr_15D.NavigateUrl = expr_15D.NavigateUrl + "&productId=" + productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture);
         if (list != null && list.Count > 0)
         {
             this.ViewState["distributorUserIds"] = list;
             this.hlinkDistributor.NavigateUrl    = "../distribution/ManageDistributor.aspx?LineId=" + productDetails.LineId.ToString(System.Globalization.CultureInfo.InvariantCulture);
             this.hlinkDistributor.Text           = string.Format("{0}位分销商", list.Count);
         }
         this.litralProductTag.SelectedValue = list2;
         if (list2.Count > 0)
         {
             foreach (int current in list2)
             {
                 TrimTextBox expr_21B = this.txtProductTag;
                 expr_21B.Text = expr_21B.Text + current.ToString() + ",";
             }
             this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1);
         }
         this.dropProductTypes.DataBind();
         this.dropProductLines.DataBind();
         this.dropBrandCategories.DataBind();
         this.BindMemberRanks();
         this.LoadProduct(productDetails, attrs);
     }
 }