Inheritance: System.Web.UI.Control, System.Web.UI.IAttributeAccessor
        public void InitMenu()
        {
            li1 = (HtmlControl)this.menu1;
            li2 = (HtmlControl)this.menu2;
            li3 = (HtmlControl)this.menu3;
            li4 = (HtmlControl)this.menu4;

            b_hmenu1 = (HtmlControl)this.con_menu_1;
            b_hmenu2 = (HtmlControl)this.con_menu_2;
            b_hmenu3 = (HtmlControl)this.con_menu_3;
            b_hmenu4 = (HtmlControl)this.con_menu_4;

            s_menu1_1 = (HtmlControl)this.menu1_1;
            s_menu1_2 = (HtmlControl)this.menu1_2;
            s_menu1_3 = (HtmlControl)this.menu1_3;
            s_menu1_4 = (HtmlControl)this.menu1_4;

            s_menu2_1 = (HtmlControl)this.menu2_1;
            s_menu2_2 = (HtmlControl)this.menu2_2;
            s_menu2_3 = (HtmlControl)this.menu2_3;
            s_menu2_4 = (HtmlControl)this.menu2_4;

            s_menu3_1 = (HtmlControl)this.menu3_1;

            s_menu4_1 = (HtmlControl)this.menu4_1;
            s_menu4_2 = (HtmlControl)this.menu4_2;
            s_menu4_3 = (HtmlControl)this.menu4_3;
        }
Esempio n. 2
0
 private void grdProducts_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)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         if (!string.IsNullOrEmpty(masterSettings.DistributorProducts))
         {
             string value = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "productid").ToString();
             System.Web.UI.WebControls.Button       button      = e.Item.FindControl("btnCheck") as System.Web.UI.WebControls.Button;
             System.Web.UI.HtmlControls.HtmlControl htmlControl = e.Item.FindControl("trId") as System.Web.UI.HtmlControls.HtmlControl;
             if (masterSettings.DistributorProducts.Contains(value))
             {
                 button.Text = "取消";
                 button.Attributes.CssStyle.Remove("background-color");
                 button.Attributes.CssStyle.Remove("border-color");
                 button.Attributes.CssStyle.Add("background-color", "#5cb85c");
                 button.Attributes.CssStyle.Add("border-color", "#4cae4c");
                 htmlControl.Attributes.Add("class", "selRow");
                 return;
             }
             button.Text = "选择";
             button.Attributes.CssStyle.Remove("background-color");
             button.Attributes.CssStyle.Remove("border-color");
             button.Attributes.CssStyle.Add("background-color", "#286090");
             button.Attributes.CssStyle.Add("border-color", "#204d74");
             htmlControl.Attributes.Remove("class");
         }
     }
 }
Esempio n. 3
0
        protected override void AttachChildControls()
        {
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                System.Web.UI.WebControls.Literal          control  = (System.Web.UI.WebControls.Literal) this.FindControl("txtUserBindName");
                System.Web.UI.HtmlControls.HtmlInputText   control2 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtRealName");
                System.Web.UI.HtmlControls.HtmlInputText   control3 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtPhone");
                System.Web.UI.HtmlControls.HtmlInputText   control4 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtEmail");
                System.Web.UI.HtmlControls.HtmlInputHidden control5 = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtUserName");
                System.Web.UI.HtmlControls.HtmlInputText   control6 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtCardID");
                this.imglogo    = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imglogo");
                this.Nickname   = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("Nickname");
                this.WeixinHead = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("WeixinHead");
                if (!string.IsNullOrEmpty(currentMember.UserHead))
                {
                    this.imglogo.Src = currentMember.UserHead;
                }
                this.Nickname.InnerText = currentMember.UserName;
                if (string.IsNullOrEmpty(currentMember.OpenId))
                {
                    this.WeixinHead.Attributes.Add("noOpenId", "true");
                }
                control.SetWhenIsNotNull(currentMember.UserBindName);
                control5.SetWhenIsNotNull(currentMember.UserName);
                control2.SetWhenIsNotNull(currentMember.RealName);
                control3.SetWhenIsNotNull(currentMember.CellPhone);
                control4.SetWhenIsNotNull(currentMember.QQ);
                control6.SetWhenIsNotNull(currentMember.CardID);
            }
            PageTitle.AddSiteNameTitle("修改用户信息");
        }
Esempio n. 4
0
		public void WriteOnClickAttribute(HtmlTextWriter writer, HtmlControl control, bool submitsAutomatically, bool submitsProgramatically, bool causesValidation, string validationGroup) {
			var attributes = control.Attributes;
			string clientValidateEvent = null;
			if(submitsAutomatically) {
				if(causesValidation) {
					clientValidateEvent = GetClientValidateEvent(validationGroup);
				}
				control.Page.ClientScript.RegisterForEventValidation(control.UniqueID);
			} else if(submitsProgramatically) {
				if(causesValidation) {
					clientValidateEvent = GetClientValidatedPostback(control, validationGroup);
				} else {
					clientValidateEvent = control.Page.ClientScript.GetPostBackEventReference(control, string.Empty, true);
				}
			} else {
				control.Page.ClientScript.RegisterForEventValidation(control.UniqueID);
			}
			if(clientValidateEvent != null) {
				if(attributes["language"] != null) {
					attributes.Remove("language");
				}
				writer.WriteAttribute("language", "javascript");
				var onClick = attributes["onclick"];
				if(onClick != null) {
					attributes.Remove("onclick");
					writer.WriteAttribute("onclick", string.Format("{0} {1}", onClick, clientValidateEvent));
				} else {
					writer.WriteAttribute("onclick", clientValidateEvent);
				}
			}
		}
        protected override void SetCustomAttributes(Control container, HtmlControl controlToDecorate)
        {
            controlToDecorate.Attributes["data-is-multi-select"] = "true";
            base.SetCustomAttributes(container, controlToDecorate);

            //var parentCategoryId = GetParentCategoryId(container);
            //if (!string.IsNullOrEmpty(parentCategoryId))
            //    controlToDecorate.Attributes["data-parent-category-id"] = parentCategoryId;
        }
Esempio n. 6
0
 /// <summary>
 /// Add an event to the Webcontrol if another event is assigned the script will be appended to the event
 /// </summary>
 /// <param name="ctrl">The WebControl to add the event to eg. a button</param>
 /// <param name="eventName">The name of the event eg. onclick</param>
 /// <param name="script">The Script to call when the event is fired</param>
 public static void SetWebControlEvent(HtmlControl ctrl, string eventName, string script)
 {
     if (ctrl != null)
     {
         if (ctrl.Attributes[eventName] != null && !ctrl.Attributes[eventName].Contains(script))
         {
             ctrl.Attributes[eventName] += script;
         }
         else if (ctrl.Attributes[eventName] == null)
         {
             ctrl.Attributes.Add(eventName, script);
         }
     }
 }
Esempio n. 7
0
    private void FillGrid()
    {
        Arm      ac = new Arm();
        ArmDatum dm = new ArmDatum();

        DataList1.DataSource = ac.Select_All_User();
        DataList1.DataBind();

        if (((DataTable)DataList1.DataSource).Rows.Count == 0)
        {
            System.Web.UI.HtmlControls.HtmlControl ctrl = (HtmlControl)this.Parent.Parent;
            ctrl.Visible = false;
        }
    }
Esempio n. 8
0
		void setHelperPanelVisibility(HtmlControl anchor, HtmlControl div, bool state)
		{
			if (state)
			{
				div.Style.Remove("display");
				anchor.Style["border-bottom"] = "1px solid #FED551";
				anchor.Style["background-color"] = "#FED551";
			}
			else
			{
				div.Style["display"] = "none";
				anchor.Style.Remove("border-bottom");
				anchor.Style.Remove("background-color");
			}
		}
