private void CheckPermission(System.Web.UI.HtmlControls.HtmlContainerControl obj, string code) { if (!Function.ChechMenuPermission(code)) { obj.Style.Add("display", "none"); } }
/////////////////////////////////////////////////////////////////////// public static bool custom_validations_sample( DataRow bug, // null if a new bug, otherwise the state of the bug now in the db IIdentity identity, // the currently logged in user Page page, HtmlContainerControl custom_validation_err_msg) { // Just a stupid example. Show that we can cross-validate between // a couple different fields. DropDownList category = (DropDownList) find_control(page.Controls, "category"); DropDownList priority = (DropDownList) find_control(page.Controls, "priority"); if (category.SelectedItem.Text == "question" && priority.SelectedItem.Text == "high") { custom_validation_err_msg.InnerHtml = "Questions cannot be high priority<br>"; return false; } else { custom_validation_err_msg.InnerHtml = ""; return true; } }
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("修改用户信息"); }
/// ----------------------------------------------------------------------------- /// <summary> /// Constructs a new Pane object from the Control in the Skin /// </summary> /// <param name="pane">The HtmlContainerControl in the Skin.</param> /// <history> /// [cnurse] 12/04/2007 created /// </history> /// ----------------------------------------------------------------------------- public Pane(HtmlContainerControl pane) { PaneControl = pane; //Disable ViewState (we enable it later in the process) PaneControl.ViewStateMode = ViewStateMode.Disabled; Name = pane.ID; }
protected void rptCommentForeList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView view = e.Item.DataItem as DataRowView;//定义一个DataRowView的实例 int id = Convert.ToInt32(view["id"]); this.lbInfoTitle.Text = view["title"].ToString(); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; Label lb = new Label(); LinkButton btn = new LinkButton(); msg = msgBll.GetComment(id, 0); if (msg != null) { //if (msg.IsResponse == 1) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = ""; strWhere = "fatherId=" + id + ""; long i = 0; long j = 0; long k = 0; DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); System.Web.UI.HtmlControls.HtmlContainerControl divOnline = (HtmlContainerControl)e.Item.FindControl("aReply"); if (dt != null && dt.Rows.Count > 0) { result = dt.Rows[0][0].ToString(); if (divOnline != null) { divOnline.Style.Add("display", "none"); } btn = (LinkButton)e.Item.FindControl("btnRes"); lb = (Label)e.Item.FindControl("ResView"); lb.Text = result; } else { if (divOnline != null) { divOnline.Style.Add("display", "block"); } } } } if (view["infoOwner"].ToString().Trim() != Page.User.Identity.Name) { System.Web.UI.HtmlControls.HtmlGenericControl divRes = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("aReply"); divRes.Style.Add("display", "none"); } }
public static void AppendAttribute(this System.Web.UI.HtmlControls.HtmlContainerControl cont, string name, string value) { string a = cont.Attributes[name]; if (string.IsNullOrEmpty(a)) { cont.Attributes.Add(name, value); } else { cont.Attributes[name] += " " + value; } }
/////////////////////////////////////////////////////////////////////// public static bool custom_validations( DataRow bug, // null if a new bug, otherwise the state of the bug now in the db IIdentity identity, // the currently logged in user Page page, HtmlContainerControl custom_validation_err_msg) { // This method will be called during validation. // You'll get some updated fielsd in DataRow bug, but not all. // You might also want to customize edit_bug.aspx. // See the "Note about customizing workflow" in edit_bug.aspx // for the place to make the DataRow more accurate. // Uncomment the next line to play with the sample code. //return custom_validations_sample(bug, user, page, custom_validation_err_msg); return true; }
protected override void CreateChildControls() { if(Content != null) { _container = new JuiceTemplateContainer(); Content.InstantiateIn(_container); Controls.Add(_container); } if(Items.Count > 0) { _subMenu = new HtmlGenericControl("ul"); foreach(var item in Items) { _subMenu.Controls.Add(item); } this.Controls.Add(_subMenu); } }
//protected void txtqty_TextChanged(object sender, EventArgs e) //{ // foreach (RepeaterItem i in rptdata.Items) // { // TextBox txtqty = (TextBox)i.FindControl("txtqty"); // HiddenField hdnstock = (HiddenField)i.FindControl("hdnstock"); // decimal stock = Convert.ToDecimal(hdnstock.Value); // if (txtqty.Text != "") // { // if ((Convert.ToDecimal(txtqty.Text) <= 0)) // { // string str = string.Empty; // str = "<script language='javascript'>"; // str = str + " var res=alert('Please Enter Valid Quantity.');"; // str = str + "if(res==true){ window.close();"; // str = str + "}"; // str = str + "else{ window.close();"; // str = str + "}"; // str = str + "</script>"; // if (ClientScript.IsClientScriptBlockRegistered("messagebox") == false) // { // ClientScript.RegisterStartupScript(GetType(), "messagebox", str); // } // } // else if((Convert.ToDecimal(txtqty.Text)>stock)) // { // string str = string.Empty; // str = "<script language='javascript'>"; // str = str + " var res=alert('Minimum value.');"; // str = str + "if(res==true){ window.close();"; // str = str + "}"; // str = str + "else{ window.close();"; // str = str + "}"; // str = str + "</script>"; // if (ClientScript.IsClientScriptBlockRegistered("messagebox") == false) // { // ClientScript.RegisterStartupScript(GetType(), "messagebox", str); // } // } // else // { // } // } // else // { // string str = string.Empty; // str = "<script language='javascript'>"; // str = str + " var res=alert('Please Enter Valid Quantity.');"; // str = str + "if(res==true){ window.close();"; // str = str + "}"; // str = str + "else{ window.close();"; // str = str + "}"; // str = str + "</script>"; // if (ClientScript.IsClientScriptBlockRegistered("messagebox") == false) // { // ClientScript.RegisterStartupScript(GetType(), "messagebox", str); // } // } // } // //if (txtqty.Text != null) // //{ // //} //} protected void rptdata_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Show or hid div here System.Web.UI.HtmlControls.HtmlContainerControl Stockdetail = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("stock"); System.Web.UI.HtmlControls.HtmlContainerControl Cartdetail = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("cart"); System.Web.UI.HtmlControls.HtmlContainerControl PriceDetail = (System.Web.UI.HtmlControls.HtmlContainerControl)e.Item.FindControl("price"); if (Session["userID"] != null) { Stockdetail.Visible = true; Cartdetail.Visible = true; PriceDetail.Visible = true; } else { Stockdetail.Visible = false; Cartdetail.Visible = false; PriceDetail.Visible = false; } } }
/// ----------------------------------------------------------------------------- /// <summary> /// Constructs a new Pane object from the Control in the Skin /// </summary> /// <param name="pane">The HtmlContainerControl in the Skin.</param> /// <history> /// [cnurse] 12/04/2007 created /// </history> /// ----------------------------------------------------------------------------- public Pane(HtmlContainerControl pane) { PaneControl = pane; Name = pane.ID; }
/// <summary> /// Preloads the images (caching purposes only) into a container on the page; optional. /// </summary> /// <param name="container">Container object to use.</param> public void PreLoadImages(HtmlContainerControl container) { // Create JavaScript StringBuilder buildString = new StringBuilder(); buildString.Append("<script type=\"text/javascript\">\r\n//<![CDATA[\r\n"); buildString.Append("\tvar " + _variableName + " = new Array();\r\n"); buildString.Append(GenerateCacheCode(container)); buildString.Append("//]]>\r\n</script>\r\n"); // Register Client Script if (container == null) { throw new ArgumentException("The H3Rollover container object is invalid."); } if (container.Parent.Page.Request.Browser.EcmaScriptVersion.Major >= 1) { container.InnerHtml += buildString.ToString(); } }
public Pane(string name, HtmlContainerControl pane) { _paneControl = pane; _name = name; }
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("一元夺宝商品详情"); }
public Pane(HtmlContainerControl pane) { _paneControl = pane; _name = pane.ID; }
protected override void AttachChildControls() { string text = Globals.RequestQueryStr("Pid"); if (string.IsNullOrEmpty(text)) { base.GotoResourceNotFound(""); } OneyuanTaoParticipantInfo addParticipant = OneyuanTaoHelp.GetAddParticipant(0, text, ""); if (addParticipant == null) { base.GotoResourceNotFound(""); } string activityId = addParticipant.ActivityId; OneyuanTaoInfo oneyuanTaoInfoById = OneyuanTaoHelp.GetOneyuanTaoInfoById(activityId); if (oneyuanTaoInfoById == null) { base.GotoResourceNotFound(""); } this.litProdcutName = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName"); this.litProdcutAttr = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutAttr"); this.litActivityID = (System.Web.UI.WebControls.Literal) this.FindControl("litActivityID"); this.litReachType = (System.Web.UI.WebControls.Literal) this.FindControl("litReachType"); this.litPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litPrice"); this.litBuyNum = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyNum"); this.litPayPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litPayPrice"); this.ProductImg = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("ProductImg"); this.PayWaytxt = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("PayWaytxt"); this.PayBtn = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("PayBtn"); this.litProdcutName.Text = oneyuanTaoInfoById.ProductTitle; this.litProdcutAttr.Text = addParticipant.SkuIdStr; this.litActivityID.Text = activityId; this.litReachType.Text = ""; this.litPrice.Text = oneyuanTaoInfoById.EachPrice.ToString("F2"); this.litBuyNum.Text = addParticipant.BuyNum.ToString(); this.litPayPrice.Text = addParticipant.TotalPrice.ToString("F2"); this.ProductImg.Src = oneyuanTaoInfoById.ProductImg; if (oneyuanTaoInfoById.ReachType == 1) { this.litReachType.Text = "满足参与人数自动开奖"; } else if (oneyuanTaoInfoById.ReachType == 2) { this.litReachType.Text = "活动到期自动开奖"; } else { this.litReachType.Text = "活动到期时且满足参与人数自动开奖"; } SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); string str = "商家尚未开启网上支付功能!"; this.PayBtn.Visible = false; if (!this.Page.Request.UserAgent.ToLower().Contains("micromessenger") && masterSettings.EnableAlipayRequest) { str = "支付宝手机支付"; this.PayBtn.Visible = true; } else if (masterSettings.EnableWeiXinRequest && this.Page.Request.UserAgent.ToLower().Contains("micromessenger")) { str = "微信支付"; this.PayBtn.Visible = true; } this.PayWaytxt.InnerText = "当前可用支付方式:" + str; this.PayWaytxt.Attributes.Add("Pid", text); PageTitle.AddSiteNameTitle("结算支付"); }
//------------------------------------------------------------------------ // Grid Layout Panel の子部品の属性を以下の Mode により属性を設定 // // Mode) 0:照会 1:訂正 //------------------------------------------------------------------------ public void Set_Attributes(System.Web.UI.HtmlControls.HtmlContainerControl divC, int Mode) { string strCss = ""; for (int i = 0; i < divC.Controls.Count; i++) { switch (divC.Controls[i].GetType().Name) { case "Label": if (((Label)divC.Controls[i]).CssClass != "fd_mtitle" && ((Label)divC.Controls[i]).CssClass != "fi_mtitle") { if (Mode == 1) { if (((Label)divC.Controls[i]).CssClass == "d_mtitle") { ((Label)divC.Controls[i]).CssClass = "i_mtitle"; } else if (((Label)divC.Controls[i]).CssClass == "d_mtitle_c") { ((Label)divC.Controls[i]).CssClass = "i_mtitle_c"; } } else { if (((Label)divC.Controls[i]).CssClass == "i_mtitle") { ((Label)divC.Controls[i]).CssClass = "d_mtitle"; } else if (((Label)divC.Controls[i]).CssClass == "i_mtitle_c") { ((Label)divC.Controls[i]).CssClass = "d_mtitle_c"; } } } break; case "TextBox": case "NumberBox": strCss = ((TextBox)divC.Controls[i]).CssClass; if (Mode == 1) { if (((TextBox)divC.Controls[i]).CssClass != "d_label") { ((TextBox)divC.Controls[i]).ReadOnly = false; } if (divC.Controls[i].GetType().Name == "NumberBox") { strCss = "text_input_right_key"; } else { switch (((TextBox)divC.Controls[i]).CssClass) { case "text_disp_right": strCss = "text_input_right"; break; case "text_disp_center": strCss = "text_input_center"; break; case "text_disp_left": strCss = "text_input_left"; break; case "text_disp_right_key": strCss = "text_input_right_key"; break; case "text_disp_center_key": strCss = "text_input_center_key"; break; case "text_disp_left_key": strCss = "text_input_left_key"; break; } } } else { ((TextBox)divC.Controls[i]).ReadOnly = true; if (divC.Controls[i].GetType().Name == "NumberBox") { strCss = "text_disp_right_key"; } else { switch (((TextBox)divC.Controls[i]).CssClass) { case "text_input_right": strCss = "text_disp_right"; break; case "text_input_center": strCss = "text_disp_center"; break; case "text_input_left": strCss = "text_disp_left"; break; case "text_input_right_key": strCss = "text_disp_right_key"; break; case "text_input_center_key": strCss = "text_disp_center_key"; break; case "text_input_left_key": strCss = "text_disp_left_key"; break; } } } ((TextBox)divC.Controls[i]).CssClass = strCss; break; /** * case "NumberBox" : * if (Mode == 1 || Mode == 0 || Mode == 4 ) { * ((TextBox)divC.Controls[i]).ReadOnly = false; * ((TextBox)divC.Controls[i]).ForeColor = Color.Black; * } * else { * ((TextBox)divC.Controls[i]).ReadOnly = true; * ((TextBox)divC.Controls[i]).ForeColor = Color.Gray; * } * break; **/ case "DropDownList": if (Mode == 1) { ((DropDownList)divC.Controls[i]).Enabled = true; } else { ((DropDownList)divC.Controls[i]).Enabled = false; } break; case "CheckBox": if (Mode == 1) { ((CheckBox)divC.Controls[i]).Enabled = true; } else { ((CheckBox)divC.Controls[i]).Enabled = false; } break; case "RadioButtonList": if (Mode == 1) { ((RadioButtonList)divC.Controls[i]).Enabled = true; } else { ((RadioButtonList)divC.Controls[i]).Enabled = false; } break; } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("分销中心"); int currentMemberUserId = Globals.GetCurrentMemberUserId(); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId); if (userIdDistributors == null) { System.Web.HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx"); } else if (userIdDistributors.ReferralStatus != 0) { System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx"); } else { this.imglogo = (System.Web.UI.WebControls.Image) this.FindControl("image"); if (!string.IsNullOrEmpty(userIdDistributors.Logo)) { this.imglogo.ImageUrl = userIdDistributors.Logo; } this.litStroeName = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName"); this.litStroeName.Text = userIdDistributors.StoreName; this.litrGradeName = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName"); DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId); if (distributorGradeInfo != null) { this.litrGradeName.Text = distributorGradeInfo.Name; } this.litReferralBlance = (System.Web.UI.WebControls.Literal) this.FindControl("litReferralBlance"); this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2"); this.litUserId = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId"); this.litUserId1 = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId1"); this.litUserId2 = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId2"); this.litUserId3 = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId3"); this.litUserId4 = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId4"); this.litUserId.Text = userIdDistributors.UserId.ToString(); this.litUserId1.Text = userIdDistributors.UserId.ToString(); this.litUserId2.Text = userIdDistributors.UserId.ToString(); this.litUserId3.Text = userIdDistributors.UserId.ToString(); this.litUserId4.Text = userIdDistributors.UserId.ToString(); this.litTodayOrdersNum = (System.Web.UI.WebControls.Literal) this.FindControl("litTodayOrdersNum"); OrderQuery orderQuery = new OrderQuery(); orderQuery.UserId = new int?(currentMemberUserId); orderQuery.Status = OrderStatus.Today; this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString(); this.refrraltotal = (FormatedMoneyLabel)this.FindControl("refrraltotal"); this.refrraltotal.Money = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, System.DateTime.Now, null, null, null, ""); this.saletotal = (FormatedMoneyLabel)this.FindControl("saletotal"); this.saletotal.Money = userIdDistributors.OrdersTotal; this.litMysubMember = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember"); this.litMysubFirst = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst"); this.litMysubSecond = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond"); DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId); if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0) { this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString(); this.litMysubFirst.Text = distributorsSubStoreNum.Rows[0]["firstV"].ToString(); this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString(); } else { this.litMysubMember.Text = "0"; this.litMysubFirst.Text = "0"; this.litMysubSecond.Text = "0"; } this.litProtuctNum = (System.Web.UI.WebControls.Literal) this.FindControl("litProtuctNum"); this.litProtuctNum.Text = ProductBrowser.GetProductsNumber(true).ToString(); orderQuery.Status = OrderStatus.All; this.litOrders = (System.Web.UI.WebControls.Literal) this.FindControl("litOrders"); this.litOrders.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString(); this.UpClassInfo = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo"); System.Collections.Generic.IList <DistributorGradeInfo> distributorGradeInfos = VShopHelper.GetDistributorGradeInfos(); DistributorGradeInfo distributorGradeInfo2 = null; foreach (DistributorGradeInfo current in distributorGradeInfos) { if (!(distributorGradeInfo.CommissionsLimit >= current.CommissionsLimit)) { if (distributorGradeInfo2 == null) { distributorGradeInfo2 = current; } else if (distributorGradeInfo2.CommissionsLimit > current.CommissionsLimit) { distributorGradeInfo2 = current; } } } if (distributorGradeInfo2 == null) { this.UpClassInfo.Visible = false; } else { decimal d = distributorGradeInfo2.CommissionsLimit - userIdDistributors.ReferralBlance - userIdDistributors.ReferralRequestBalance; if (d < 0m) { d = 0.01m; } this.UpClassInfo.InnerHtml = string.Concat(new string[] { "再获得<span> ", d.ToString("F2"), " 元</span>佣金升级为 <span>", distributorGradeInfo2.Name, "</span>" }); } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("会员中心"); MemberInfo currentMemberInfo = this.CurrentMemberInfo; if (currentMemberInfo == null) { this.Page.Response.Redirect("/logout.aspx"); } else { int currentMemberUserId = Globals.GetCurrentMemberUserId(false); this.UserBindName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("UserBindName"); this.UserBindName.Value = currentMemberInfo.UserBindName; this.UpClassInfo = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo"); this.litUserName = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName"); this.litPoints = (System.Web.UI.WebControls.Literal) this.FindControl("litPoints"); this.litPoints.Text = currentMemberInfo.Points.ToString(); this.image = (System.Web.UI.WebControls.Image) this.FindControl("image"); this.usePoints = (System.Web.UI.WebControls.Literal) this.FindControl("usePoints"); this.usePoints.Text = currentMemberInfo.Points.ToString(); this.litAmount = (System.Web.UI.WebControls.Literal) this.FindControl("litAmount"); this.litAmount.Text = System.Math.Round(currentMemberInfo.AvailableAmount, 2).ToString(); MemberCouponsSearch memberCouponsSearch = new MemberCouponsSearch(); memberCouponsSearch.CouponName = ""; memberCouponsSearch.Status = "0"; memberCouponsSearch.MemberId = currentMemberUserId; memberCouponsSearch.IsCount = true; memberCouponsSearch.PageIndex = 1; memberCouponsSearch.PageSize = 10; memberCouponsSearch.SortBy = "CouponId"; memberCouponsSearch.SortOrder = SortAction.Desc; int num = 0; DataTable memberCoupons = CouponHelper.GetMemberCoupons(memberCouponsSearch, ref num); this.litCoupon = (System.Web.UI.WebControls.Literal) this.FindControl("litCoupon"); this.litCoupon.Text = num.ToString(); //将coupon改为奶券数量 this.litCoupon.Text = VShopHelper.GetMilkCardCount(currentMemberInfo.UserId).ToString(); this.litBindUser = (System.Web.UI.WebControls.Literal) this.FindControl("litBindUser"); this.litExpenditure = (System.Web.UI.WebControls.Literal) this.FindControl("litExpenditure"); this.litExpenditure.SetWhenIsNotNull("¥" + currentMemberInfo.Expenditure.ToString("F2")); if (!string.IsNullOrEmpty(currentMemberInfo.UserBindName)) { this.litBindUser.Text = " style=\"display:none\""; } MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMemberInfo.GradeId); this.litrGradeName = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName"); if (memberGrade != null) { this.litrGradeName.Text = memberGrade.Name; } else { this.litrGradeName.Text = "普通会员"; } this.litUserName.Text = (string.IsNullOrEmpty(currentMemberInfo.OpenId) ? (string.IsNullOrEmpty(currentMemberInfo.RealName) ? currentMemberInfo.UserName : currentMemberInfo.RealName) : currentMemberInfo.UserName); SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); this.fxCenter = (System.Web.UI.WebControls.Literal) this.FindControl("fxCenter"); this.fxCenter.Text = masterSettings.DistributorCenterName; this.IsSign = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("IsSign"); if (!masterSettings.sign_score_Enable) { this.IsSign.Value = "-1"; } else if (!UserSignHelper.IsSign(currentMemberInfo.UserId)) { this.IsSign.Value = "1"; } if (!string.IsNullOrEmpty(currentMemberInfo.UserHead)) { this.image.ImageUrl = currentMemberInfo.UserHead; } this.txtWaitForstr = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtWaitForstr"); OrderQuery orderQuery = new OrderQuery(); orderQuery.Status = OrderStatus.WaitBuyerPay; int userOrderCount = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); orderQuery.Status = OrderStatus.SellerAlreadySent; int userOrderCount2 = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); orderQuery.Status = OrderStatus.BuyerAlreadyPaid; int userOrderCount3 = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); int waitCommentByUserID = ProductBrowser.GetWaitCommentByUserID(currentMemberUserId); int userOrderReturnCount = MemberProcessor.GetUserOrderReturnCount(currentMemberUserId); this.txtWaitForstr.Value = string.Concat(new string[] { userOrderCount.ToString(), "|", userOrderCount3.ToString(), "|", userOrderCount2.ToString(), "|", waitCommentByUserID.ToString(), "|", userOrderReturnCount.ToString() }); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId); this.txtShowDis = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtShowDis"); if (userIdDistributors == null || userIdDistributors.ReferralStatus != 0) { this.txtShowDis.Value = "false"; } else { this.txtShowDis.Value = "true"; } System.Collections.Generic.IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades(); MemberGradeInfo memberGradeInfo = null; foreach (MemberGradeInfo current in memberGrades) { double?tranVol = memberGrade.TranVol; double?tranVol2 = current.TranVol; if (tranVol.GetValueOrDefault() < tranVol2.GetValueOrDefault() || !(tranVol.HasValue & tranVol2.HasValue) || !(memberGrade.TranTimes >= current.TranTimes)) { tranVol = memberGrade.TranVol; tranVol2 = current.TranVol; if ((tranVol.GetValueOrDefault() < tranVol2.GetValueOrDefault() && (tranVol.HasValue & tranVol2.HasValue)) || memberGrade.TranTimes < current.TranTimes) { if (memberGradeInfo == null) { memberGradeInfo = current; } else { tranVol = memberGradeInfo.TranVol; tranVol2 = current.TranVol; if ((tranVol.GetValueOrDefault() > tranVol2.GetValueOrDefault() && (tranVol.HasValue & tranVol2.HasValue)) || memberGradeInfo.TranTimes > current.TranTimes) { memberGradeInfo = current; } } } } } if (memberGradeInfo == null) { this.UpClassInfo.Visible = false; } else { int num2 = 0; if (memberGradeInfo.TranTimes.HasValue) { num2 = memberGradeInfo.TranTimes.Value - currentMemberInfo.OrderNumber; } if (num2 <= 0) { num2 = 1; } decimal d = 0m; if (memberGradeInfo.TranVol.HasValue) { d = (decimal)memberGradeInfo.TranVol.Value - currentMemberInfo.Expenditure; } if (d <= 0m) { d = 0.01m; } this.UpClassInfo.InnerHtml = string.Concat(new string[] { "再交易<span>", num2.ToString(), "次 </span>或消费<span> ", System.Math.Round(d + 0.49m, 0).ToString(), "元 </span>升级" }); } } }