Esempio n. 9
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtEmail");
     this.txtUserName       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtContent        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtContent");
     this.btnRefer          = ButtonManager.Create(this.FindControl("btnRefer"));
     this.spReviewUserName  = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewUserName");
     this.spReviewPsw       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewPsw");
     this.spReviewReg       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewReg");
     this.txtReviewUserName = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewUserName");
     this.txtReviewPsw      = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewPsw");
     this.txtReviewCode     = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewCode");
     this.productdetailLink = (ProductDetailsLink)this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click   += new System.EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品评论");
         if (HiContext.Current.User.UserRole == UserRole.Member)
         {
             this.txtUserName.Text         = HiContext.Current.User.Username;
             this.txtEmail.Text            = HiContext.Current.User.Email;
             this.txtReviewUserName.Value  = string.Empty;
             this.txtReviewPsw.Value       = string.Empty;
             this.spReviewUserName.Visible = false;
             this.spReviewPsw.Visible      = false;
             this.spReviewReg.Visible      = false;
             this.btnRefer.Text            = "评论";
         }
         else
         {
             this.spReviewUserName.Visible = true;
             this.spReviewPsw.Visible      = true;
             this.spReviewReg.Visible      = true;
             this.btnRefer.Text            = "登录并评论";
         }
         this.txtReviewCode.Value = string.Empty;
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.productdetailLink.ProductId   = this.productId;
             this.productdetailLink.ProductName = productSimpleInfo.ProductName;
         }
     }
 }
Esempio n. 10
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["ReferralId"], out this.userId))
            {
                base.GotoResourceNotFound("");
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);

            if (userIdDistributors == null)
            {
                base.GotoResourceNotFound("");
            }
            this.imglogo = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("QrcodeImg");
            int currentMemberUserId = Globals.GetCurrentMemberUserId();

            this.editPanel         = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("editPanel");
            this.editPanel.Visible = false;
            if (currentMemberUserId == this.userId)
            {
                this.imglogo.Attributes.Add("Admin", "true");
                MemberInfo      currentMember = MemberProcessor.GetCurrentMember();
                System.DateTime cardCreatTime = userIdDistributors.CardCreatTime;
                string          text          = System.IO.File.ReadAllText(System.Web.HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                JObject         jObject       = JsonConvert.DeserializeObject(text) as JObject;
                System.DateTime t             = default(System.DateTime);
                if (jObject != null && jObject["writeDate"] != null)
                {
                    t = System.DateTime.Parse(jObject["writeDate"].ToString());
                }
                if (string.IsNullOrEmpty(userIdDistributors.StoreCard) || cardCreatTime < t)
                {
                    StoreCardCreater storeCardCreater = new StoreCardCreater(text, currentMember.UserHead, userIdDistributors.Logo, Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + this.userId.ToString(), currentMember.UserName, userIdDistributors.StoreName, this.userId);
                    string           imgUrl           = "";
                    if (storeCardCreater.ReadJson() && storeCardCreater.CreadCard(out imgUrl))
                    {
                        DistributorsBrower.UpdateStoreCard(this.userId, imgUrl);
                    }
                }
            }
            if (string.IsNullOrEmpty(userIdDistributors.StoreCard))
            {
                userIdDistributors.StoreCard = "/Storage/master/DistributorCards/StoreCard" + this.userId.ToString() + ".jpg";
            }
            this.ShareInfo   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("ShareInfo");
            this.imglogo.Src = userIdDistributors.StoreCard;
            PageTitle.AddSiteNameTitle("掌柜名片");
        }
Esempio n. 11
0
        public static void AddCssClass(HtmlControl control, string cssClass)
        {
            string classes = control.Attributes["class"] ?? string.Empty;

            Regex regex = new Regex(@"(^|\s)" + Regex.Escape(cssClass) + @"($|\s)", RegexOptions.IgnoreCase);
            if (regex.IsMatch(classes))
                return;

            if (classes.Length > 0)
            {
                control.Attributes["class"] += " " + cssClass;
            }
            else
            {
                control.Attributes["class"] = cssClass;
            }
        }
Esempio n. 12
0
        public static void modifyDOMElement(HtmlControl element, string id, Pixel px, Size sz, string position, string border,
            string overflow, float opacity)
        {
            if (id != null)
                element.ID = id;

            if (px != null)
            {
                element.Style["left"] = px.x + "px";
                element.Style["top"] = px.y + "px";
            }

            if (sz != Size.Empty)
            {
                element.Style["width"] = sz.Width + "px";
                element.Style["height"] = sz.Height + "px";
            }

            if (position != null)
            {
                element.Style["position"] = position;
            }

            if (border != null)
            {
                element.Style["border"] = border;
            }

            if (overflow != null)
            {
                element.Style["overflow"] = overflow;
            }

            if (opacity >= 0 && opacity < 1)
            {
                element.Style["filter"] = string.Format("alpha(opacity={0})", opacity * 100);
                element.Style["opacity"] = opacity.ToString();
            }
            else
                if (opacity == 1)
                {
                    element.Style["filter"] = "";
                    element.Style["opacity"] = "";
                }

        }
Esempio n. 13
0
 public Map(HtmlControl parentDiv)
 {
     _parentDiv = parentDiv;
     _maxExtent = new Rect(new Point(-180, -90), new Point(180, 90));
     _parentDiv.Attributes["class"] = "olMap";
     _viewPortDiv = Util.createDiv("_ViewPort", null, Size.Empty, null, "relative", null, "hidden", 2f);
     _viewPortDiv.Style["width"] = "100%";
     _viewPortDiv.Style["height"] = "100%";
     _viewPortDiv.Attributes["class"] = "olMapViewport";
     _parentDiv.Controls.Add(_viewPortDiv);
     _layerContainerDiv = Util.createDiv("_Container", null, Size.Empty, null, null, null, null, 2f);
     _layerContainerDiv.Style["z-index"] = "999";
     _viewPortDiv.Controls.Add(_layerContainerDiv);
     
     updateSize();
 
 }
Esempio n. 14
0
        public Layer(string name)
        {
            _name = name;

            if (_id == null)
            {
                _id = Util.createUniqueID(GetType().Name + "_");
                _div = Util.createDiv(_id, null, Size.Empty, null, null, null, null, 2);
                _div.Style["width"] = "100%";
                _div.Style["height"] = "100%";
                _div.Style["direction"] = "ltr";

            }

            if (_wrapDateLine)
                _displayOutsideMaxExtent = true;
        }
Esempio n. 15
0
        internal static void WriteOnClickAttribute(HtmlTextWriter writer, HtmlControls.HtmlControl control, bool submitsAutomatically, bool submitsProgramatically, bool causesValidation)
        {
            AttributeCollection attributes = control.Attributes;
            string injectedOnClick         = null;

            if (submitsAutomatically)
            {
                if (causesValidation)
                {
                    injectedOnClick = Util.GetClientValidateEvent(control.Page);
                }
            }
            else if (submitsProgramatically)
            {
                if (causesValidation)
                {
                    injectedOnClick = Util.GetClientValidatedPostback(control);
                }
                else
                {
                    injectedOnClick = control.Page.GetPostBackClientEvent(control, "");
                }
            }
            if (injectedOnClick != null)
            {
                string existingLanguage = attributes["language"];
                if (existingLanguage != null)
                {
                    attributes.Remove("language");
                }
                writer.WriteAttribute("language", "javascript");

                string existingOnClick = attributes["onclick"];
                if (existingOnClick != null)
                {
                    attributes.Remove("onclick");
                    writer.WriteAttribute("onclick", existingOnClick + " " + injectedOnClick);
                }
                else
                {
                    writer.WriteAttribute("onclick", injectedOnClick);
                }
            }
        }
Esempio n. 16
0
    /// <summary>
    /// Displays any club schedules for this aircraft
    /// <paramref name="ac">The aircraft</paramref>
    /// <paramref name="rowClubSchedules">The row to show/hide if there are clubs found</paramref>
    /// <paramref name="rptSchedules">The repeater control for any clubs</paramref>
    /// <paramref name="setOwner">An action to take if the club has an owner name prepend policy</paramref>
    /// </summary>
    protected void SetUpSchedules(Aircraft ac, Repeater rptSchedules, System.Web.UI.HtmlControls.HtmlControl rowClubSchedules, Action <string> setOwner)
    {
        if (ac == null)
        {
            throw new ArgumentNullException(nameof(ac));
        }

        if (!Page.User.Identity.IsAuthenticated || ac.IsNew)
        {
            return;
        }

        if (rptSchedules == null)
        {
            throw new ArgumentNullException(nameof(rptSchedules));
        }
        if (rowClubSchedules == null)
        {
            throw new ArgumentNullException(nameof(rowClubSchedules));
        }

        List <MyFlightbook.Clubs.Club> lstClubs = new List <MyFlightbook.Clubs.Club>(MyFlightbook.Clubs.Club.ClubsForAircraft(ac.AircraftID, Page.User.Identity.Name));

        if (lstClubs.Count > 0)
        {
            rowClubSchedules.Visible = true;
            rptSchedules.DataSource  = lstClubs;
            rptSchedules.DataBind();

            // If *any* club has policy PrependsScheduleWithOwnerName, set the default text for it
            foreach (MyFlightbook.Clubs.Club c in lstClubs)
            {
                if (c.PrependsScheduleWithOwnerName)
                {
                    setOwner?.Invoke(Profile.GetUser(Page.User.Identity.Name).UserFullName);
                    break;
                }
            }
        }
    }
Esempio n. 17
0
 protected override void AttachChildControls()
 {
     this.rptLeaveComments = (ThemedTemplatedRepeater)this.FindControl("rptLeaveComments");
     this.pager            = (Pager)this.FindControl("pager");
     this.txtTitle         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTitle");
     this.txtUserName      = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtContent       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtContent");
     this.btnRefer         = ButtonManager.Create(this.FindControl("btnRefer"));
     this.spLeaveUserName  = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeaveUserName");
     this.spLeavePsw       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeavePsw");
     this.spLeaveReg       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeaveReg");
     this.txtLeaveUserName = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeaveUserName");
     this.txtLeavePsw      = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeavePsw");
     this.txtLeaveCode     = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeaveCode");
     this.btnRefer.Click  += new System.EventHandler(this.btnRefer_Click);
     PageTitle.AddSiteNameTitle("客户留言");
     if (HiContext.Current.User.UserRole == UserRole.Member)
     {
         this.txtUserName.Text        = HiContext.Current.User.Username;
         this.txtLeaveUserName.Value  = string.Empty;
         this.txtLeavePsw.Value       = string.Empty;
         this.spLeaveUserName.Visible = false;
         this.spLeavePsw.Visible      = false;
         this.spLeaveReg.Visible      = false;
         this.btnRefer.Text           = "发表";
     }
     else
     {
         this.spLeaveUserName.Visible = true;
         this.spLeavePsw.Visible      = true;
         this.spLeaveReg.Visible      = true;
         this.btnRefer.Text           = "登录并留言";
     }
     this.txtLeaveCode.Value = string.Empty;
     this.BindList();
 }
Esempio n. 18
0
File: UserMG.cs Progetto: kyvkri/MG
 public void AddAttributes(HtmlControl control)
 {
     control.Attributes.Add("itemscope", null);
        control.Attributes.Add("itemtype", Itemtype);
 }
Esempio n. 19
0
		public static void AddOnClickJavascriptConfirmationForPostbackControl(HtmlControl control, string confirmationQuestion)
		{
			control.Attributes["onclick"] = "if(confirm('" + confirmationQuestion.Replace("'", "") + "')){__doPostBack('" + control.UniqueID + "','');return false;}else{return false;};";
		}
Esempio n. 20
0
 public static void RemoveAttribute(string attKey, System.Web.UI.HtmlControls.HtmlControl ctrl)
 {
     RemoveAttributeInCol(attKey, ctrl.Attributes);
 }
Esempio n. 21
0
        private static void AddAttributes(HtmlControl element, string keyword)
        {
            switch (keyword)
            {
                // HTML
                case "xml":
                    element.Attributes["xmlns"] = "http://www.w3.org/1999/xhtml";
                    element.Attributes["xml:lang"] = "en";
                    break;

                // Link
                case "css":
                    element.Attributes["rel"] = "stylesheet";
                    element.Attributes["href"] = "";
                    element.Attributes["media"] = "all";
                    break;

                case "print":
                    element.Attributes["rel"] = "stylesheet";
                    element.Attributes["href"] = "";
                    element.Attributes["type"] = "print";
                    break;

                case "favicon":
                    element.Attributes["rel"] = "shortcut icon";
                    element.Attributes["href"] = "";
                    element.Attributes["media"] = "image/x-icon";
                    break;

                case "touch":
                    element.Attributes["rel"] = "apple-touch-icon";
                    element.Attributes["href"] = "";
                    break;

                case "rss":
                    element.Attributes["rel"] = "alternate";
                    element.Attributes["type"] = "application/rss+xml";
                    element.Attributes["title"] = "RSS";
                    element.Attributes["href"] = "";
                    break;

                case "atom":
                    element.Attributes["rel"] = "alternate";
                    element.Attributes["type"] = "application/atom+xml";
                    element.Attributes["title"] = "Atom";
                    element.Attributes["href"] = "";
                    break;

                // Meta
                case "utf":
                    element.Attributes["http-equiv"] = "content-type";
                    element.Attributes["content"] = "text/html;charset=UTF-8";
                    break;

                case "win":
                    element.Attributes["http-equiv"] = "content-type";
                    element.Attributes["content"] = "text/html;charset=win-1251";
                    break;

                case "compat":
                    element.Attributes["http-equiv"] = "X-UA-Compatible";
                    element.Attributes["content"] = "IE=7";
                    break;

                // Script
                case "src":
                    element.Attributes["src"] = "";
                    break;

                // A
                case "link":
                    element.Attributes["href"] = "http://";
                    break;

                case "mail":
                    element.Attributes["href"] = "mailto:";
                    break;

                // BDO
                case "r":
                    if (element.TagName == "bdo")
                        element.Attributes["dir"] = "rtl";
                    else if (element.TagName == "area")
                        element.Attributes["shape"] = "rect";
                    else if (element.TagName == "input")
                    {
                        element.Attributes["type"] = "radio";
                        element.Attributes["id"] = "";
                        element.Attributes.Remove("value");
                    }
                    break;

                case "l":
                    element.Attributes["dir"] = "ltr";
                    break;

                // Area
                case "d":
                    element.Attributes["shape"] = "default";
                    element.Attributes.Remove("coords");
                    break;

                case "c":
                    if (element.TagName == "area")
                    {
                        element.Attributes["shape"] = "circle";
                    }
                    else if (element.TagName == "input")
                    {
                        element.Attributes["type"] = "checkbox";
                        element.Attributes["id"] = "";
                        element.Attributes.Remove("value");
                    }
                    break;

                case "p":
                    if (element.TagName == "area")
                    {
                        element.Attributes["shape"] = "poly";
                    }
                    else if (element.TagName == "input")
                    {
                        element.Attributes["type"] = "password";
                        element.Attributes["id"] = "";
                    }
                    break;

                // Form
                case "get":
                    element.Attributes["action"] = "";
                    element.Attributes["method"] = "get";
                    break;

                case "post":
                    element.Attributes["action"] = "";
                    element.Attributes["method"] = "post";
                    break;

                // Input
                case "hidden":
                case "h":
                    element.Attributes["type"] = "hidden";
                    break;

                case "text":
                case "t":
                    element.Attributes["type"] = "text";
                    element.Attributes["id"] = "";
                    break;

                case "password":
                case "search":
                case "email":
                case "url":
                case "datetime":
                case "datetime-local":
                case "date":
                case "month":
                case "week":
                case "time":
                case "number":
                case "range":
                case "color":
                    element.Attributes["type"] = keyword;
                    element.Attributes["id"] = "";
                    break;

                case "checkbox":
                case "radio":
                    element.Attributes["type"] = keyword;
                    element.Attributes["id"] = "";
                    element.Attributes.Remove("value");
                    break;

                case "file":
                case "f":
                    element.Attributes["type"] = "file";
                    element.Attributes["id"] = "";
                    element.Attributes.Remove("value");
                    break;

                case "submit":
                case "s":
                    element.Attributes["type"] = "submit";
                    break;

                case "reset":
                    element.Attributes["type"] = "reset";
                    break;

                case "image":
                case "i":
                    element.Attributes["type"] = "image";
                    element.Attributes["src"] = "";
                    element.Attributes["alt"] = "";
                    break;

                case "button":
                case "b":
                    element.Attributes["type"] = "button";
                    break;
            }
        }
Esempio n. 22
0
 private void SetCssClass(HtmlControl control)
 {
     SetCssClass(control, false);
 }
Esempio n. 23
0
/// <summary>
/// Sets focus to a html control after page load
/// </summary>
/// <param name="control">control client id</param>
/// <param name="key">identity key value</param>
    public void DefaultFocus(System.Web.UI.HtmlControls.HtmlControl control, string key)
    {
        this.DefaultFocus(control.ClientID, key);
    }
Esempio n. 24
0
		public void MakeRollover(HtmlControl c)
		{
			c.Attributes["onmouseover"] = mouseOverText;
			c.Attributes["onmouseout"] = "htm();";
		}
Esempio n. 25
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["ReferralId"], out this.userId))
     {
         this.Context.Response.Redirect("/");
     }
     else
     {
         DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);
         if (userIdDistributors == null)
         {
             this.Context.Response.Redirect("/");
         }
         else
         {
             this.imglogo = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("QrcodeImg");
             int currentMemberUserId = Globals.GetCurrentMemberUserId(false);
             this.editPanel         = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("editPanel");
             this.editPanel.Visible = false;
             if (currentMemberUserId == this.userId)
             {
                 this.imglogo.Attributes.Add("Admin", "true");
                 MemberInfo      currentMember = MemberProcessor.GetCurrentMember();
                 System.DateTime cardCreatTime = userIdDistributors.CardCreatTime;
                 string          text          = System.IO.File.ReadAllText(System.Web.HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                 JObject         jObject       = JsonConvert.DeserializeObject(text) as JObject;
                 System.DateTime t             = default(System.DateTime);
                 if (jObject != null && jObject["writeDate"] != null)
                 {
                     t = System.DateTime.Parse(jObject["writeDate"].ToString());
                 }
                 ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 if (scanInfosByUserId == null)
                 {
                     ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                     scanInfosByUserId = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 }
                 string text2;
                 if (scanInfosByUserId == null)
                 {
                     text2 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                 }
                 else
                 {
                     text2 = scanInfosByUserId.CodeUrl;
                     if (string.IsNullOrEmpty(text2))
                     {
                         string token_Message = TokenApi.GetToken_Message(this.siteSettings.WeixinAppId, this.siteSettings.WeixinAppSecret);
                         if (TokenApi.CheckIsRightToken(token_Message))
                         {
                             string text3 = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                             if (!string.IsNullOrEmpty(text3))
                             {
                                 text2 = text3;
                                 scanInfosByUserId.CodeUrl        = text3;
                                 scanInfosByUserId.CreateTime     = System.DateTime.Now;
                                 scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                                 ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                             }
                         }
                     }
                     if (string.IsNullOrEmpty(text2))
                     {
                         text2 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                     }
                     else
                     {
                         text2 = BarCodeApi.GetQRImageUrlByTicket(text2);
                     }
                 }
                 if (string.IsNullOrEmpty(userIdDistributors.StoreCard) || cardCreatTime < t)
                 {
                     string storeName = userIdDistributors.StoreName;
                     if (!this.siteSettings.IsShowDistributorSelfStoreName)
                     {
                         storeName = this.siteSettings.SiteName;
                     }
                     StoreCardCreater storeCardCreater = new StoreCardCreater(text, currentMember.UserHead, userIdDistributors.Logo, text2, currentMember.UserName, storeName, this.userId, this.userId);
                     string           imgUrl           = "";
                     if (storeCardCreater.ReadJson() && storeCardCreater.CreadCard(out imgUrl))
                     {
                         DistributorsBrower.UpdateStoreCard(this.userId, imgUrl);
                     }
                 }
             }
             if (string.IsNullOrEmpty(userIdDistributors.StoreCard))
             {
                 userIdDistributors.StoreCard = "/Storage/master/DistributorCards/StoreCard" + this.userId.ToString() + ".jpg";
             }
             this.ShareInfo   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("ShareInfo");
             this.imglogo.Src = userIdDistributors.StoreCard;
             PageTitle.AddSiteNameTitle("掌柜名片");
         }
     }
 }
Esempio n. 26
0
        private static HtmlTable CreateTable(HtmlControl container)
        {
            HtmlTable table = new HtmlTable();
            table.Attributes["class"] = "TokenVisualizerTable";
            container.Controls.Add(table);

            return table;
        }
Esempio n. 27
0
        private static void AddNotAuthenticatedUserTable(HtmlControl container)
        {
            HtmlTable table = CreateTable(container);

            HtmlTableRow row = new HtmlTableRow();
            row.Cells.Add(new HtmlTableCell() { InnerText = Resources.NotAuthenticatedUser });
            row.Attributes["class"] = "NotAuthenticatedUser";
            table.Rows.Add(row);
        }
Esempio n. 28
0
        private static void AddClaimsTable(HtmlControl container)
        {
            HtmlTable table = CreateTable(container);

            HtmlTableRow row;

            AddTableSectionHeader(table, Resources.IssuedIdentity, "((IClaimsPrincipal)Thread.CurrentPrincipal).Identities[0].Claims");
            AddColumnHeadersToTable(table, new[] { Resources.ClaimTypeColumnHeader, Resources.ClaimValueColumnHeader, Resources.ClaimIssuerColumnHeader, Resources.ClaimOriginalIssuerColumnHeader });

            IClaimsPrincipal principal = (IClaimsPrincipal)Thread.CurrentPrincipal;
            foreach (Claim claim in principal.Identities[0].Claims)
            {
                row = new HtmlTableRow();

                row.Cells.Add(new HtmlTableCell { InnerText = claim.ClaimType });
                row.Cells.Add(new HtmlTableCell { InnerText = claim.Value });
                row.Cells.Add(new HtmlTableCell { InnerText = claim.Issuer });
                row.Cells.Add(new HtmlTableCell { InnerText = claim.OriginalIssuer });

                table.Rows.Add(row);
            }

            if (principal.Identities[0].Delegate != null)
            {
                AddTableSectionHeader(table, Resources.DelegatedIdentity, "((IClaimsPrincipal)Thread.CurrentPrincipal).Identities[0].Delegate.Claims");
                AddColumnHeadersToTable(table, new[] { Resources.ClaimTypeColumnHeader, Resources.ClaimValueColumnHeader, Resources.ClaimIssuerColumnHeader, Resources.ClaimOriginalIssuerColumnHeader });

                foreach (Claim delegatedClaim in principal.Identities[0].Delegate.Claims)
                {
                    row = new HtmlTableRow();

                    row.Cells.Add(new HtmlTableCell { InnerText = delegatedClaim.ClaimType });
                    row.Cells.Add(new HtmlTableCell { InnerText = delegatedClaim.Value });
                    row.Cells.Add(new HtmlTableCell { InnerText = delegatedClaim.Issuer });
                    row.Cells.Add(new HtmlTableCell { InnerText = delegatedClaim.OriginalIssuer });

                    table.Rows.Add(row);
                }
            }
        }
Esempio n. 29
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail = (TextBox) this.FindControl("txtEmail");
     this.txtUserName = (TextBox) this.FindControl("txtUserName");
     this.txtContent = (TextBox) this.FindControl("txtContent");
     this.btnRefer = ButtonManager.Create(this.FindControl("btnRefer"));
     this.spReviewUserName = (HtmlControl) this.FindControl("spReviewUserName");
     this.spReviewPsw = (HtmlControl) this.FindControl("spReviewPsw");
     this.spReviewReg = (HtmlControl) this.FindControl("spReviewReg");
     this.txtReviewUserName = (HtmlInputText) this.FindControl("txtReviewUserName");
     this.txtReviewPsw = (HtmlInputText) this.FindControl("txtReviewPsw");
     this.txtReviewCode = (HtmlInputText) this.FindControl("txtReviewCode");
     this.productdetailLink = (ProductDetailsLink) this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click += new EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品评论", HiContext.Current.Context);
         if ((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling))
         {
             this.txtUserName.Text = HiContext.Current.User.Username;
             this.txtEmail.Text = HiContext.Current.User.Email;
             this.txtReviewUserName.Value = string.Empty;
             this.txtReviewPsw.Value = string.Empty;
             this.spReviewUserName.Visible = false;
             this.spReviewPsw.Visible = false;
             this.spReviewReg.Visible = false;
             this.btnRefer.Text = "评论";
         }
         else
         {
             this.spReviewUserName.Visible = true;
             this.spReviewPsw.Visible = true;
             this.spReviewReg.Visible = true;
             this.btnRefer.Text = "登录并评论";
         }
         this.txtReviewCode.Value = string.Empty;
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.productdetailLink.ProductId = this.productId;
             this.productdetailLink.ProductName = productSimpleInfo.ProductName;
         }
     }
 }
Esempio n. 30
0
 /// <summary>
 /// 添加属性
 /// </summary>
 /// <param name="Control">HtmlGenericControl</param>
 /// <param name="eventStr">名称</param>
 /// <param name="MsgStr">内容</param>
 public static void AddAttr(System.Web.UI.HtmlControls.HtmlControl Control, string eventStr, string MsgStr)
 {
     Control.Attributes.Add(eventStr, MsgStr);
 }
    protected void FillGrdConditionView(Patient patient = null)
    {
        if (patient == null)
        {
            patient = PatientDB.GetByID(GetFormPatientID());
        }

        DataTable dt            = ConditionDB.GetDataTable(false);
        Hashtable conditionHash = ConditionDB.GetHashtable(false);

        Session["patientconditionview_data"] = dt;

        if (dt.Rows.Count > 0)
        {
            GrdConditionView.DataSource = dt;
            try
            {
                GrdConditionView.DataBind();

                Hashtable selectedConditions = PatientConditionDB.GetHashtable_ByPatientID(patient.PatientID, false);

                for (int i = GrdConditionView.Rows.Count - 1; i >= 0; i--)
                {
                    Label lblId = GrdConditionView.Rows[i].FindControl("lblId") as Label;

                    Label lblDate = GrdConditionView.Rows[i].FindControl("lblDate") as Label;

                    Label lblNextDue = GrdConditionView.Rows[i].FindControl("lblNextDue") as Label;
                    Label lblDateDue = GrdConditionView.Rows[i].FindControl("lblDateDue") as Label;

                    Label lblAdditionalInfo = GrdConditionView.Rows[i].FindControl("lblAdditionalInfo") as Label;
                    Label lblText           = GrdConditionView.Rows[i].FindControl("lblText") as Label;

                    System.Web.UI.HtmlControls.HtmlControl br_date      = (System.Web.UI.HtmlControls.HtmlControl)GrdConditionView.Rows[i].FindControl("br_date");
                    System.Web.UI.HtmlControls.HtmlControl br_nweeksdue = (System.Web.UI.HtmlControls.HtmlControl)GrdConditionView.Rows[i].FindControl("br_nweeksdue");
                    System.Web.UI.HtmlControls.HtmlControl br_text      = (System.Web.UI.HtmlControls.HtmlControl)GrdConditionView.Rows[i].FindControl("br_text");


                    if (lblId == null)
                    {
                        continue;
                    }

                    Condition condition = (Condition)conditionHash[Convert.ToInt32(lblId.Text)];

                    br_date.Visible           = condition.ShowDate;
                    lblDate.Visible           = condition.ShowDate;
                    br_nweeksdue.Visible      = condition.ShowNWeeksDue;
                    lblNextDue.Visible        = condition.ShowNWeeksDue;
                    lblDateDue.Visible        = condition.ShowNWeeksDue;
                    br_text.Visible           = condition.ShowText;
                    lblText.Visible           = condition.ShowText;
                    lblAdditionalInfo.Visible = condition.ShowText;


                    if (selectedConditions[Convert.ToInt32(lblId.Text)] != null)
                    {
                        PatientCondition ptCondition = (PatientCondition)selectedConditions[Convert.ToInt32(lblId.Text)];

                        if (condition.ShowDate)
                        {
                            lblDate.Text = ptCondition.Date == DateTime.MinValue ? "[Date Not Set]" : ptCondition.Date.ToString("d MMM, yyyy");
                        }
                        if (condition.ShowNWeeksDue)
                        {
                            bool expired = ptCondition.Date != DateTime.MinValue && ptCondition.Date.AddDays(7 * ptCondition.NWeeksDue) < DateTime.Today;
                            lblDateDue.Text = ptCondition.Date == DateTime.MinValue ? "[Date Not Set]" : (expired ? "<font color=\"red\">" : "") + ptCondition.Date.AddDays(7 * ptCondition.NWeeksDue).ToString("d MMM, yyyy") + (expired ? "</font>" : "");
                        }
                        if (condition.ShowText)
                        {
                            lblText.Text = ptCondition.Text.Length == 0 ? "[Blank]" : ptCondition.Text;
                        }
                    }
                    else
                    {
                        GrdConditionView.Rows[i].Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                SetErrorMessage("", ex.ToString());
            }

            //Sort("parent_descr", "ASC");
        }
        else
        {
            dt.Rows.Add(dt.NewRow());
            GrdConditionView.DataSource = dt;
            GrdConditionView.DataBind();

            int TotalColumns = GrdConditionView.Rows[0].Cells.Count;
            GrdConditionView.Rows[0].Cells.Clear();
            GrdConditionView.Rows[0].Cells.Add(new TableCell());
            GrdConditionView.Rows[0].Cells[0].ColumnSpan = TotalColumns;
            GrdConditionView.Rows[0].Cells[0].Text       = "No Record Found";
        }
    }
 void HideElement(HtmlControl element)
 {
     element.Style["display"] = "none";
     element.Style["visibility"] = "hidden";
 }
Esempio n. 33
0
 private HtmlControl CreateCollapsableHeader(string collapsableTitle, HtmlControl collapsableElement, bool expandedAsDefault)
 {
     return this.CreateCollapsableHeader(
         new HtmlGenericControl("span") { InnerText = collapsableTitle },
         collapsableElement,
         expandedAsDefault);
 }
Esempio n. 34
0
/// <summary>
/// Sets focus to a html control after page load
/// </summary>
/// <param name="control">control client id</param>
    public void DefaultFocus(System.Web.UI.HtmlControls.HtmlControl control)
    {
        this.DefaultFocus(control.ClientID, control.ClientID);
    }
Esempio n. 35
0
        private HtmlControl CreateCollapsableHeader(Control title, HtmlControl collapsableElement, bool expandedAsDefault)
        {
            ClientScriptManager clientScriptManager = this.Page.ClientScript;
            Type tokenVisualizerControlType = this.GetType();

            string iconImageId = string.Format(CultureInfo.InvariantCulture, "{0}_image", collapsableElement.ID);

            string onClickJavascriptHandler = string.Format(
                CultureInfo.InvariantCulture,
                "toggleVisualizerVisibility('{0}','{1}','{2}','{3}')",
                collapsableElement.ID,
                iconImageId,
                clientScriptManager.GetWebResourceUrl(tokenVisualizerControlType, "Microsoft.Samples.DPE.Identity.Controls.Content.images.CollapseIcon.bmp"),
                clientScriptManager.GetWebResourceUrl(tokenVisualizerControlType, "Microsoft.Samples.DPE.Identity.Controls.Content.images.ExpandIcon.bmp"));

            HtmlImage iconImage = new HtmlImage()
                                      {
                                          ID = iconImageId,
                                      };
            if (expandedAsDefault)
            {
                iconImage.Src = clientScriptManager.GetWebResourceUrl(tokenVisualizerControlType, "Microsoft.Samples.DPE.Identity.Controls.Content.images.CollapseIcon.bmp");
                collapsableElement.Style["display"] = "block";
            }
            else
            {
                iconImage.Src = clientScriptManager.GetWebResourceUrl(tokenVisualizerControlType, "Microsoft.Samples.DPE.Identity.Controls.Content.images.ExpandIcon.bmp");
                collapsableElement.Style["display"] = "none";
            }

            iconImage.Attributes["class"] = "TokenVisualizerImage";

            HtmlGenericControl collapsableDiv = new HtmlGenericControl("div");
            collapsableDiv.Controls.Add(iconImage);
            collapsableDiv.Controls.Add(title);

            collapsableDiv.Attributes["onclick"] = onClickJavascriptHandler;
            collapsableDiv.Attributes["class"] = "TokenVisualizerTitle";

            return collapsableDiv;
        }
Esempio n. 36
0
        private static void AdjustClimbUp(string part, Control control, HtmlControl clone)
        {
            Control parent = control;
            int climbs = part.Count(a => a == '^');

            for (int i = 0; i <= climbs; i++)
            {
                if (parent.Parent == null)
                    break;

                parent = parent.Parent;
            }

            parent.Controls.Add(clone);
        }
Esempio n. 37
0
        private void AddAttributes(HtmlControl element, string attribute, int count)
        {
            int start = attribute.IndexOf('[');
            int end = attribute.IndexOf(']');

            if (start > -1 && end > start)
            {
                string content = attribute.Substring(start + 1, end - start - 1);
                List<string> parts = content.Trim().Split(' ').ToList();

                for (int i = parts.Count - 1; i > 0; i--)
                {
                    string part = parts[i];
                    int singleCount = part.Count(c => c == '\'');
                    int doubleCount = part.Count(c => c == '"');

                    if (((singleCount > 1 || doubleCount > 1) && !part.Contains("=")) ||
                        ((doubleCount == 1) && part.EndsWith("\"")) ||
                        ((singleCount == 1) && part.EndsWith("'")))
                    {
                        parts[i - 1] += " " + part;
                        parts.RemoveAt(i);
                    }
                }

                foreach (string part in parts)
                {
                    string[] sides = part.Split('=');

                    if (sides.Length == 1)
                    {
                        element.Attributes[sides[0]] = string.Empty;
                    }
                    else
                    {
                        sides[1] = sides[1].Trim();
                        char firstChar = sides[1][0];
                        char lastChar = sides[1][sides[1].Length - 1];
                        if ((firstChar == '\'' || firstChar == '"') && firstChar == lastChar)
                        {
                            element.Attributes[sides[0]] = sides[1].Substring(1, sides[1].Length - 2);
                        }
                        else
                        {
                            element.Attributes[sides[0]] = sides[1];
                        }
                    }
                }
            }
        }
Esempio n. 38
0
        private void SetCssClass(HtmlControl control, bool isSelected)
        {
            if (control == null)
            {
                return;
            }

            if (!isSelected && !string.IsNullOrEmpty(CssClass))
            {
                control.Attributes["class"] = this.CssClass;
            }

            if (isSelected && !string.IsNullOrEmpty(SelectedCssClass))
            {
                control.Attributes["class"] = this.SelectedCssClass;
            }
        }
Esempio n. 39
0
        private void AddClass(HtmlControl element, string className, int count)
        {
            string current = element.Attributes["class"];
            string clean = className.TrimStart(_attr);
            int index = clean.IndexOf('*');

            if (index > 0)
            {
                clean = clean.Substring(0, index);
            }

            element.Attributes["class"] = string.IsNullOrEmpty(current) ? clean : current += " " + clean;
            element.Attributes["class"] = element.Attributes["class"];
        }
Esempio n. 40
0
        protected override void AttachChildControls()
        {
            this.Vaid = Globals.RequestQueryStr("vaid");
            if (string.IsNullOrEmpty(this.Vaid))
            {
                base.GotoResourceNotFound("");
            }
            OneyuanTaoInfo oneyuanTaoInfoById = OneyuanTaoHelp.GetOneyuanTaoInfoById(this.Vaid);

            if (oneyuanTaoInfoById == null)
            {
                base.GotoResourceNotFound("");
            }
            this.productId = oneyuanTaoInfoById.ProductId;
            ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);

            if (product == null)
            {
                base.GotoResourceNotFound("");
            }
            OneTaoState oneTaoState = OneyuanTaoHelp.getOneTaoState(oneyuanTaoInfoById);

            this.rptProductImages      = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litItemParams         = (System.Web.UI.WebControls.Literal) this.FindControl("litItemParams");
            this.litProdcutName        = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litProdcutTag         = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutTag");
            this.litSalePrice          = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litMarketPrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litMarketPrice");
            this.litShortDescription   = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litDescription        = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litStock              = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
            this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
            this.litActivityId         = (System.Web.UI.WebControls.Literal) this.FindControl("litActivityId");
            this.litState              = (System.Web.UI.WebControls.Literal) this.FindControl("litState");
            this.PrizeTime             = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("PrizeTime");
            this.buyNum           = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("buyNum");
            this.SaveBtn          = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("SaveBtn");
            this.ViewtReview      = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("ViewtReview");
            this.litMaxtxt        = (System.Web.UI.WebControls.Literal) this.FindControl("litMaxtxt");
            this.expandAttr       = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.skuSelector      = (Common_SKUSelector)this.FindControl("skuSelector");
            this.NomachMember     = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("NomachMember");
            this.litMinNum        = (System.Web.UI.WebControls.Literal) this.FindControl("litMinNum");
            this.litPrizeNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litPrizeNum");
            this.litFinished      = (System.Web.UI.WebControls.Literal) this.FindControl("litFinished");
            this.Prizeprogress    = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("Prizeprogress");
            this.litBuytxt        = (System.Web.UI.WebControls.Literal) this.FindControl("litBuytxt");
            this.litPrizeNum.Text = oneyuanTaoInfoById.ReachNum.ToString();
            this.litFinished.Text = oneyuanTaoInfoById.FinishedNum.ToString();
            int num = oneyuanTaoInfoById.ReachNum - oneyuanTaoInfoById.FinishedNum;

            if (num < 0)
            {
                num = 0;
            }
            this.litMinNum.Text = num.ToString();
            float num2 = (float)(100 * oneyuanTaoInfoById.FinishedNum / oneyuanTaoInfoById.ReachNum);

            this.Prizeprogress.Attributes.Add("style", "width:" + num2.ToString("F0") + "%");
            this.ViewtReview.Attributes.Add("href", "ProductReview.aspx?ProductId=" + oneyuanTaoInfoById.ProductId.ToString());
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            this.skuSelector.ProductId = this.productId;
            if (product != null)
            {
                if (this.rptProductImages != null)
                {
                    string       locationUrl = "javascript:;";
                    SlideImage[] source      = new SlideImage[]
                    {
                        new SlideImage(product.ImageUrl1, locationUrl),
                        new SlideImage(product.ImageUrl2, locationUrl),
                        new SlideImage(product.ImageUrl3, locationUrl),
                        new SlideImage(product.ImageUrl4, locationUrl),
                        new SlideImage(product.ImageUrl5, locationUrl)
                    };
                    this.rptProductImages.DataSource = from item in source
                                                       where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                       select item;
                    this.rptProductImages.DataBind();
                }
                this.litShortDescription.Text = product.ShortDescription;
            }
            int num3 = OneyuanTaoHelp.MermberCanbuyNum(oneyuanTaoInfoById.ActivityId, Globals.GetCurrentMemberUserId());

            this.buyNum.Attributes.Add("max", num3.ToString());
            this.litBuytxt.Text = string.Concat(new object[]
            {
                "限购",
                oneyuanTaoInfoById.EachCanBuyNum,
                "份,每份价格¥",
                oneyuanTaoInfoById.EachPrice.ToString("F2")
            });
            this.litMaxtxt.Text = "您已订购<di>" + (oneyuanTaoInfoById.EachCanBuyNum - num3).ToString() + "</di>份";
            if (num3 == 0 || oneTaoState != OneTaoState.进行中 || !MemberHelper.CheckCurrentMemberIsInRange(oneyuanTaoInfoById.FitMember, oneyuanTaoInfoById.DefualtGroup, oneyuanTaoInfoById.CustomGroup, this.CurrentMemberInfo.UserId))
            {
                this.buyNum.Attributes.Add("disabled", "disabled");
                this.SaveBtn.Visible = false;
            }
            string text;

            if (oneyuanTaoInfoById.FitMember == "0" || oneyuanTaoInfoById.CustomGroup == "0")
            {
                text = "全部会员";
            }
            else
            {
                text = "部分会员";
            }
            text = "适用会员:" + text;
            if (oneyuanTaoInfoById.FitMember != "0" && !MemberHelper.CheckCurrentMemberIsInRange(oneyuanTaoInfoById.FitMember, oneyuanTaoInfoById.DefualtGroup, oneyuanTaoInfoById.CustomGroup, this.CurrentMemberInfo.UserId))
            {
                text = "会员等级不符合活动要求";
                this.NomachMember.Attributes.Add("CanBuy", "false");
            }
            this.NomachMember.InnerHtml = text;
            string productName = product.ProductName;
            string text2       = product.Description;

            if (!string.IsNullOrEmpty(text2))
            {
                text2 = System.Text.RegularExpressions.Regex.Replace(text2, "<img[^>]*\\bsrc=('|\")([^'\">]*)\\1[^>]*>", "<img alt='" + System.Web.HttpContext.Current.Server.HtmlEncode(productName) + "' src='$2' />", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            }
            if (this.litDescription != null)
            {
                this.litDescription.Text = text2;
            }
            this.litProdcutName.Text = productName;
            this.litSalePrice.Text   = product.MinSalePrice.ToString("F2");
            this.litActivityId.Text  = oneyuanTaoInfoById.ActivityId;
            if (oneyuanTaoInfoById.ReachType == 1)
            {
                this.litActivityId.Text = "活动结束前满足总需份数,自动开出" + oneyuanTaoInfoById.PrizeNumber + "个奖品";
            }
            else if (oneyuanTaoInfoById.ReachType == 2)
            {
                this.litActivityId.Text = "活动到期自动开出" + oneyuanTaoInfoById.PrizeNumber + "个奖品";
            }
            else if (oneyuanTaoInfoById.ReachType == 3)
            {
                this.litActivityId.Text = "到开奖时间并满足总需份数,自动开出" + oneyuanTaoInfoById.PrizeNumber + "个奖品";
            }
            this.PrizeTime.Attributes.Add("PrizeTime", oneyuanTaoInfoById.EndTime.ToString("G"));
            this.litState.Text = oneTaoState.ToString();
            if (oneTaoState == OneTaoState.已开奖)
            {
                IsoDateTimeConverter isoDateTimeConverter = new IsoDateTimeConverter();
                isoDateTimeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                System.Web.UI.WebControls.Literal           literal            = (System.Web.UI.WebControls.Literal) this.FindControl("LitDataJson");
                System.Collections.Generic.IList <LuckInfo> winnerLuckInfoList = OneyuanTaoHelp.getWinnerLuckInfoList(oneyuanTaoInfoById.ActivityId, "");
                if (winnerLuckInfoList != null)
                {
                    literal.Text = "var LitDataJson=" + JsonConvert.SerializeObject(winnerLuckInfoList, new JsonConverter[]
                    {
                        isoDateTimeConverter
                    });
                }
                else
                {
                    literal.Text = "var LitDataJson=null";
                }
            }
            System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal) this.FindControl("litJs");
            string title       = oneyuanTaoInfoById.Title;
            string activityDec = oneyuanTaoInfoById.ActivityDec;

            System.Uri url   = this.Context.Request.Url;
            string     text3 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
            string     text4 = oneyuanTaoInfoById.ProductImg;

            if (text4 == "/utility/pics/none.gif")
            {
                text4 = oneyuanTaoInfoById.HeadImgage;
            }
            literal2.Text = string.Concat(new string[]
            {
                "<script>wxinshare_title=\"",
                this.Context.Server.HtmlEncode(title.Replace("\n", " ").Replace("\r", "")),
                "\";wxinshare_desc=\"",
                this.Context.Server.HtmlEncode(activityDec.Replace("\n", " ").Replace("\r", "")),
                "\";wxinshare_link=location.href;wxinshare_imgurl=\"",
                text3,
                text4,
                "\"</script>"
            });
            PageTitle.AddSiteNameTitle("一元夺宝商品详情");
        }
Esempio n. 41
0
        private void AddId(HtmlControl element, string part, int count)
        {
            int index = part.IndexOf('*');
            string clean = part;

            if (index > 0)
            {
                clean = clean.Substring(0, index);
            }

            element.ID = clean.TrimStart(_attr);
        }
Esempio n. 42
0
		public static void AddOnClickJavascriptConfirmationForPostbackControl(HtmlControl control)
		{
			Utilities.AddOnClickJavascriptConfirmationForPostbackControl(control, "Are you sure?");
		}
Esempio n. 43
0
        private void AddInnerText(HtmlControl element, string subPart, int i)
        {
            string clean = subPart.Substring(1, subPart.IndexOf('}') - 1);

            LiteralControl lit = new LiteralControl(clean);
            element.Controls.Add(lit);
        }
Esempio n. 44
0
 /// <summary>
 /// Sets the focus to a System.Web.UI.HtmlControls 
 /// </summary>
 /// <param name="htmlControl">The control that focus will be set to</param>
 public static void setFocus(HtmlControl control)
 {
     setFocus(control.Page, control.ID);
 }
Esempio n. 45
0
        private void AplicarSeguridad(object sender, EventArgs e)
        {
            // Puede valdar por tarea o por nombre de página
            if (!String.IsNullOrEmpty(IDTarea) || DebeValidarse)
            {
                //Verifica los ID de tareas que posee el usuario para cada item de menu (IsInRole te devuelve un bool).
                EntidadesEmpresariales.PadreCipolCliente objCipol = (EntidadesEmpresariales.PadreCipolCliente)ManejoSesion.DatosCIPOLSesion.DatosPadreCIPOLCliente;
                int intIDTarea = 0;


                if (!this.IsPostBack)
                {
                    if (objCipol != null)
                    {
                        //usuario master
                        if (objCipol.IDUsuario.Equals(0))
                        {
                            return;
                        }
                        //Controla si debe validarse por nombre de página
                        if (DebeValidarse)
                        {
                            objCipol.PermiteRequest(NombrePagina);
                        }

                        if (IDTarea != "0")
                        {
                            try
                            {
                                intIDTarea = Convert.ToInt32(IDTarea);
                                if (!objCipol.IsInRole(intIDTarea.ToString()))
                                {
                                    Response.Redirect("frmNoDisponeDePermiso.aspx");
                                }
                            }
                            catch (Exception) //Si el IDTarea es no numérico, tira excepción el método IsInRole().
                            {
                                Response.Redirect("frmNoDisponeDePermiso.aspx");
                            }
                        }
                        else
                        {
                            Response.Redirect("frmNoDisponeDePermiso.aspx");
                        }

                        string strEvento         = "";
                        int    IdTareaSupervisor = intIDTarea;

                        if (objCipol.RequiereSupervision(NombrePagina, ref IdTareaSupervisor))
                        {
                            System.Web.UI.HtmlControls.HtmlControl objHTML = (System.Web.UI.HtmlControls.HtmlControl) this.Master.FindControl("cuerpo");
                            if (objHTML == null)
                            {
                                throw new Exception("No existe el tag <Body> como control de servidor en la página" + NombrePagina);
                            }
                            else
                            {
                                objHTML.Attributes["onload"] = "appCIPOLPRESENTACION.SupervisarModal('" + strEvento + "');";
                            }
                            Session["IDTareaSupervisar"] = IdTareaSupervisor;
                        }
                    }
                    //Ver si se debe hacer algo en este caso.
                }
            }
            //Ver si se debe hacer algo en este caso.
        }
Esempio n. 46
0
        private void AddSamlTokenTable(HtmlControl container)
        {
            HtmlTable table = CreateTable(container);
            var tokenVisualizer = TokenVisualizerFactory.GetTokenVisualizer(
                ((IClaimsPrincipal)Thread.CurrentPrincipal).GetBootstrapTokens().First());

            AddTableSectionHeader(table, Resources.SamlToken, string.Empty);

            string tokenTextAreaId = string.Format(CultureInfo.InvariantCulture, "{0}_samlToken", this.ID);

            HtmlTextArea tokenTextArea = new HtmlTextArea() { ID = tokenTextAreaId, InnerText = tokenVisualizer.SecurityTokenString };
            tokenTextArea.Attributes["class"] = "SAMLToken";
            tokenTextArea.Attributes["readonly"] = "true";

            HtmlControl samlTokenHeader = this.CreateCollapsableHeader(Resources.RawSamlToken, tokenTextArea, false /* Expanded as Default */);

            HtmlTableRow row = new HtmlTableRow();
            HtmlTableCell tokenCell = new HtmlTableCell { ColSpan = TableColumnsQuantity };
            tokenCell.Controls.Add(samlTokenHeader);
            tokenCell.Controls.Add(tokenTextArea);
            row.Cells.Add(tokenCell);
            table.Rows.Add(row);

            AddColumnHeadersToTable(table, new[] { Resources.TokenPropertyName, Resources.TokenPropertyValue });

            foreach (var entry in tokenVisualizer.RetrieveTokenProperties())
            {
                AddTokenProperty(table, entry.Key, entry.Value);
            }
        }
    protected void FillGrdCondition(Patient patient = null)
    {
        if (patient == null)
        {
            patient = PatientDB.GetByID(GetFormPatientID());
        }

        DataTable dt            = ConditionDB.GetDataTable(false);
        Hashtable conditionHash = ConditionDB.GetHashtable(false);

        Session["patientcondition_data"] = dt;

        if (dt.Rows.Count > 0)
        {
            GrdCondition.DataSource = dt;
            try
            {
                GrdCondition.DataBind();

                Hashtable selectedConditions = PatientConditionDB.GetHashtable_ByPatientID(patient.PatientID, false);
                foreach (GridViewRow row in GrdCondition.Rows)
                {
                    Label        lblId          = row.FindControl("lblId") as Label;
                    CheckBox     chkSelect      = row.FindControl("chkSelect") as CheckBox;
                    DropDownList ddlDate_Day    = (DropDownList)row.FindControl("ddlDate_Day");
                    DropDownList ddlDate_Month  = (DropDownList)row.FindControl("ddlDate_Month");
                    DropDownList ddlDate_Year   = (DropDownList)row.FindControl("ddlDate_Year");
                    DropDownList ddlNbrWeeksDue = (DropDownList)row.FindControl("ddlNbrWeeksDue");

                    Label lblNextDue        = row.FindControl("lblNextDue") as Label;
                    Label lblWeeksLater     = row.FindControl("lblWeeksLater") as Label;
                    Label lblAdditionalInfo = row.FindControl("lblAdditionalInfo") as Label;


                    System.Web.UI.HtmlControls.HtmlControl br_date      = (System.Web.UI.HtmlControls.HtmlControl)row.FindControl("br_date");
                    System.Web.UI.HtmlControls.HtmlControl br_nweeksdue = (System.Web.UI.HtmlControls.HtmlControl)row.FindControl("br_nweeksdue");
                    System.Web.UI.HtmlControls.HtmlControl br_text      = (System.Web.UI.HtmlControls.HtmlControl)row.FindControl("br_text");

                    TextBox txtText = (TextBox)row.FindControl("txtText");

                    if (lblId == null || chkSelect == null)
                    {
                        continue;
                    }

                    Condition condition = (Condition)conditionHash[Convert.ToInt32(lblId.Text)];

                    br_date.Visible           = condition.ShowDate;
                    ddlDate_Day.Visible       = condition.ShowDate;
                    ddlDate_Month.Visible     = condition.ShowDate;
                    ddlDate_Year.Visible      = condition.ShowDate;
                    br_nweeksdue.Visible      = condition.ShowNWeeksDue;
                    ddlNbrWeeksDue.Visible    = condition.ShowNWeeksDue;
                    lblNextDue.Visible        = condition.ShowNWeeksDue;
                    lblWeeksLater.Visible     = condition.ShowNWeeksDue;
                    br_text.Visible           = condition.ShowText;
                    txtText.Visible           = condition.ShowText;
                    lblAdditionalInfo.Visible = condition.ShowText;


                    if (selectedConditions[Convert.ToInt32(lblId.Text)] != null)
                    {
                        PatientCondition ptCondition = (PatientCondition)selectedConditions[Convert.ToInt32(lblId.Text)];

                        chkSelect.Checked = selectedConditions[Convert.ToInt32(lblId.Text)] != null;

                        if (condition.ShowDate)
                        {
                            if (ptCondition.Date != DateTime.MinValue)
                            {
                                ddlDate_Day.SelectedValue   = ptCondition.Date.Day.ToString();
                                ddlDate_Month.SelectedValue = ptCondition.Date.Month.ToString();
                                ddlDate_Year.SelectedValue  = ptCondition.Date.Year.ToString();
                            }
                        }
                        if (condition.ShowNWeeksDue)
                        {
                            ddlNbrWeeksDue.SelectedValue = ptCondition.NWeeksDue.ToString();
                        }
                        if (condition.ShowText)
                        {
                            txtText.Text = ptCondition.Text;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SetErrorMessage("", ex.ToString());
            }

            //Sort("parent_descr", "ASC");
        }
        else
        {
            dt.Rows.Add(dt.NewRow());
            GrdCondition.DataSource = dt;
            GrdCondition.DataBind();

            int TotalColumns = GrdCondition.Rows[0].Cells.Count;
            GrdCondition.Rows[0].Cells.Clear();
            GrdCondition.Rows[0].Cells.Add(new TableCell());
            GrdCondition.Rows[0].Cells[0].ColumnSpan = TotalColumns;
            GrdCondition.Rows[0].Cells[0].Text       = "No Record Found";
        }
    }