public override string GetDesignTimeHtml()
		{
			StringWriter sw = new StringWriter();
			HtmlTextWriter writer = new HtmlTextWriter(sw);

			Panel panel = new Panel();
			panel.BackColor = Color.WhiteSmoke;
			panel.Width = new Unit("100%");

			HtmlTable table = new HtmlTable();
			table.Attributes["align"] = "center";
			HtmlTableRow row = new HtmlTableRow();

			HtmlTableCell cell1 = new HtmlTableCell();
			cell1.Align = "left";
			cell1.VAlign = "middle";

			HtmlImage castleImg = new HtmlImage();
			castleImg.Style["margin"] = "4px";
			castleImg.Src = binder.Page.ClientScript.GetWebResourceUrl(
				GetType(), "Castle.MonoRail.Framework.Views.Aspx.ControllerBinder.Design.Castle.gif");
			cell1.Controls.Add(castleImg);
			row.Cells.Add(cell1);

			HtmlTableCell cell2 = new HtmlTableCell();
			cell1.Align = "left";
			cell1.VAlign = "middle";

			HtmlImage monoRailImg = new HtmlImage();
			monoRailImg.Src = binder.Page.ClientScript.GetWebResourceUrl(
				GetType(), "Castle.MonoRail.Framework.Views.Aspx.ControllerBinder.Design.MonoRail.gif");
			cell2.Controls.Add(monoRailImg);
			row.Cells.Add(cell2);

			HtmlTableCell cell3 = new HtmlTableCell();
			cell3.Align = "center";
			cell3.VAlign = "middle";
			cell3.Attributes["style"] = "font-family: verdana, tahoma, arial, sans-serif; font-size: 0.9em; color:#5266A6";
			LiteralControl caption = new LiteralControl();
			int bindingCount = binder.ControllerBindings.Count;
			caption.Text = string.Format("<b>Controller Binder</b> - {0} binding{1}",
				bindingCount, bindingCount != 1 ? "s" : "");
			cell3.Controls.Add(caption);
			row.Cells.Add(cell3);

			table.Rows.Add(row);

			panel.Controls.Add(table);

			// Get the HTML produced by the control.
			panel.RenderControl(writer);
			return sw.ToString();
		}
예제 #2
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺消息");
            this.imglogo        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imglogo");
            this.hdlogo         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdlogo");
            this.txtstorename   = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtstorename");
            this.txtdescription = (System.Web.UI.HtmlControls.HtmlTextArea) this.FindControl("txtdescription");
            this.txtacctount    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtacctount");
            this.txtStoreTel    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtStoreTel");
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId());

            if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                if (userIdDistributors != null)
                {
                    if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                    {
                        this.imglogo.Src = userIdDistributors.Logo;
                    }
                    this.hdlogo.Value         = userIdDistributors.Logo;
                    this.txtstorename.Value   = userIdDistributors.StoreName;
                    this.txtdescription.Value = userIdDistributors.StoreDescription;
                    this.txtacctount.Value    = userIdDistributors.RequestAccount;
                    this.txtStoreTel.Value    = currentMember.CellPhone;
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            this.EnsureChildControls();

            // create the controls
            this.TextBoxControl.ID = this.TextBoxControl.ClientID;
            this.TextBoxControl.Width = Unit.Pixel(330);
            this.TextBoxControl.CssClass = "guiInputText";

            // add the controls
            this.Controls.Add(this.TextBoxControl);

            // create the image
            HtmlImage image = new HtmlImage() { Src = string.Concat(GlobalSettings.Path, "/images/foldericon.png") };
            image.Style.Add("padding-left", "5px");

            // create the anchor link
            HtmlAnchor anchor = new HtmlAnchor() { HRef = "javascript:void(0);" };
            anchor.Attributes.Add("onclick", string.Format("javascript:UmbClientMgr.openModalWindow('{0}/plugins/uComponents/Shared/Pages/DirectoryBrowser.aspx?target={1}&path={2}', 'Choose a file or a folder', true, 400, 500, 0, 0); return false;", GlobalSettings.Path, this.TextBoxControl.ClientID, this.SelectedDirectory));

            // add the image to the anchor link
            anchor.Controls.Add(image);

            // add the anchor link to the data-type property
            this.Controls.Add(anchor);
        }
예제 #4
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("修改用户信息");
        }
예제 #5
0
    public void DistributerCard(Properties P)
    {
        try
        {
            using (cmd = new SqlCommand())
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_UI_Distributer_MainPage";
                cmd.Connection  = Getconnected.getconnecting();
                using (sdr = cmd.ExecuteReader())
                {
                    if (sdr.HasRows)
                    {
                        while (sdr.Read())
                        {
                            System.Web.UI.HtmlControls.HtmlGenericControl div1 = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            div1.Attributes["class"] = "col-md-3 mt-30";
                            P.MyProperty.Controls.Add(div1);



                            System.Web.UI.HtmlControls.HtmlGenericControl div2 = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            div2.Attributes["class"] = "border mt-30";
                            div1.Controls.Add(div2);


                            System.Web.UI.HtmlControls.HtmlImage timerimag = new System.Web.UI.HtmlControls.HtmlImage();
                            timerimag.Attributes["class"] = "img-responsive";
                            //timerimag.Attributes["Width"] = "60px";
                            timerimag.Attributes["Height"] = "30%";
                            //timerimag.Width = 53;
                            timerimag.Height = 53;
                            timerimag.Src    = sdr[2].ToString() + sdr[1].ToString();
                            timerimag.Alt    = sdr[2].ToString();
                            div2.Controls.Add(timerimag);


                            //System.Web.UI.HtmlControls.HtmlGenericControl timerspan = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
                            //timerspan.InnerText = "Locations : Karachi,Islamabad,Lahore";
                            //div2.Controls.Add(timerspan);

                            System.Web.UI.HtmlControls.HtmlGenericControl p2 = new System.Web.UI.HtmlControls.HtmlGenericControl("p");

                            StringBuilder sb = new StringBuilder();
                            sb.Append("Tier Level : 1");
                            sb.AppendLine("<br>");
                            sb.Append("Locations : Karachi, Lahore, Islamabad");
                            sb.AppendLine("<br>");
                            sb.Append(sdr[3].ToString().Replace("https://", "www."));
                            sb.AppendLine("<br>");
                            sb.Append("Patner Status : " + sdr[4].ToString());
                            p2.InnerHtml = sb.ToString();
                            div2.Controls.Add(p2);
                        }
                    }
                }
            }
        }
        catch (Exception ex) { }
    }
예제 #6
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     this.litProdcutName = (Literal) this.FindControl("litProdcutName");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.productImage = (HtmlImage) this.FindControl("productImage");
     this.productLink = (HyperLink) this.FindControl("productLink");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     string str = this.Page.Request["OrderId"];
     string str2 = "";
     if (!string.IsNullOrEmpty(str))
     {
         OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(str);
         if ((orderInfo != null) && (orderInfo.ReferralUserId > 0))
         {
             str2 = "&&ReferralId=" + orderInfo.ReferralUserId;
         }
     }
     else if (Globals.GetCurrentDistributorId() > 0)
     {
         str2 = "&&ReferralId=" + Globals.GetCurrentDistributorId().ToString();
     }
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProdcutName.SetWhenIsNotNull(product.ProductName);
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.productImage.Src = product.ThumbnailUrl180;
     this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + product.ProductId + str2;
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     ProductReviewQuery reviewQuery = new ProductReviewQuery {
         productId = this.productId,
         IsCount = true,
         PageIndex = num,
         PageSize = num2,
         SortBy = "ReviewId",
         SortOrder = SortAction.Desc
     };
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     DbQueryResult productReviews = ProductBrowser.GetProductReviews(reviewQuery);
     this.rptProducts.DataSource = productReviews.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
     PageTitle.AddSiteNameTitle("商品评价");
 }
예제 #7
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (this.DesignMode)
            {
                return;
            }

            if (this.ProcessCertificateDownloadRequest())
            {
                return;
            }

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

            HtmlGenericControl container = new HtmlGenericControl("div") { ID = divId };

            ClientScriptManager clientScriptManager = this.Page.ClientScript;
            HtmlImage controlImage = new HtmlImage
            {
                ID = string.Format(CultureInfo.CurrentUICulture, "STVC{0}", Guid.NewGuid()),
                Src = clientScriptManager.GetWebResourceUrl(typeof(SecurityTokenVisualizerControl), "Microsoft.Samples.DPE.Identity.Controls.Content.images.icon.png"),
                Alt = Resources.SecurityTokenVisualizer,
            };

            controlImage.Attributes["title"] = Resources.SecurityTokenVisualizer;

            HtmlControl tokenVisualizerHeader = this.CreateCollapsableHeader(controlImage, container, false /* Expanded as Default */);

            if (this.Font == null || string.IsNullOrEmpty(this.Font.Name))
            {
                container.Style["font-family"] = "Arial, Consolas, Segoe UI";
                tokenVisualizerHeader.Style["font-family"] = "Arial, Consolas, Segoe UI";
            }
            if (this.Font == null || this.Font.Size.IsEmpty)
            {
                container.Style["font-size"] = "small";
                tokenVisualizerHeader.Style["font-size"] = "small";
            }

            var containerRounded = this.AddContainerRounded(container);

            if (Thread.CurrentPrincipal.Identity.IsAuthenticated && Thread.CurrentPrincipal.Identity is IClaimsIdentity)
            {
                AddClaimsTable(containerRounded);
                containerRounded.Controls.Add(new HtmlGenericControl() { InnerHtml = "&nbsp;" });
                this.AddSamlTokenTable(containerRounded);
            }
            else
            {
                AddNotAuthenticatedUserTable(containerRounded);
            }

            tokenVisualizerHeader.RenderControl(writer);

            container.RenderControl(writer);

            base.RenderContents(writer);
        }
예제 #8
0
 protected override void AttachChildControls()
 {
     if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
     {
         string text = System.Web.HttpContext.Current.Request.Url.ToString();
         if (text.IndexOf("?") > -1)
         {
             text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
         }
         else
         {
             text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
         }
         this.Page.Response.Redirect(text);
         return;
     }
     PageTitle.AddSiteNameTitle("首页");
     this.rptSlide    = (AliOHTemplatedRepeater)this.FindControl("rptSlide");
     this.rptNavigate = (AliOHTemplatedRepeater)this.FindControl("rptNavigate");
     this.rptTopic    = (AliOHTemplatedRepeater)this.FindControl("rptTopics");
     this.rptProducts = (AliOHTemplatedRepeater)this.FindControl("rptProducts");
     this.img         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg");
     if (this.rptSlide != null)
     {
         this.rptSlide.DataSource = VshopBrowser.GetAllBanners(ClientType.AliOH);
         this.rptSlide.DataBind();
     }
     if (this.rptProducts != null)
     {
         DataTable homeProduct = ProductBrowser.GetHomeProduct(ClientType.AliOH);
         this.rptProducts.DataSource = homeProduct;
         this.rptProducts.DataBind();
     }
     if (this.rptTopic != null)
     {
         DataTable topics = VshopBrowser.GetTopics(ClientType.AliOH);
         this.rptTopic.DataSource = topics;
         this.rptTopic.DataBind();
     }
     if (this.rptNavigate != null)
     {
         System.Collections.Generic.IList <NavigateInfo> allNavigate = VshopBrowser.GetAllNavigate(ClientType.AliOH);
         foreach (NavigateInfo current in allNavigate)
         {
             if (!current.ImageUrl.ToLower().Contains("storage/master/navigate") && !current.ImageUrl.ToLower().Contains("templates"))
             {
                 current.ImageUrl = HiContext.Current.GetAliOHshopSkinPath(null) + "/images/deskicon/" + current.ImageUrl;
             }
         }
         this.rptNavigate.DataSource = allNavigate;
         this.rptNavigate.DataBind();
     }
     if (this.img != null)
     {
         this.img.Src = new AliohTemplateHelper().GetDefaultBg();
     }
 }
예제 #9
0
        protected void relatedImages_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //get the ImageReference object that is bound to the current row.
                ImageReference imageDetails = (ImageReference)e.Item.DataItem;

                if (imageDetails != null)
                {
                    System.Web.UI.HtmlControls.HtmlImage termImage = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("termImage");
                    if (termImage != null)
                    {
                        termImage.Alt = imageDetails.AltText;

                        if (!string.IsNullOrEmpty(imageDetails.Filename))
                        {
                            System.Web.UI.HtmlControls.HtmlAnchor termEnlargeImage = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("termEnlargeImage");

                            //if either the regular image size or the enlarge image size is not in the config file
                            //default to the full image in the database
                            if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageRegular"]) || string.IsNullOrEmpty(ConfigurationManager.AppSettings["CDRImageEnlarge"]))
                            {
                                termImage.Src = imageDetails.Filename;

                                if (termEnlargeImage != null)
                                {
                                    termEnlargeImage.HRef      = imageDetails.Filename;
                                    termEnlargeImage.InnerText = DictionaryLanguage == "es" ? "Ampliar" : "Enlarge";
                                }

                                //log a warning
                                log.WarnFormat("Web.Config file does not specify image sizes for term id: {0}. Display full image.", CdrID);
                            }
                            else
                            {
                                string[] regularTermImage = imageDetails.Filename.Split('.');
                                if (regularTermImage.Length == 2)
                                {
                                    //termImage image size is 571
                                    //example format CDR526538-571.jpg
                                    termImage.Src = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageRegular"] + "." + regularTermImage[1];

                                    //enlarge image size is 750
                                    //example format CDR526538-750.jpg
                                    if (termEnlargeImage != null)
                                    {
                                        termEnlargeImage.HRef      = regularTermImage[0] + "-" + ConfigurationManager.AppSettings["CDRImageEnlarge"] + "." + regularTermImage[1];
                                        termEnlargeImage.InnerText = DictionaryLanguage == "es" ? "Ampliar" : "Enlarge";
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #10
0
 protected override void AttachChildControls()
 {
     this.imgWeixin = (HtmlImage) this.FindControl("imgWeixin");
     this.hidWeixinNumber = (HtmlInputHidden) this.FindControl("hidWeixinNumber");
     this.hidWeixinLoginUrl = (HtmlInputHidden) this.FindControl("hidWeixinLoginUrl");
     SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
     this.hidWeixinNumber.Value = masterSettings.WeixinNumber;
     this.imgWeixin.Src = masterSettings.WeiXinCodeImageUrl;
     PageTitle.AddSiteNameTitle("登录向导");
 }
예제 #11
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
     {
         base.GotoResourceNotFound("");
     }
     this.bgimg = (HtmlImage) this.FindControl("bgimg");
     this.litActivityDesc = (Literal) this.FindControl("litActivityDesc");
     this.litPrizeNames = (Common_PrizeNames) this.FindControl("litPrizeNames");
     this.litPrizeUsers = (Common_PrizeUsers) this.FindControl("litPrizeUsers");
     this.litStartDate = (Literal) this.FindControl("litStartDate");
     this.litEndDate = (Literal) this.FindControl("litEndDate");
     PageTitle.AddSiteNameTitle("砸金蛋");
     LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);
     if (lotteryActivity == null)
     {
         base.GotoResourceNotFound("");
     }
     if (MemberProcessor.GetCurrentMember() == null)
     {
         MemberInfo member = new MemberInfo();
         string generateId = Globals.GetGenerateId();
         member.GradeId = MemberProcessor.GetDefaultMemberGrade();
         member.UserName = "";
         member.OpenId = "";
         member.CreateDate = DateTime.Now;
         member.SessionId = generateId;
         member.SessionEndTime = DateTime.Now;
         MemberProcessor.CreateMember(member);
         member = MemberProcessor.GetMember(generateId);
         HttpCookie cookie = new HttpCookie("Vshop-Member") {
             Value = member.UserId.ToString(),
             Expires = DateTime.Now.AddYears(10)
         };
         HttpContext.Current.Response.Cookies.Add(cookie);
     }
     this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     this.litEndDate.Text = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"/vshop/default.aspx\";});</script>");
     }
     if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
     {
         this.litActivityDesc.Text = lotteryActivity.ActivityDesc;
         this.litPrizeNames.Activity = lotteryActivity;
         this.litPrizeUsers.Activity = lotteryActivity;
         int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
         this.litActivityDesc.Text = this.litActivityDesc.Text + string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
     }
     else
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";})</script>");
     }
 }
예제 #12
0
 protected override void AttachChildControls()
 {
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.img = (HtmlImage) this.FindControl("imgDefaultBg");
     this.pager = (Pager) this.FindControl("pager");
     this.litstorename = (Literal) this.FindControl("litstorename");
     this.litdescription = (Literal) this.FindControl("litdescription");
     this.imgback = (HiImage) this.FindControl("imgback");
     this.imglogo = (HiImage) this.FindControl("imglogo");
     this.Page.Session["stylestatus"] = "3";
     SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
     PageTitle.AddSiteNameTitle(masterSettings.SiteName);
     this.litstorename.Text = masterSettings.SiteName;
     this.litdescription.Text = masterSettings.ShopIntroduction;
     if (base.referralId <= 0)
     {
         HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
         if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
         {
             base.referralId = int.Parse(cookie.Value);
         }
     }
     DistributorsInfo userIdDistributors = new DistributorsInfo();
     userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
     if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
     {
         PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
         this.litdescription.Text = userIdDistributors.StoreDescription;
         this.litstorename.Text = userIdDistributors.StoreName;
         if (userIdDistributors.Logo != "")
         {
             this.imglogo.ImageUrl = userIdDistributors.Logo;
         }
         this.imgback.ImageUrl = userIdDistributors.BackImage;
     }
     if (this.rptProducts != null)
     {
         ProductQuery query = new ProductQuery {
             PageSize = this.pager.PageSize,
             PageIndex = this.pager.PageIndex
         };
         DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
         this.rptProducts.DataSource = homeProduct.Data;
         this.rptProducts.DataBind();
         this.pager.TotalRecords = homeProduct.TotalRecords;
         if (this.pager.TotalRecords <= this.pager.PageSize)
         {
             this.pager.Visible = false;
         }
     }
     if (this.img != null)
     {
         this.img.Src = new VTemplateHelper().GetDefaultBg();
     }
 }
예제 #13
0
        protected override void AttachChildControls()
        {
            this.imgWeixin         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgWeixin");
            this.hidWeixinNumber   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidWeixinNumber");
            this.hidWeixinLoginUrl = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidWeixinLoginUrl");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.hidWeixinNumber.Value = masterSettings.WeixinNumber;
            this.imgWeixin.Src         = masterSettings.WeiXinCodeImageUrl;
            PageTitle.AddSiteNameTitle("登录向导");
        }
예제 #14
0
        protected void gvPlayerResults_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {
                foreach (TableCell tc in e.Row.Cells)
                {
                    if (tc.HasControls())
                    {
                        LinkButton lnk = (LinkButton)tc.Controls[0];
                        if (lnk != null)
                        {
                            lnk.CssClass = "sortingHeader";
                            lnk.ToolTip = "Posortuj po polu: " + lnk.Text;
                            HtmlGenericControl span = new HtmlGenericControl("span");
                            span.InnerText = lnk.Text;
                            lnk.Controls.Add(span);

                            HtmlImage img = new HtmlImage();

                            object oSortDirection = Session["defaultSortDirection"];
                            object oSortExpression = Session["defaultSortExpression"];

                            if (oSortExpression == null)
                            {
                                if (lnk.Text == "#")
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_asc.png");
                                else
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_Sorting.png");
                            }
                            else
                            {
                                string sortExpression = oSortExpression.ToString();
                                string sortDirection = oSortDirection.ToString();
                                if (string.Compare(sortExpression, lnk.Text) == 0)
                                {
                                    if (sortDirection == SortDirection.Ascending.ToString())
                                        img.Src = Page.ResolveUrl("~/Assets/arrow_asc.png");
                                    else
                                        img.Src = Page.ResolveUrl("~/Assets/arrow_desc.png");
                                }
                                else
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_Sorting.png");
                            }

                            img.Alt = "Posortuj po polu: " + lnk.Text;
                            img.Width = 14;
                            img.Height = 14;
                            lnk.Controls.Add(img);

                        }
                    }
                }
            }
        }
예제 #15
0
 public static void RegisterCalendarPair(Control parentControl,
                                         string calendarID, DateTime selectedDate,
                                         out ComponentArt.Web.UI.Calendar picker,
                                         out System.Web.UI.HtmlControls.HtmlImage button,
                                         out ComponentArt.Web.UI.Calendar calendar)
 {
     RegisterCalendarPair(parentControl,
                          calendarID, selectedDate,
                          out picker,
                          out button,
                          out calendar, false);
 }
 private void AddImageContrl(NamedRectangle shp, String type, bool hide)
 {
     HtmlImage image = new HtmlImage();
     image.Src = "resource/en-us/" + type + ".gif";
     image.ID = shp.Name + "_" + type;
     image.Style["Z-INDEX"] = "200";
     image.Style["LEFT"] = String.Format("{0}px", (int)shp.Left - 12);
     image.Style["TOP"] = String.Format("{0}px", (int)shp.Top - 12);
     image.Style["POSITION"] = "absolute";
     image.Style["DISPLAY"] = hide ? "none" : "";
     PlaceHolder.Controls.Add(image);
 }
예제 #17
0
 //databinds the image that has been uploaded of the Animal
 protected void gridReptile_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         System.Web.UI.HtmlControls.HtmlImage imageControl = (System.Web.UI.HtmlControls.HtmlImage)e.Row.FindControl("imageControl");
         if (((DataRowView)e.Row.DataItem)["AnimalImage"] != DBNull.Value)
         {
             imageControl.Src   = "data:image/png;base64," + Convert.ToBase64String((byte[])(((DataRowView)e.Row.DataItem))["AnimalImage"]);
             imageControl.Width = 100;
         }
     }
 }
예제 #18
0
        protected override void AttachChildControls()
        {
            this.linDevelopReferrals = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("linDevelopReferrals");
            this.imgQRCode           = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgQRCode");
            Member member = HiContext.Current.User as Member;

            if (member.ReferralStatus != 2)
            {
                this.Page.Response.Redirect("ReferralRegisterAgreement.aspx");
            }
            System.Uri url  = System.Web.HttpContext.Current.Request.Url;
            string     text = (url.Port == 80) ? string.Empty : (":" + url.Port.ToString(System.Globalization.CultureInfo.InvariantCulture));

            this.linDevelopReferrals.HRef = string.Concat(new object[]
            {
                string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}://{1}{2}/VShop/Login.aspx", new object[]
                {
                    url.Scheme,
                    HiContext.Current.SiteSettings.SiteUrl,
                    text
                }),
                Globals.ApplicationPath,
                "?ReferralUserId=",
                HiContext.Current.User.UserId,
                "&action=register"
            });
            string text2 = this.Page.Request.MapPath(Globals.ApplicationPath + "/Storage/master/QRCode_VShop/");

            if (System.IO.File.Exists(string.Concat(new object[]
            {
                text2,
                "referral_",
                member.UserId,
                ".png"
            })))
            {
                this.imgQRCode.Src = string.Concat(new object[]
                {
                    Globals.ApplicationPath,
                    "/Storage/master/QRCode_VShop/referral_",
                    member.UserId,
                    ".png"
                });
                return;
            }
            if (this.linDevelopReferrals.HRef.IndexOf("/VShop/Login.aspx") == -1)
            {
                this.imgQRCode.Src = this.CreateQRCode(this.linDevelopReferrals.HRef.Replace("/Login.aspx", "/VShop/Login.aspx"), member.UserId);
                return;
            }
            this.imgQRCode.Src = this.CreateQRCode(this.linDevelopReferrals.HRef, member.UserId);
        }
예제 #19
0
		public void DefaultProperties ()
		{
			HtmlImage img = new HtmlImage ();
			Assert.AreEqual (0, img.Attributes.Count, "Attributes.Count");

			Assert.AreEqual (String.Empty, img.Align, "Align");
			Assert.AreEqual (String.Empty, img.Alt, "Alt");
			Assert.AreEqual (-1, img.Border, "Border");
			Assert.AreEqual (-1, img.Height, "Height");
			Assert.AreEqual (String.Empty, img.Src, "Src");
			Assert.AreEqual (-1, img.Width, "Width");

			Assert.AreEqual ("img", img.TagName, "TagName");
		}
        public override Control AddTo(Control container, PluginContext context)
        {
            if(!ActiveFor(container, context.State))
                return null;

            HtmlImage img = new HtmlImage();
            img.Src = Engine.ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Resources/Img/separator.png");
            img.Attributes["class"] = "separator";
            img.Height = 16;
            img.Width = 1;
            img.Alt = "|";
            container.Controls.Add(img);
            return img;
        }
예제 #21
0
        private HtmlGenericControl generateDevice(Device device, DatabaseEntities db)
        {
            var brandQuery = db.Brands.Where(b => b.brand_id == device.brand_id);
            var brand = brandQuery.FirstOrDefault<Brand>();

            var operatingSystemQuery = db.OperatingSystems.Where(b => b.operating_system_id == device.operating_system_id);
            var operatingSystem = operatingSystemQuery.FirstOrDefault<OperatingSystem>();

            var displayQuery = db.Displays.Where(b => b.display_id == device.display_id);
            var display = displayQuery.FirstOrDefault<Display>();

            HtmlGenericControl deviceDiv = new HtmlGenericControl("DIV");
            deviceDiv.Attributes["class"] = "device";

            //HtmlGenericControl anchorFirst = new HtmlGenericControl("a");
            HtmlAnchor anchorFirst = new HtmlAnchor();
            anchorFirst.HRef = String.Format("~/device.aspx?id={0}", device.device_id);

            HtmlImage img = new HtmlImage();
            img.Src = String.Format("~/images/{0}/{1} {2} .jpg", brand.name, brand.name, device.device_name);

            anchorFirst.Controls.Add(img);

            HtmlGenericControl h2 = new HtmlGenericControl("h2");
            //HtmlGenericControl anchorSecond = new HtmlGenericControl("a");
            HtmlAnchor anchorSecond = new HtmlAnchor();
            anchorSecond.HRef = String.Format("~/device.aspx?id={0}", device.device_id);
            anchorSecond.InnerText = String.Format("{0} {1}", brand.name, device.device_name);
            h2.Controls.Add(anchorSecond);

            HtmlGenericControl p = new HtmlGenericControl("p");
            p.InnerText = String.Format("{0}, экран {1}, {2} ( {3} ), ОЗУ {4}, аккумулятор {5}",
                operatingSystem.name, device.screen_size, display.type, device.screen_resolution, device.ram, device.battery_capacity);

            HtmlGenericControl clrDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
            clrDiv.Attributes["class"] = "clr";

            HtmlGenericControl priceDiv = new HtmlGenericControl("DIV");
            priceDiv.Attributes["class"] = "price";
            priceDiv.InnerText = String.Format("{0}", device.price);

            deviceDiv.Controls.Add(anchorFirst);
            deviceDiv.Controls.Add(h2);
            deviceDiv.Controls.Add(p);
            deviceDiv.Controls.Add(clrDiv);
            deviceDiv.Controls.Add(priceDiv);

            return deviceDiv;
        }
예제 #22
0
파일: Login.ascx.cs 프로젝트: pkdevbox/Rock
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            phExternalLogins.Controls.Clear();

            // Look for active external authentication providers
            foreach ( var serviceEntry in AuthenticationContainer.Instance.Components )
            {
                var component = serviceEntry.Value.Value;

                if ( component.IsActive && component.RequiresRemoteAuthentication )
                {
                    string loginTypeName = component.GetType().Name;

                    // Check if returning from third-party authentication
                    if ( !IsPostBack && component.IsReturningFromAuthentication( Request ) )
                    {
                        string userName = string.Empty;
                        string returnUrl = string.Empty;
                        if ( component.Authenticate( Request, out userName, out returnUrl ) )
                        {
                            LoginUser( userName, returnUrl, false );
                            break;
                        }
                    }

                    LinkButton lbLogin = new LinkButton();
                    phExternalLogins.Controls.Add( lbLogin );
                    lbLogin.AddCssClass( "btn btn-authenication " + loginTypeName.ToLower() );
                    lbLogin.ID = "lb" + loginTypeName + "Login";
                    lbLogin.Click += lbLogin_Click;
                    lbLogin.CausesValidation = false;

                    if ( !String.IsNullOrWhiteSpace( component.ImageUrl() ) )
                    {
                        HtmlImage img = new HtmlImage();
                        lbLogin.Controls.Add( img );
                        img.Attributes.Add( "style", "border:none" );
                        img.Src = Page.ResolveUrl( component.ImageUrl() );
                    }
                    else
                    {
                        lbLogin.Text = "Login Using " + loginTypeName;
                    }
                }
            }
        }
예제 #23
0
        protected override void RenderContents()
        {
            HtmlGenericControl contents = new HtmlGenericControl("div");
            contents.ID = "contents";

            HtmlGenericControl h1 = new HtmlGenericControl("h1");
            h1.InnerText = "Requests by Browser Type";
            contents.Controls.Add(h1);

            Chart browsersChart = new Chart();
            browsersChart.ImageStorageMode = ImageStorageMode.UseHttpHandler;
            browsersChart.Width = 500;
            browsersChart.Height = 500;
            browsersChart.Titles.Add("Requests by Browser Type");

            //contents.Controls.Add(browsersChart);

            // This is the most important part, and the departure from using any custom classes or Futures library.

            //// Simply use a MemoryStream to save the chart.
            //MemoryStream imageStream = new MemoryStream();
            //browsersChart.SaveImage(imageStream, ChartImageFormat.Png);

            //// Reset the stream’s pointer back to the start of the stream.
            //imageStream.Seek(0, SeekOrigin.Begin);

            // return the normal FileResult available in the current release of MVC

            browsersChart.RenderType = RenderType.ImageTag;
            browsersChart.ImageLocation = "~/MyChart.png";

            browsersChart.SaveImage(Server.MapPath("~/MyChart.png"), ChartImageFormat.Png);

            HtmlImage chart = new HtmlImage();
            chart.ID = "browsers chart";
            chart.Src = Request.ApplicationPath + "/MyChart.png";
            chart.Height = 500;
            chart.Width = 500;

            contents.Controls.Add(chart);

            //contents.Controls.Add(browsersChart);

            //browsersChart.SaveImage(Response.OutputStream, ChartImageFormat.Png);
            //Response.End();

            _body.Controls.Add(contents);
        }
예제 #24
0
파일: VStoreCard.cs 프로젝트: zwkjgs/XKD
        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("掌柜名片");
        }
예제 #25
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            ProductConsultationAndReplyQuery productConsultationAndReplyQuery = new ProductConsultationAndReplyQuery();
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            productConsultationAndReplyQuery.ProductId  = this.productId;
            productConsultationAndReplyQuery.IsCount    = true;
            productConsultationAndReplyQuery.PageIndex  = pageIndex;
            productConsultationAndReplyQuery.PageSize   = pageSize;
            productConsultationAndReplyQuery.SortBy     = "ConsultationId";
            productConsultationAndReplyQuery.SortOrder  = SortAction.Desc;
            productConsultationAndReplyQuery.HasReplied = new bool?(true);
            this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptProducts");
            this.txtTotal    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(productConsultationAndReplyQuery);

            this.rptProducts.DataSource = productConsultations.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
            this.litProductTitle     = (System.Web.UI.WebControls.Literal) this.FindControl("litProductTitle");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSoldCount        = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.imgProductImage     = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgProductImage");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            this.litProductTitle.SetWhenIsNotNull(productSimpleInfo.ProductName);
            this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(productSimpleInfo.ShowSaleCounts.ToString());
            this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.ToString("F2"));
            this.imgProductImage.Src = (string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl60) ? Globals.FullPath(this.siteSettings.DefaultProductThumbnail4) : productSimpleInfo.ThumbnailUrl60);
            PageTitle.AddSiteNameTitle("商品咨询");
        }
예제 #26
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            cornerImage.ImageUrl="images/style" + CssStyleNum.ToString() + "/tab_corn.gif";
            cornerImage.CssClass="t_act";

            if (IsRoot==true)
            {
                Table.Rows[0].Cells[0].CssClass="t_white";
                Table.Rows[0].Cells[1].CssClass="t_white";

                if(EnableLogoutButton==true && IsRoot==true)
                {
                    System.Web.UI.WebControls.Literal capt=new System.Web.UI.WebControls.Literal();
                    capt.Text=WelcomeNote + "&nbsp;&nbsp;";
                    System.Web.UI.HtmlControls.HtmlAnchor anch=new System.Web.UI.HtmlControls.HtmlAnchor();
                    anch.HRef=LogoutHref;
                    System.Web.UI.HtmlControls.HtmlImage img=new System.Web.UI.HtmlControls.HtmlImage();
                    img.Alt="Logout";
                    img.Src="images/logout.gif";
                    img.Border=0;
                    anch.Controls.Add(img);
                    Table.Rows[0].Cells[0].HorizontalAlign=System.Web.UI.WebControls.HorizontalAlign.Right;
                    Table.Rows[0].Cells[0].Controls.Add(capt);
                    Table.Rows[0].Cells[1].Controls.Add(anch);
                }

                Table.Rows[0].Cells[2].CssClass="t_white";

            }
            else
            {
                Table.Rows[0].Cells[0].CssClass="t_act";
                Table.Rows[0].Cells[1].CssClass="t_act";
                Table.Rows[0].Cells[2].CssClass="t_act";
            }

            Table.Rows[1].Cells[0].CssClass="t_white";
            Table.Rows[1].Cells[1].CssClass="t_white";
            Table.Rows[1].Cells[2].CssClass="t_white";

            Table.Rows[2].Cells[0].CssClass="t_act";
            Table.Rows[2].Cells[1].CssClass="t_act";
            Table.Rows[2].Cells[2].CssClass="t_act";
        }
예제 #27
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            cornerImage.ImageUrl = "images/style" + CssStyleNum.ToString() + "/tab_corn.gif";
            cornerImage.CssClass = "t_act";

            if (IsRoot == true)
            {
                Table.Rows[0].Cells[0].CssClass = "t_white";
                Table.Rows[0].Cells[1].CssClass = "t_white";

                if (EnableLogoutButton == true && IsRoot == true)
                {
                    System.Web.UI.WebControls.Literal capt = new System.Web.UI.WebControls.Literal();
                    capt.Text = WelcomeNote + "&nbsp;&nbsp;";
                    System.Web.UI.HtmlControls.HtmlAnchor anch = new System.Web.UI.HtmlControls.HtmlAnchor();
                    anch.HRef = LogoutHref;
                    System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                    img.Alt    = "Logout";
                    img.Src    = "images/logout.gif";
                    img.Border = 0;
                    anch.Controls.Add(img);
                    Table.Rows[0].Cells[0].HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Right;
                    Table.Rows[0].Cells[0].Controls.Add(capt);
                    Table.Rows[0].Cells[1].Controls.Add(anch);
                }


                Table.Rows[0].Cells[2].CssClass = "t_white";
            }
            else
            {
                Table.Rows[0].Cells[0].CssClass = "t_act";
                Table.Rows[0].Cells[1].CssClass = "t_act";
                Table.Rows[0].Cells[2].CssClass = "t_act";
            }

            Table.Rows[1].Cells[0].CssClass = "t_white";
            Table.Rows[1].Cells[1].CssClass = "t_white";
            Table.Rows[1].Cells[2].CssClass = "t_white";

            Table.Rows[2].Cells[0].CssClass = "t_act";
            Table.Rows[2].Cells[1].CssClass = "t_act";
            Table.Rows[2].Cells[2].CssClass = "t_act";
        }
예제 #28
0
        public string GetDiskInfo(GridViewDataItemTemplateContainer Container)

        {
            Label diskname = (Label)Container.FindControl("hfNameLabel");

            Label comments    = (Label)Container.FindControl("lblReasons");
            Label detailsspan = (Label)Container.FindControl("detailsspan");

            //System.Web.UI.WebControls.Image Imgforinfo = (System.Web.UI.WebControls.Image)Container.FindControl("Imgforinfo");
            //	System.Drawing.Image Imgforinfo = (System.Drawing.Image)Container.FindControl("Imgforinfo");
            //Image Imgforinfo = (Image)Container.FindControl("");
            System.Web.UI.HtmlControls.HtmlImage Imgforinfo = (System.Web.UI.HtmlControls.HtmlImage)Container.FindControl("Imgforinfo");
            if (comments == null || comments.Text == "")
            {
                detailsspan.Visible = false;
                Imgforinfo.Visible  = false;
            }
            return("");
        }
예제 #29
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     ProductConsultationAndReplyQuery consultationQuery = new ProductConsultationAndReplyQuery();
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     consultationQuery.ProductId = this.productId;
     consultationQuery.IsCount = true;
     consultationQuery.PageIndex = num;
     consultationQuery.PageSize = num2;
     consultationQuery.SortBy = "ConsultationId";
     consultationQuery.SortOrder = SortAction.Desc;
     consultationQuery.HasReplied = true;
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(consultationQuery);
     this.rptProducts.DataSource = productConsultations.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
     this.litProductTitle = (Literal) this.FindControl("litProductTitle");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.imgProductImage = (HtmlImage) this.FindControl("imgProductImage");
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProductTitle.SetWhenIsNotNull(product.ProductName);
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.imgProductImage.Src = product.ThumbnailUrl60;
     PageTitle.AddSiteNameTitle("商品咨询");
 }
예제 #30
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            if (!(HiContext.Current.User is Member))
            {
                System.Web.HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/Scratch.aspx?activityid=" + this.activityid);
                return;
            }
            this.bgimg           = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("bgimg");
            this.litActivityDesc = (System.Web.UI.WebControls.Literal) this.FindControl("litActivityDesc");
            this.litPrizeNames   = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litPrizeUsers   = (Common_PrizeUsers)this.FindControl("litPrizeUsers");
            this.litStartDate    = (System.Web.UI.WebControls.Literal) this.FindControl("litStartDate");
            this.litEndDate      = (System.Web.UI.WebControls.Literal) this.FindControl("litEndDate");
            PageTitle.AddSiteNameTitle("刮刮卡");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                return;
            }
            this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            this.litEndDate.Text   = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
            }
            if (lotteryActivity.StartTime < System.DateTime.Now && System.DateTime.Now < lotteryActivity.EndTime)
            {
                this.litActivityDesc.Text   = lotteryActivity.ActivityDesc;
                this.litPrizeNames.Activity = lotteryActivity;
                this.litPrizeUsers.Activity = lotteryActivity;
                int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
                System.Web.UI.WebControls.Literal expr_1FA = this.litActivityDesc;
                expr_1FA.Text += string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
                return;
            }
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "scriptErro", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
        }
예제 #31
0
		public void NullProperties ()
		{
			HtmlImage img = new HtmlImage ();

			img.Align = null;
			Assert.AreEqual (String.Empty, img.Align, "Align");
			img.Alt = null;
			Assert.AreEqual (String.Empty, img.Alt, "Alt");
			img.Border = -1;
			Assert.AreEqual (-1, img.Border, "Border");
			img.Height = -1;
			Assert.AreEqual (-1, img.Height, "Height");
			img.Src = null;
			Assert.AreEqual (String.Empty, img.Src, "Src");
			img.Width = -1;
			Assert.AreEqual (-1, img.Width, "Width");

			Assert.AreEqual (0, img.Attributes.Count, "Attributes.Count");
		}
예제 #32
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺消息");
            this.imglogo        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imglogo");
            this.hdlogo         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdlogo");
            this.txtstorename   = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtstorename");
            this.txtdescription = (System.Web.UI.HtmlControls.HtmlTextArea) this.FindControl("txtdescription");
            this.txtacctount    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtacctount");
            this.txtStoreTel    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtStoreTel");
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId(false));

            if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                if (userIdDistributors != null)
                {
                    if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                    {
                        this.imglogo.Src = userIdDistributors.Logo;
                    }
                    this.hdlogo.Value         = userIdDistributors.Logo;
                    this.txtstorename.Value   = userIdDistributors.StoreName;
                    this.txtdescription.Value = userIdDistributors.StoreDescription;
                    this.txtacctount.Value    = userIdDistributors.RequestAccount;
                    this.txtStoreTel.Value    = currentMember.CellPhone;
                    this.litJs = (System.Web.UI.WebControls.Literal) this.FindControl("litJs");
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                    if (masterSettings.IsShowDistributorSelfStoreName)
                    {
                        this.litJs.Text = "<script>$(function () {$('#idFile').uploadPreview({ Img: 'imglogo', Width: 100, Height: 100 });$('#savemes').removeAttr('disabled');$('.notmodifyshop').show(); });</script>";
                    }
                    else
                    {
                        this.litJs.Text = "<script>$(function () {$('input,textarea').attr('disabled','true'); });</script>";
                    }
                }
            }
        }
예제 #33
0
        protected override void OnTagProcessed(HtmlGenericControl tag)
        {
            HtmlImage image = new HtmlImage();
            image.Src = tag.Attributes["src"];
            if (BaseHref != null)
            {
                image.Src = HtmlUriExtractor.TryCreate(BaseHref, image.Src);
            }
            image.Alt = tag.Attributes["alt"];

            int width = 0;
            if (int.TryParse(tag.Attributes["width"], out width))
                image.Width = width;

            int height = 0;
            if (int.TryParse(tag.Attributes["height"], out height))
                image.Height = height;

            mImages.Add(image);
        }
예제 #34
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string request = Request.QueryString["image"];
     if (request.Contains(".jpg"))
     {
         HtmlImage hi = new HtmlImage();
         hi.Src = "Effect/WallPapers/" + request;
         hi.Alt = "Full Size WallPaper of " + request;
         ScreenshotPlaceholder.Controls.Add(hi);
     }
     else
     {
         HtmlAnchor ha = new HtmlAnchor();
         ha.HRef = "javascript:alert(&quot;No fooling around the site, buddy. Zasz Rules!&quot;)";
         ha.InnerText = "Security Warning";
         HtmlGenericControl hgc = new HtmlGenericControl("h1");
         hgc.Controls.Add(ha);
         ScreenshotPlaceholder.Controls.Add(hgc);
     }
 }
		private void CreateOpinionInfo(GenericOpinion opinion)
		{
			HtmlTable table = new HtmlTable();

			table.Style["border"] = "1px solid #efae27";
			table.Style[HtmlTextWriterStyle.BackgroundColor] = "#ffffe8";
			table.Width = "100%";

			Controls.Add(table);

			HtmlTableRow row = new HtmlTableRow();

			table.Controls.Add(row);

			HtmlTableCell cellLeft = new HtmlTableCell();

			row.Controls.Add(cellLeft);

			HtmlTableCell cellRight = new HtmlTableCell();

			cellRight.Align = "right";

			row.Controls.Add(cellRight);

			HtmlImage logo = new HtmlImage();

			logo.Src = ControlResources.CancelledLogoUrl;
			logo.Align = "absmiddle";
			logo.Alt = "流程被作废";

			cellLeft.Controls.Add(logo);

			HtmlGenericControl span = new HtmlGenericControl("span");

			span.InnerHtml = HttpUtility.HtmlEncode(opinion.Content).Replace("\n", "<br/>");

			cellLeft.Controls.Add(span);

			cellRight.InnerText = opinion.IssuePerson.DisplayName + " " +
				string.Format("{0:yyyy-MM-dd HH:mm:ss}", opinion.IssueDatetime);
		}
예제 #36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // get the img urls and the status strings
        string[] imgUrlArray = this.ImgArray.Split(',');
        string[] statusArray = this.StatusArray.Split(',');
        string[] valueArray = this.ValueArray.Split(',');
        if ( (imgUrlArray.Length != statusArray.Length) && (statusArray.Length != valueArray.Length) )
        {
            throw new ArgumentException("Number of img does not equal the number of status strings");
        }
        lTitle.Text = this.Title;
        // we need to construct all the icon controls every postback
        string baseUrl = ResolveUrl(this.BaseImgUrl);
        for (int i = 0; i < statusArray.Length; i++)
        {
            string imgId = imgUrlArray[i].Trim();
            string status = statusArray[i].Trim();
            string value = valueArray[i].Trim();
            System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage()
            {
                ID = imgId,
                Src = baseUrl + imgId + "_0.png"
            };
            img.Attributes["onclick"] = "Aqufit.Page." + this.ID + ".selectIcon('" + imgId + "','" + status + "', '" + value + "');";
            img.Attributes["onmouseover"] = "Aqufit.Page." + this.ID + ".switchIcon('" + imgId + "',1);";
            img.Attributes["onmouseout"] = "Aqufit.Page." + this.ID + ".switchIcon('" + imgId + "',0);";
            iconHolder.Controls.Add(img);

            System.Web.UI.HtmlControls.HtmlImage img2 = new System.Web.UI.HtmlControls.HtmlImage()
            {
                Src = baseUrl + imgId + "_1.png"
            };
            imgPreload.Controls.Add(img2);
        }
        //System.Web.UI.HtmlControls.HtmlImage
        if (!Page.IsPostBack && !Page.IsCallback)
        {

        }
    }
예제 #37
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Classes.Database objDB = new Classes.Database();

            SqlDataReader allProducts = objDB.getData("select top 10 * from products where status='active'");

            if (allProducts != null)
            {
                HtmlTable myTable = new HtmlTable();

                while (allProducts.Read())
                {
                    HtmlTableRow myRow = new HtmlTableRow();
                    myTable.Rows.Add(myRow);

                    HtmlTableCell myCell = new HtmlTableCell();
                    myCell.InnerText = "";

                    if (allProducts["image"].ToString() != null)
                    {
                        HtmlImage profilePic = new HtmlImage();
                        profilePic.Height = 50;
                        profilePic.Width = 50;
                        profilePic.Src = "http://" + Request.Url.Authority + "/uploads/" + allProducts["image"].ToString();
                        myCell.Controls.Add(profilePic);
                    }
                    myRow.Cells.Add(myCell);

                    myCell = new HtmlTableCell();
                    myCell.InnerHtml = "<b><u><a href=Product/View-Product.aspx?id=" + allProducts["ID"] + " >" + allProducts["name"].ToString() + "</a></u></b><br>"
                                        + allProducts["description"].ToString();

                    myRow.Cells.Add(myCell);
                }

                objDB.close();
                pnlProduct.Controls.Add(myTable);

            }
        }
예제 #38
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // get the img urls and the status strings
        string[] imgUrlArray = this.ImgArray.Split(',');
        string[] statusArray = this.StatusArray.Split(',');
        string[] valueArray  = this.ValueArray.Split(',');
        if ((imgUrlArray.Length != statusArray.Length) && (statusArray.Length != valueArray.Length))
        {
            throw new ArgumentException("Number of img does not equal the number of status strings");
        }
        lTitle.Text = this.Title;
        // we need to construct all the icon controls every postback
        string baseUrl = ResolveUrl(this.BaseImgUrl);

        for (int i = 0; i < statusArray.Length; i++)
        {
            string imgId  = imgUrlArray[i].Trim();
            string status = statusArray[i].Trim();
            string value  = valueArray[i].Trim();
            System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage()
            {
                ID  = imgId,
                Src = baseUrl + imgId + "_0.png"
            };
            img.Attributes["onclick"]     = "Aqufit.Page." + this.ID + ".selectIcon('" + imgId + "','" + status + "', '" + value + "');";
            img.Attributes["onmouseover"] = "Aqufit.Page." + this.ID + ".switchIcon('" + imgId + "',1);";
            img.Attributes["onmouseout"]  = "Aqufit.Page." + this.ID + ".switchIcon('" + imgId + "',0);";
            iconHolder.Controls.Add(img);

            System.Web.UI.HtmlControls.HtmlImage img2 = new System.Web.UI.HtmlControls.HtmlImage()
            {
                Src = baseUrl + imgId + "_1.png"
            };
            imgPreload.Controls.Add(img2);
        }
        //System.Web.UI.HtmlControls.HtmlImage
        if (!Page.IsPostBack && !Page.IsCallback)
        {
        }
    }
예제 #39
0
        protected void btnReadDocs_Click(object sender, EventArgs e)
        {
            var cab     = this.ddlCabinets.SelectedValue;
            var svc     = new FileItService();
            var lookups = new List <FileItDocumentLookup>();

            /*lookups.Add(new FileItDocumentLookup()
             * {
             *  IndexNumber = 2,
             *  LookupValue = "Test",
             *  Operator = "="
             * });*/
            var result = svc.GetDocuments(txtUser.Text, txtPass.Text, cab, lookups, false);

            result.Documents.ForEach(d =>
            {
                System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                img.Src = d.WebImageBase64Src;
                img.Attributes.Add("title", GenerateToolTip(d, result.Cabinet));
                panOutput.Controls.Add(img);
            });
        }
예제 #40
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("店铺消息");
     this.imglogo = (HtmlImage) this.FindControl("imglogo");
     this.litBackImg = (Literal) this.FindControl("litBackImg");
     this.hdbackimg = (HtmlInputHidden) this.FindControl("hdbackimg");
     this.hdlogo = (HtmlInputHidden) this.FindControl("hdlogo");
     this.txtstorename = (HtmlInputText) this.FindControl("txtstorename");
     this.txtdescription = (HtmlTextArea) this.FindControl("txtdescription");
     DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId());
     if (currentDistributors != null)
     {
         if (!string.IsNullOrEmpty(currentDistributors.Logo))
         {
             this.imglogo.Src = currentDistributors.Logo;
         }
         this.hdbackimg.Value = currentDistributors.BackImage;
         this.txtstorename.Value = currentDistributors.StoreName;
         this.txtdescription.Value = currentDistributors.StoreDescription;
         if (this.litBackImg != null)
         {
             List<string> list = SettingsManager.GetMasterSettings(false).DistributorBackgroundPic.Split(new char[] { '|' }).ToList<string>();
             foreach (string str in list)
             {
                 if (!string.IsNullOrEmpty(str))
                 {
                     if (this.hdbackimg.Value == str)
                     {
                         this.litBackImg.Text = this.litBackImg.Text + "<div class=\"disactive\"><span class=\"mark\"></span><img src=\"" + str + "\"/></div>";
                     }
                     else
                     {
                         this.litBackImg.Text = this.litBackImg.Text + "<div><span class=\"mark\"></span><img src=\"" + str + "\" /></div>";
                     }
                 }
             }
         }
     }
 }
예제 #41
0
    public void VendorLogoMainPage(Properties P)
    {
        try
        {
            using (cmd = new SqlCommand())
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_UI_VendorLogos_MainPage";
                cmd.Connection  = Getconnected.getconnecting();
                using (sdr = cmd.ExecuteReader())
                {
                    if (sdr.HasRows)
                    {
                        while (sdr.Read())
                        {
                            System.Web.UI.HtmlControls.HtmlGenericControl div1 = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            div1.Attributes["class"] = "col-md-3";
                            P.UI_VendorControl.Controls.Add(div1);

                            System.Web.UI.HtmlControls.HtmlAnchor a = new System.Web.UI.HtmlControls.HtmlAnchor();
                            a.HRef = "#slider1";
                            a.Attributes["onclick"] = "#slider1";
                            div1.Controls.Add(a);

                            System.Web.UI.HtmlControls.HtmlImage timerimag = new System.Web.UI.HtmlControls.HtmlImage();
                            //timerimag.Width = 292;
                            //timerimag.Height = 90;
                            timerimag.Src = sdr[1].ToString() + sdr[0].ToString();
                            timerimag.Alt = sdr[0].ToString();
                            a.Controls.Add(timerimag);
                        }
                    }
                }
            }
        }

        catch (Exception ex) { }
    }
예제 #42
0
        protected void btnGetDocsById_Click(object sender, EventArgs e)
        {
            var svc = new FileItService();
            var ids = new List <FileItDocumentIdLookup>();

            ids.Add(new FileItDocumentIdLookup()
            {
                CabinetId  = "houseofrep4101",
                DocumentId = "10000100"
            });

            var result = svc.GetDocumentsById(txtUser.Text, txtPass.Text, ids, false, false);

            panOutput.Controls.Clear();

            result.Documents.ForEach(d =>
            {
                System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                img.Src = d.WebImageBase64Src;
                img.Attributes.Add("title", GenerateToolTip(d, result.Cabinet));
                panOutput.Controls.Add(img);
            });
        }
예제 #43
0
        protected void rptLocalAgencyList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                EyouSoft.Model.CompanyStructure.CompanyInfo model   = (EyouSoft.Model.CompanyStructure.CompanyInfo)e.Item.DataItem;
                System.Web.UI.HtmlControls.HtmlImage        imgLogo = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("imgLogo");

                if (AttachList != null && AttachList.Count > 0)
                {
                    foreach (EyouSoft.Model.CompanyStructure.CompanyAttachInfo AttachModel in AttachList)
                    {
                        if (AttachModel.CompanyId == model.ID)
                        {
                            imgLogo.Src = Utils.GetNewImgUrl(AttachModel.CompanyLogo.ImagePath, 3);
                            break;
                        }
                    }
                }
                System.Web.UI.WebControls.Label        lblCityName = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblCityName");
                EyouSoft.Model.SystemStructure.SysCity cityModel   = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetSysCityModel(model.CityId);
                if (cityModel != null)
                {
                    lblCityName.Text = cityModel.CityName;
                }
                cityModel = null;

                System.Web.UI.WebControls.Literal ltrContactInfo = (System.Web.UI.WebControls.Literal)e.Item.FindControl("ltrContactInfo");
                StringBuilder str = new StringBuilder();
                if (model.ContactInfo != null)
                {
                    str.AppendFormat("<td>联系人:<strong>{0}</strong></td>", model.ContactInfo.ContactName);
                    str.AppendFormat("<td><strong>电&nbsp;&nbsp;话:</strong><span class=\"hong\">{0}</span></td>", model.ContactInfo.Tel);
                    str.AppendFormat("<td>传&nbsp;&nbsp;真:<span class=\"hong\">{0}</span></td>", model.ContactInfo.Fax);
                }
                ltrContactInfo.Text = str.ToString();
            }
        }
예제 #44
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
     {
         base.GotoResourceNotFound("");
     }
     this.bgimg = (HtmlImage) this.FindControl("bgimg");
     this.litActivityDesc = (Literal) this.FindControl("litActivityDesc");
     this.litPrizeNames = (Common_PrizeNames) this.FindControl("litPrizeNames");
     this.litPrizeUsers = (Common_PrizeUsers) this.FindControl("litPrizeUsers");
     this.litStartDate = (Literal) this.FindControl("litStartDate");
     this.litEndDate = (Literal) this.FindControl("litEndDate");
     PageTitle.AddSiteNameTitle("刮刮卡");
     LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);
     if (lotteryActivity == null)
     {
         base.GotoResourceNotFound("");
     }
     this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     this.litEndDate.Text = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
     }
     if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
     {
         this.litActivityDesc.Text = lotteryActivity.ActivityDesc;
         this.litPrizeNames.Activity = lotteryActivity;
         this.litPrizeUsers.Activity = lotteryActivity;
         int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
         this.litActivityDesc.Text = this.litActivityDesc.Text + string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
     }
     else
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "scriptErro", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
     }
 }
예제 #45
0
        private void Bind_Cotrols(Mediachase.WebSaltatoryControl.ControlPlace cp)
        {
            int allcntrls = cp.ControlWrappers.Count;
            HtmlTableRow tr;
            HtmlTableCell td;
            int td_top_pad = 20;
            for (int i = 0; i <= allcntrls; i++)
            {
                if (i == allcntrls && !ControlManager.CurrentView.CustomizeEnabled)
                {
                    break;
                }

                tr = new HtmlTableRow();
                tbMain.Rows.Add(tr);
                tbMain.Style.Remove("border");
                if (ControlManager.CurrentView.CustomizeEnabled)
                {
                    tbMain.Style.Add("border", "1px solid red");
                    td = new HtmlTableCell();
                    tr.Cells.Add(td);
                    HtmlImage img = new HtmlImage();
                    img.Src = "Layouts/Images/insert.gif";
                    img.Width = 14;
                    img.Height = 21;
                    img.Border = 0;
                    img.Attributes.Add("CP_ClientID", this.ClientID);
                    img.Attributes.Add("CP_Index", i.ToString());
                    img.Style.Add("position", "relative");
                    img.Style.Add("top", "-" + ((img.Height) / 2).ToString());
                    img.Style.Add("z-index", "255");
                    img.Style.Add("cursor", "pointer");
                    img.Attributes.Add("onclick", "javascript:" +
                        "CP_ImgClick('" + txtSourceControl.ClientID + "','" + txtSourceNewControl.ClientID + "','" + txtSourceElement.ClientID + "','" + txtImgSubmit.ClientID + "'," + i.ToString() + ");" +
                        Page.ClientScript.GetPostBackEventReference(ImgSubmit, "") + ";");
                    img.Style.Add("display", "none");
                    td.Controls.Add(img);
                    td.VAlign = "top";
                    td.Width = "1%";
                    td.Style.Add("padding-top", td_top_pad.ToString() + "px");
                }
                td = new HtmlTableCell();
                tr.Cells.Add(td);
                td.VAlign = "top";
                td.Width = "99%";
                if (ControlManager.CurrentView.CustomizeEnabled)
                    td.Style.Add("padding-top", td_top_pad.ToString() + "px");
                if (i < allcntrls)
                {
                    if (td.ColSpan > 1)
                    {
                        td.ColSpan = 1;
                    }
                    if (td.InnerHtml != String.Empty)
                    {
                        td.InnerHtml = String.Empty;
                    }

                    Mediachase.UI.Web.Modules.MetaDataBlockViewControl control = (Mediachase.UI.Web.Modules.MetaDataBlockViewControl)cp.ControlWrappers[i].Control;

                    CustomizeView CustomizeControl = (CustomizeView)this.LoadControl("CustomizeView.ascx");
                    CustomizeControl.Path_Img = path_img;
                    CustomizeControl.Title = control.Name;

                    if (!ControlManager.CurrentView.CustomizeEnabled)
                    {
                        if (control.ContainFileds)
                        {
                            CustomizeControl.Control(cp.ControlWrappers[i].Control);
                            //string bmDiv_Html = "<A HREF='../Common/MetaDataEdit.aspx?id=335&class=ProjectsEx_28'><img alt='' src='../Layouts/Images/Edit.gif'/> Edit</A>";
                            //CustomizeControl.DropMenuHtml = bmDiv_Html;
                            if (editlinkhtml != string.Empty)
                            {
                                CustomizeControl.DropMenuHtml = string.Format(editlinkhtml, this.GetObjectId().ToString(), this.ID, i);
                            }
                        }
                        else CustomizeControl.Description = control.Description;
                    }
                    else
                    {
                        CustomizeControl.Description = control.Description;
                        string bmDiv_Id = td.ClientID + "dv";
                        string bmDiv_sUrl = "ShowRelDivBMenu('" + this.ClientID + "'," + i.ToString() + ",'" + txtActiveElement.ClientID + "','" + tbView.MainDivClientID + "', '" + bmDiv_Id + "', 0, 100);";
                        string bmDiv_Html = "<div style='position:relative;left:0px;top:2px;z-index:255;' onmouseover=\"this.className='selectednavover';\" onmouseout=\"this.className='selectednav';\" class='selectednav' id='" + bmDiv_Id + "' onclick=\"" + bmDiv_sUrl + "\">" + "&nbsp;<img alt='' src='" + path_img + "Layouts/Images/Menu/downbtn.gif' border='0' width='9' height='5' align='absmiddle'/>&nbsp;" + "</div>";
                        CustomizeControl.DropMenuHtml = bmDiv_Html;
                    }
                    td.Controls.Add(CustomizeControl);
                }
                else
                {
                    //customizeallow true
                    td.InnerHtml = "<br>";
                    td.ColSpan = 2;
                }
            }
            if (allcntrls == 0 && !ControlManager.CurrentView.CustomizeEnabled)
            {
                this.Visible = false;
                return;
            }
            else this.Visible = true;
            ArrayList BlockMenuItemList = new ArrayList();
            tbView.ClearBlockMenu();
            BlockMenuItemList.Add(new BlockMenuItem("<img alt='' src='" + path_img + "Layouts/Images/Menu/Icons/move.gif' border='0' width='16' height='16' align='absmiddle' title='" + LocRM.GetString("tMove") + "'/> ", LocRM.GetString("tMove"), "CP_Move('" + txtActiveElement.ClientID + "','" + this.ID + "','" + this.ClientID + "','" + tbView.MainDivClientID + "')", ""));
            BlockMenuItemList.Add(new BlockMenuItem("<img alt='' src='" + path_img + "Layouts/Images/Menu/Icons/info.gif' border='0' width='16' height='16' align='absmiddle' title='" + LocRM.GetString("tProperties") + "'/> ", LocRM.GetString("tProperties"), "CP_Properties('" + propertypageurl + "','" + ControlManager.CurrentView.Id + "','" + this.ID + "','" + txtActiveElement.ClientID + "')", ""));
            BlockMenuItemList.Add(new BlockMenuItem("<img alt='' src='" + path_img + "Layouts/Images/Menu/Icons/hide.gif' border='0' width='16' height='16' align='absmiddle' title='" + LocRM.GetString("tDelete") + "'/> ", LocRM.GetString("tDelete"), "if(confirm('" + LocRM.GetString("tWarningControl") + "')){CP_Hide('" + txtHideSubmit.ClientID + "','" + txtActiveElement.ClientID + "');" + Page.ClientScript.GetPostBackEventReference(HideSubmit, "") + "}", ""));
            tbView.AddBlockMenu(tbView.MainDivClientID, BlockMenuItemList);
            if (!ControlManager.CurrentView.CustomizeEnabled)
                tbView.Visible = false;
            //tbView.AddBlockMenu("&nbsp;<img alt='' src='Layouts/Images/Menu/downbtn.gif' border='0' width=9 height=5 align='absmiddle' />&nbsp;" + "", "_divIncGen01", BlockMenuItemList);

            if (!Page.ClientScript.IsClientScriptBlockRegistered("PlaceControlScript"))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PlaceControlScript", "<link href='" + path_img + "Layouts/Styles/menuStyle.css' type='text/css' rel='stylesheet'/><script type='text/javascript' src='" + path_img + "Scripts/ControlPlace.js'></script>");
            }
        }
예제 #46
0
        public void DisplayImages()
        {
            string[] FilesArray       = ReturnFilesArray();
            string[] DirectoriesArray = ReturnDirectoriesArray();
            string   AppPath          = HttpContext.Current.Request.PhysicalApplicationPath;
            string   AppUrl;

            //Get the application's URL
            AppUrl = Request.ApplicationPath;
            if (!AppUrl.EndsWith("/"))
            {
                AppUrl += "/";
            }
            AppUrl = AppUrl.Replace("//", "/");

            GalleryPanel.Controls.Clear();
            if ((FilesArray == null || FilesArray.Length == 0) && (DirectoriesArray == null || DirectoriesArray.Length == 0))
            {
                gallerymessage.Text = NoImagesMessage + ": " + RootImagesFolder.Value;
            }
            else
            {
                string ImageFileName     = string.Empty;
                string ImageFileLocation = string.Empty;

                int thumbWidth  = 94;
                int thumbHeight = 94;

                if (CurrentImagesFolder.Value != RootImagesFolder.Value)
                {
                    System.Web.UI.HtmlControls.HtmlImage myHtmlImage = new System.Web.UI.HtmlControls.HtmlImage();
                    myHtmlImage.Src = Rainbow.Settings.Path.ApplicationRoot + "/DesktopModules/FCK/filemanager/folder.gif";
                    myHtmlImage.Attributes["unselectable"] = "on";
                    myHtmlImage.Attributes["align"]        = "absmiddle";
                    myHtmlImage.Attributes["vspace"]       = "36";

                    string ParentFolder = CurrentImagesFolder.Value.Substring(0, CurrentImagesFolder.Value.LastIndexOf("\\"));

                    System.Web.UI.WebControls.Panel myImageHolder = new System.Web.UI.WebControls.Panel();
                    myImageHolder.CssClass = "imageholder";
                    myImageHolder.Attributes["unselectable"] = "on";
                    myImageHolder.Attributes["onclick"]      = "divClick(this,'');";
                    myImageHolder.Attributes["ondblclick"]   = "gotoFolder('" + RootImagesFolder.Value + "','" + ParentFolder.Replace("\\", "\\\\") + "');";
                    myImageHolder.Controls.Add(myHtmlImage);

                    System.Web.UI.WebControls.Panel myMainHolder = new System.Web.UI.WebControls.Panel();
                    myMainHolder.CssClass = "imagespacer";
                    myMainHolder.Controls.Add(myImageHolder);

                    System.Web.UI.WebControls.Panel myTitleHolder = new System.Web.UI.WebControls.Panel();
                    myTitleHolder.CssClass = "titleHolder";
                    myTitleHolder.Controls.Add(new LiteralControl("Up"));
                    myMainHolder.Controls.Add(myTitleHolder);

                    GalleryPanel.Controls.Add(myMainHolder);
                }

                foreach (string _Directory in DirectoriesArray)
                {
                    try
                    {
                        string DirectoryName = _Directory.ToString();

                        System.Web.UI.HtmlControls.HtmlImage myHtmlImage = new System.Web.UI.HtmlControls.HtmlImage();
                        myHtmlImage.Src = Rainbow.Settings.Path.ApplicationRoot + "/DesktopModules/FCK/filemanager/folder.gif";
                        myHtmlImage.Attributes["unselectable"] = "on";
                        myHtmlImage.Attributes["align"]        = "absmiddle";
                        myHtmlImage.Attributes["vspace"]       = "29";

                        System.Web.UI.WebControls.Panel myImageHolder = new System.Web.UI.WebControls.Panel();
                        myImageHolder.CssClass = "imageholder";
                        myImageHolder.Attributes["unselectable"] = "on";
                        myImageHolder.Attributes["onclick"]      = "divClick(this);";
                        myImageHolder.Attributes["ondblclick"]   = "gotoFolder('" + RootImagesFolder.Value + "','" + DirectoryName.Replace(AppPath, string.Empty).Replace("\\", "\\\\") + "');";
                        myImageHolder.Controls.Add(myHtmlImage);

                        System.Web.UI.WebControls.Panel myMainHolder = new System.Web.UI.WebControls.Panel();
                        myMainHolder.CssClass = "imagespacer";
                        myMainHolder.Controls.Add(myImageHolder);

                        System.Web.UI.WebControls.Panel myTitleHolder = new System.Web.UI.WebControls.Panel();
                        myTitleHolder.CssClass = "titleHolder";
                        myTitleHolder.Controls.Add(new LiteralControl(DirectoryName.Replace(AppPath + CurrentImagesFolder.Value + "\\", string.Empty)));
                        myMainHolder.Controls.Add(myTitleHolder);

                        GalleryPanel.Controls.Add(myMainHolder);
                    }
                    catch
                    {
                        // nothing for error
                    }
                }

                foreach (string ImageFile in FilesArray)
                {
                    try
                    {
                        ImageFileName     = ImageFile.ToString();
                        ImageFileName     = ImageFileName.Substring(ImageFileName.LastIndexOf("\\") + 1);
                        ImageFileLocation = AppUrl;
//						ImageFileLocation = ImageFileLocation.Substring(ImageFileLocation.LastIndexOf("\\")+1);
                        //galleryfilelocation += "/";
                        ImageFileLocation += CurrentImagesFolder.Value;
                        ImageFileLocation += "/";
                        ImageFileLocation += ImageFileName;
                        ImageFileLocation  = ImageFileLocation.Replace("//", "/");
                        System.Web.UI.HtmlControls.HtmlImage myHtmlImage = new System.Web.UI.HtmlControls.HtmlImage();
                        myHtmlImage.Src = ImageFileLocation;
                        System.Drawing.Image myImage = System.Drawing.Image.FromFile(ImageFile.ToString());
                        myHtmlImage.Attributes["unselectable"] = "on";
                        //myHtmlImage.border=0;

                        // landscape image
                        if (myImage.Width > myImage.Height)
                        {
                            if (myImage.Width > thumbWidth)
                            {
                                myHtmlImage.Width  = thumbWidth;
                                myHtmlImage.Height = Convert.ToInt32(myImage.Height * thumbWidth / myImage.Width);
                            }
                            else
                            {
                                myHtmlImage.Width  = myImage.Width;
                                myHtmlImage.Height = myImage.Height;
                            }
                            // portrait image
                        }
                        else
                        {
                            if (myImage.Height > thumbHeight)
                            {
                                myHtmlImage.Height = thumbHeight;
                                myHtmlImage.Width  = Convert.ToInt32(myImage.Width * thumbHeight / myImage.Height);
                            }
                            else
                            {
                                myHtmlImage.Width  = myImage.Width;
                                myHtmlImage.Height = myImage.Height;
                            }
                        }

                        if (myHtmlImage.Height < thumbHeight)
                        {
                            myHtmlImage.Attributes["vspace"] = Convert.ToInt32((thumbHeight / 2) - (myHtmlImage.Height / 2)).ToString();
                        }


                        System.Web.UI.WebControls.Panel myImageHolder = new System.Web.UI.WebControls.Panel();
                        myImageHolder.CssClass = "imageholder";
                        myImageHolder.Attributes["onclick"]    = "divClick(this,'" + ImageFileName + "');";
                        myImageHolder.Attributes["ondblclick"] = "returnImage('" + ImageFileLocation.Replace("\\", "/") + "','" + myImage.Width.ToString() + "','" + myImage.Height.ToString() + "');";
                        myImageHolder.Controls.Add(myHtmlImage);


                        System.Web.UI.WebControls.Panel myMainHolder = new System.Web.UI.WebControls.Panel();
                        myMainHolder.CssClass = "imagespacer";
                        myMainHolder.Controls.Add(myImageHolder);

                        System.Web.UI.WebControls.Panel myTitleHolder = new System.Web.UI.WebControls.Panel();
                        myTitleHolder.CssClass = "titleHolder";
                        myTitleHolder.Controls.Add(new LiteralControl(ImageFileName + "<BR>" + myImage.Width.ToString() + "x" + myImage.Height.ToString()));
                        myMainHolder.Controls.Add(myTitleHolder);

                        //GalleryPanel.Controls.Add(myImage);
                        GalleryPanel.Controls.Add(myMainHolder);

                        myImage.Dispose();
                    }
                    catch
                    {
                    }
                }
                gallerymessage.Text = string.Empty;
            }
        }
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            btnNewAccount.Visible = !GetAttributeValue( "HideNewAccount" ).AsBoolean();

            phExternalLogins.Controls.Clear();

            int activeAuthProviders = 0;

            var selectedGuids = new List<Guid>();
            GetAttributeValue( "RemoteAuthorizationTypes" ).SplitDelimitedValues()
                .ToList()
                .ForEach( v => selectedGuids.Add( v.AsGuid() ) );

            // Look for active external authentication providers
            foreach ( var serviceEntry in AuthenticationContainer.Instance.Components )
            {
                var component = serviceEntry.Value.Value;

                if ( component.IsActive &&
                    component.RequiresRemoteAuthentication &&
                    selectedGuids.Contains( component.EntityType.Guid ) )
                {
                    string loginTypeName = component.GetType().Name;

                    // Check if returning from third-party authentication
                    if ( !IsPostBack && component.IsReturningFromAuthentication( Request ) )
                    {
                        string userName = string.Empty;
                        string returnUrl = string.Empty;
                        if ( component.Authenticate( Request, out userName, out returnUrl ) )
                        {
                            LoginUser( userName, returnUrl, false );
                            break;
                        }
                    }

                    activeAuthProviders++;

                    LinkButton lbLogin = new LinkButton();
                    phExternalLogins.Controls.Add( lbLogin );
                    lbLogin.AddCssClass( "btn btn-authenication " + loginTypeName.ToLower() );
                    lbLogin.ID = "lb" + loginTypeName + "Login";
                    lbLogin.Click += lbLogin_Click;
                    lbLogin.CausesValidation = false;

                    if ( !string.IsNullOrWhiteSpace( component.ImageUrl() ) )
                    {
                        HtmlImage img = new HtmlImage();
                        lbLogin.Controls.Add( img );
                        img.Attributes.Add( "style", "border:none" );
                        img.Src = Page.ResolveUrl( component.ImageUrl() );
                    }
                    else
                    {
                        lbLogin.Text = loginTypeName;
                    }
                }
            }

            // adjust the page if there are no social auth providers
            if ( activeAuthProviders == 0 )
            {
                divSocialLogin.Visible = false;
                divOrgLogin.RemoveCssClass( "col-sm-6" );
                divOrgLogin.AddCssClass( "col-sm-12" );
            }
        }
예제 #48
0
        public static bool IsLeapYear()
        {
            int x     = 0;
            int y     = 0;
            int value = 0;

            int al = 0;
            int au = 0;

            string t = "";
            string g = "";

            if (x == 0)
            {
                t = "Actor";
            }
            else if (x == 1)
            {
                t = "Model";
            }
            else if (x == 2)
            {
                t = "Singer";
            }

            if (y == 0)
            {
                g = "Male";
            }
            else
            {
                g = "Female";
            }


            if (value == 0)
            {
                al = 18;
                au = 22;
            }
            else if (value == 1)
            {
                al = 23;
                au = 26;
            }
            else if (value == 2)
            {
                al = 27;
                au = 31;
            }
            else if (value == 3)
            {
                al = 32;
                au = 36;
            }

            myDAL obj   = new myDAL();
            int   index = 0;

            System.Data.DataTable dt = obj.Search(t, g, al, au);



            foreach (DataRow row in dt.Rows)
            {
                string ID     = row["ID"].ToString();
                string Name   = row["Name"].ToString();
                string Age    = row["Age"].ToString();
                string weight = row["Weight"].ToString();
                string waist  = row["Waist"].ToString();
                string pic1   = row["Picture1"].ToString();
                string pic2   = row["Picture2"].ToString();
                string pic3   = row["Picture3"].ToString();
                string videos = row["Video"].ToString();


                var imagediv = new HtmlGenericControl("div");
                //imagediv.Attributes.Add("class", "mt-5 mb-5");

                var divhover = new HtmlGenericControl("div");
                divhover.Attributes.Add("class", "hovereffect col-lg-4 col-sm-6 col-xs-12 mt-2 mb-2");
                divhover.Style.Add("min-heigh", "509px");
                divhover.Style.Add("min-width", "309px");



                System.Web.UI.HtmlControls.HtmlImage x1 = new System.Web.UI.HtmlControls.HtmlImage();
                x1.Attributes.Add("src", pic1);
                //x1.Attributes.Add("class", "img-responsive");
                x1.Attributes.Add("min-heigh", "509px");
                x1.Attributes.Add("min-width", "309px");



                var divoverlay = new HtmlGenericControl("div");
                divoverlay.Attributes.Add("class", "overlay");

                var a2 = new HtmlGenericControl("a");
                a2.Attributes.Add("class", "info");
                a2.InnerText = "Video";
                a2.Attributes.Add("data-toggle", "modal");
                a2.Attributes.Add("data-target", ".bd-example-modal-lg" + index.ToString() + "1");


                var a3 = new HtmlGenericControl("a");
                a3.Attributes.Add("class", "info");
                a3.InnerText = "Pictures";
                a3.Attributes.Add("data-toggle", "modal");
                a3.Attributes.Add("data-target", ".bd-example-modal-lg" + index.ToString() + "11");

                Button a4 = new Button();
                a4.Attributes.Add("class", "info");
                a4.Text = "Add";
                a4.Attributes.Add("runat", "server");
                // a4.Click += new EventHandler(addtocart);
                a4.CommandArgument = ID.ToString();

                var button = new HtmlGenericControl("a");
                button.Attributes.Add("class", "info");



                button.Attributes.Add("data-toggle", "modal");
                button.Attributes.Add("data-target", ".bd-example-modal-lg" + index.ToString());
                button.InnerText = "Details";


                var pop1 = new HtmlGenericControl("div");
                pop1.Attributes.Add("class", "modal fade bd-example-modal-lg" + index.ToString());
                pop1.Attributes.Add("tabindex", "-1");
                pop1.Attributes.Add("role", "dialog");
                pop1.Attributes.Add("style", "display:none");
                pop1.Attributes.Add("aria-labelledby", "myLargeModalLabel");
                pop1.Attributes.Add("aria-hidden", "true");


                var pop11 = new HtmlGenericControl("div");
                pop11.Attributes.Add("class", "modal fade bd-example-modal-lg" + index.ToString() + "1");
                pop11.Attributes.Add("tabindex", "-1");
                pop11.Attributes.Add("role", "dialog");
                pop11.Attributes.Add("style", "display:none");
                pop11.Attributes.Add("aria-labelledby", "myLargeModalLabel");
                pop11.Attributes.Add("aria-hidden", "true");


                var pop111 = new HtmlGenericControl("div");
                pop111.Attributes.Add("class", "modal fade bd-example-modal-lg" + index.ToString() + "11");
                pop111.Attributes.Add("tabindex", "-1");
                pop111.Attributes.Add("role", "dialog");
                pop111.Attributes.Add("style", "display:none");
                pop111.Attributes.Add("aria-labelledby", "myLargeModalLabel");
                pop111.Attributes.Add("aria-hidden", "true");



                var pop2 = new HtmlGenericControl("div");
                pop2.Attributes.Add("class", "modal-dialog modal-lg");

                var pop22 = new HtmlGenericControl("div");
                pop22.Attributes.Add("class", "modal-dialog modal-lg");

                var pop222 = new HtmlGenericControl("div");
                pop222.Attributes.Add("class", "modal-dialog modal-lg");

                var pop3 = new HtmlGenericControl("div");
                pop3.Attributes.Add("class", "modal-header");

                var pop33 = new HtmlGenericControl("div");
                pop33.Attributes.Add("class", "modal-header");

                var pop333 = new HtmlGenericControl("div");
                pop333.Attributes.Add("class", "modal-header");

                var h3 = new HtmlGenericControl("h3");
                h3.ID = "exampleModalLongTitle1";
                h3.Attributes.Add("class", "modal-title w3-container w3-gray");
                h3.InnerText = ID;
                pop3.Controls.Add(h3);

                var cross = new HtmlGenericControl("button");
                cross.Attributes.Add("class", "close");
                cross.Attributes.Add("data-dismiss", "modal");
                cross.InnerText = "x";
                cross.Attributes.Add("type", "button");

                var cross1 = new HtmlGenericControl("button");
                cross1.Attributes.Add("class", "close");
                cross1.Attributes.Add("data-dismiss", "modal");
                cross1.InnerText = "x";
                cross1.Attributes.Add("type", "button");

                var cross2 = new HtmlGenericControl("button");
                cross2.Attributes.Add("class", "close");
                cross2.Attributes.Add("data-dismiss", "modal");
                cross2.InnerText = "x";
                cross2.Attributes.Add("type", "button");


                pop3.Controls.Add(cross);
                pop33.Controls.Add(cross1);
                pop333.Controls.Add(cross2);


                var con = new HtmlGenericControl("div");
                con.Attributes.Add("class", "modal-content w3-modal-content w3-animate-zoom");
                con.Style.Add("font-size", "20px");

                var con2 = new HtmlGenericControl("div");
                con.Attributes.Add("class", "modal-content w3-modal-content w3-animate-zoom");
                con.Style.Add("font-size", "20px");

                var con3 = new HtmlGenericControl("div");
                con.Attributes.Add("class", "modal-content w3-modal-content w3-animate-zoom");
                con.Style.Add("font-size", "20px");



                int i = 0;
                foreach (DataColumn dc in dt.Columns)
                {
                    if (i == 1)
                    {
                        goto here;
                    }
                    var d1 = new HtmlGenericControl("div");
                    d1.Style.Add("marign-top", "10px");

                    var d2 = new HtmlGenericControl("span");
                    d2.Style.Add("marign-top", "20px");
                    d2.Attributes.Add("class", "w3-container w3-blue");
                    d2.InnerText = dc.ColumnName.ToString();

                    var d3 = new HtmlGenericControl("label");

                    d3.InnerText = row[i].ToString();

                    //d1.Controls.Add(d2);
                    //d1.Controls.Add(d3);

                    con.Controls.Add(d2);
                    con.Controls.Add(d3);
here:
                    i++;
                    if (i == 18)
                    {
                        break;
                    }
                }


                var close = new HtmlGenericControl("button");
                close.Attributes.Add("class", "btn btn-primary");
                close.InnerText = "Close";
                close.Attributes.Add("data-dismiss", "modal");

                var close1 = new HtmlGenericControl("button");
                close1.Attributes.Add("class", "btn btn-primary");
                close1.InnerText = "Close";
                close1.Attributes.Add("data-dismiss", "modal");

                var close2 = new HtmlGenericControl("button");
                close2.Attributes.Add("class", "btn btn-primary");
                close2.InnerText = "Close";
                close2.Attributes.Add("data-dismiss", "modal");

                var vid = new HtmlGenericControl("iframe");

                vid.Attributes.Add("frameborder", "0");
                vid.Attributes.Add("allow", "autoplay; encrypted-media");
                vid.Attributes.Add("src", videos);
                vid.Attributes.Add("height", "500px");
                vid.Attributes.Add("width", "100%");
                con2.Controls.Add(vid);



                con.Controls.Add(close);
                pop2.Controls.Add(pop3);
                pop2.Controls.Add(con);

                pop1.Controls.Add(pop2);


                con2.Controls.Add(close1);
                pop22.Controls.Add(pop33);
                pop22.Controls.Add(con2);

                pop11.Controls.Add(pop22);


                con3.Controls.Add(close2);
                pop222.Controls.Add(pop333);
                pop222.Controls.Add(con3);

                pop111.Controls.Add(pop222);



                //          <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="height:200px">
                //<div class="hovereffect">
                //    <img class="img-responsive" src="http://placehold.it/350x200" alt="">
                //    <div class="overlay">

                //       <a class="info" href="index.aspx">link here</a>
                //        <a class="info" href="index.aspx">link here</a>
                //        <a class="info" href="index.aspx">link here</a>

                //    </div>
                //</div>



                imagediv.Controls.Add(divhover);
                divhover.Controls.Add(x1);
                divhover.Controls.Add(divoverlay);
                divoverlay.Controls.Add(a2);
                divoverlay.Controls.Add(a3);
                divoverlay.Controls.Add(a4);
                divoverlay.Controls.Add(button);
                imagediv.Controls.Add(pop1);
                imagediv.Controls.Add(pop11);
                imagediv.Controls.Add(pop11);
                // panel1.Controls.Add(imagediv);


                index++;
            }

            return(true);
        }
예제 #49
0
        public void Render(ref System.Web.UI.WebControls.WebControl owner, ref TreeView treeView, int level, ref int currentNodeId, bool lastItem, string parentBorder)
        {
            currentNodeId += 1;
            Table     NodeTable = new Table();
            TableRow  NodeRow   = new TableRow();
            TableCell TextCell  = new TableCell();

            NodeTable.CellPadding = 0;
            NodeTable.CellSpacing = 0;
            if (parentBorder.Length > 0)
            {
                TableCell ParentBorderCell  = new TableCell();
                Label     ParentBorderLabel = new Label();
                ParentBorderLabel.Text = parentBorder;
                ParentBorderCell.Controls.Add(ParentBorderLabel);
                NodeRow.Controls.Add(ParentBorderCell);
            }
            if (lastItem)
            {
                parentBorder += "<img src='" + treeView.ImagesFolder + "blank-node.gif'>";
            }
            else
            {
                parentBorder += "<img src='" + treeView.ImagesFolder + "edge-node.gif'>";
            }
            TableCell ExpandImageCell = new TableCell();

            RenderExpandImage(ExpandImageCell, ref treeView, lastItem, currentNodeId);
            NodeRow.Controls.Add(ExpandImageCell);
            if (this.Selector != SelectionMode.None)
            {
                TableCell SelectorCell = new TableCell();
                if (this.Selector == SelectionMode.CheckBox)
                {
                    HtmlInputCheckBox CBox = new HtmlInputCheckBox();
                    CBox.Style.Add("height", "14");
                    CBox.Style.Add("width", "14");
                    CBox.ID      = treeView.UniqueID + "_selected";
                    CBox.Checked = this.Selected;
                    CBox.Value   = currentNodeId.ToString();
                    SelectorCell.Controls.Add(CBox);
                }
                else if (this.Selector == SelectionMode.RadioButton)
                {
                    HtmlInputRadioButton RButton = new HtmlInputRadioButton();
                    RButton.Style.Add("height", "15");
                    RButton.Style.Add("width", "15");
                    RButton.ID      = treeView.UniqueID + "_selected";
                    RButton.Checked = this.Selected;
                    RButton.Value   = currentNodeId.ToString();
                    SelectorCell.Controls.Add(RButton);
                }
                NodeRow.Controls.Add(SelectorCell);
            }
            if (Image.Length > 0)
            {
                TableCell ImageCell = new TableCell();
                TableCell SpaceCell = new TableCell();
                System.Web.UI.HtmlControls.HtmlImage NodeImage = new System.Web.UI.HtmlControls.HtmlImage();
                NodeImage.Src    = Image;
                NodeImage.Border = 0;
                NodeImage.Attributes.Add("align", "absmiddle");
                Label SpaceLabel = new Label();
                SpaceLabel.Text = "&nbsp;";
                SpaceCell.Controls.Add(SpaceLabel);
                if (Link.Length > 0)
                {
                    HtmlAnchor a = CreateLink(treeView);
                    a.Controls.Add(NodeImage);
                    ImageCell.Controls.Add(a);
                }
                else
                {
                    ImageCell.Controls.Add(NodeImage);
                    ImageCell.Attributes.Add("onClick", treeView.GetPostBackClientEvent("C" + currentNodeId.ToString()));
                }
                NodeRow.Controls.Add(ImageCell);
                NodeRow.Controls.Add(SpaceCell);
            }
            Label TextLabel = new Label();

            TextLabel.Text           = Text;
            TextCell.HorizontalAlign = HorizontalAlign.Left;
            TextCell.Wrap            = false;
            if (Link.Length > 0)
            {
                HtmlAnchor a = CreateLink(treeView);
                a.Controls.Add(TextLabel);
                TextCell.Controls.Add(a);
            }
            else
            {
                TextLabel.Style.Add("cursor", "hand");
                TextCell.Controls.Add(TextLabel);
                TextCell.Attributes.Add("onClick", treeView.GetPostBackClientEvent("C" + currentNodeId.ToString()));
            }
            NodeRow.Controls.Add(TextCell);
            NodeTable.Controls.Add(NodeRow);
            owner.Controls.Add(NodeTable);
            if (this.Items.Count > 0 & this.Open)
            {
                Items.Render(ref owner, ref treeView, level + 1, ref currentNodeId, parentBorder);
            }
        }
예제 #50
0
        private HtmlGenericControl generateDevice(Device device, DatabaseEntities db)
        {
            var brandQuery = db.Brands.Where(b => b.brand_id == device.brand_id);
            var brand = brandQuery.FirstOrDefault<Brand>();

            var batteryQuery = db.Batteries.Where(b => b.battery_id == device.battery_id);
            var battery = batteryQuery.FirstOrDefault<Battery>();

            var displayQuery = db.Displays.Where(b => b.display_id == device.display_id);
            var display = displayQuery.FirstOrDefault<Display>();

            var operatingSystemQuery = db.OperatingSystems.Where(b => b.operating_system_id == device.operating_system_id);
            var operatingSystem = operatingSystemQuery.FirstOrDefault<OperatingSystem>();

            var processorQuery = db.Processors.Where(b => b.processor_id == device.processor_id);
            var processor = processorQuery.FirstOrDefault<Processor>();

            var flashToDeviceQuery = db.FlashToDevices.Where(b => b.device_id == device.device_id);
            List<FlashToDevice> flashToDeviceList = flashToDeviceQuery.ToList<FlashToDevice>();
            string flashTypes = "";

            foreach (FlashToDevice type in flashToDeviceList)
            {
                var flashQuery = db.Flashes.Where(b => b.flash_id == type.flash_id);
                var flash = flashQuery.FirstOrDefault<Flash>();
                flashTypes += flash.type + " ";
            }
            if (flashTypes.Trim() == "")
                flashTypes = "Отсутсвует";

            HtmlGenericControl result = new HtmlGenericControl("div");

            HtmlGenericControl descriptionDiv = new HtmlGenericControl("div");
            descriptionDiv.Attributes["class"] = "device";
            HtmlImage img = new HtmlImage();
            img.Src = String.Format("~/images/{0}/{1} {2} .jpg", brand.name, brand.name, device.device_name);

            HtmlGenericControl h2 = new HtmlGenericControl("h2");
            h2.InnerText = "Описание";

            HtmlGenericControl pAboutBrand = new HtmlGenericControl("p");
            pAboutBrand.InnerText = String.Format("{0}", brand.information);

            //HtmlGenericControl pShortInformation = new HtmlGenericControl("p");
            //pShortInformation.InnerText = String.Format("{0}, экран {1}, {2} ( {3} ), ОЗУ {4}, аккумулятор {5}",
            //    operatingSystem.name, device.screen_size, display.type, device.screen_resolution, device.ram, device.battery_capacity);

            HtmlGenericControl clrDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
            clrDiv.Attributes["class"] = "clr";

            HtmlGenericControl priceDiv = new HtmlGenericControl("DIV");
            priceDiv.Attributes["class"] = "price";
            priceDiv.InnerText = String.Format("{0}", device.price);

            descriptionDiv.Controls.Add(img);
            descriptionDiv.Controls.Add(h2);
            descriptionDiv.Controls.Add(pAboutBrand);
            //descriptionDiv.Controls.Add(pShortInformation);
            descriptionDiv.Controls.Add(clrDiv);
            descriptionDiv.Controls.Add(priceDiv);

            HtmlGenericControl h2Descr = new HtmlGenericControl("h2");
            h2Descr.InnerText = "Характеристики";

            result.Controls.Add(descriptionDiv);
            result.Controls.Add(h2Descr);

            HtmlGenericControl tableGeneral = new HtmlGenericControl("table");
            string[] keysGeneral = { "Производитель", "Операционная система", "Год выпуска"};
            string[] valuesGeneral = { brand.name, operatingSystem.name, device.release_year };
            tableGeneral = createTable("Общее", keysGeneral, valuesGeneral);
            result.Controls.Add(tableGeneral);

            HtmlGenericControl tableDisplay = new HtmlGenericControl("table");
            string[] keysDisplay = { "Тип дисплея", "Размер экрана", "Разрешение экрана", "Информация о техологии дисплея"};
            string[] valuesDisplay = { display.type, device.screen_size, device.screen_resolution, display.information };
            tableDisplay = createTable("Дисплей", keysDisplay, valuesDisplay);
            result.Controls.Add(tableDisplay);

            HtmlGenericControl tableProcessor = new HtmlGenericControl("table");
            string[] keysProcessor = { "Тип процессора" };
            string[] valuesProcessor = new string[1];
            if (processor == null)
                valuesProcessor[0] = "Неизвестно";
            else
                valuesProcessor[0] = processor.name;
            tableProcessor = createTable("Процессор", keysProcessor, valuesProcessor);
            result.Controls.Add(tableProcessor);

            HtmlGenericControl tableMemory = new HtmlGenericControl("table");
            string[] keysMemory = { "Оперативная память", "Встроенная память", "Поддержка карт памяти" };
            string[] valuesMemory = { device.ram, device.internal_memory, flashTypes};
            tableMemory = createTable("Память", keysMemory, valuesMemory);
            result.Controls.Add(tableMemory);

            HtmlGenericControl tableBattery = new HtmlGenericControl("table");
            string[] keysBattery = { "Тип батареи", "Eмкость батареи", "Информация о технологии батареи" };
            string[] valuesBatery = { battery.type, device.battery_capacity, battery.information };
            tableBattery = createTable("Батарея", keysBattery, valuesBatery);
            result.Controls.Add(tableBattery);

            return result;
        }
예제 #51
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("错误的商品信息!");
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSoldCount        = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.productImage        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImage");
            this.productLink         = (System.Web.UI.WebControls.HyperLink) this.FindControl("productLink");
            this.txtTotal            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            if (productSimpleInfo == null)
            {
                base.GotoResourceNotFound("该件商品已经被管理员删除");
            }
            this.litProdcutName.SetWhenIsNotNull(productSimpleInfo.ProductName);
            this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(productSimpleInfo.ShowSaleCounts.ToString());
            if (!string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl180))
            {
                this.productImage.Src = productSimpleInfo.ThumbnailUrl180;
            }
            else
            {
                this.productImage.Src = masterSettings.DefaultProductThumbnail5;
            }
            this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + productSimpleInfo.ProductId;
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.productId = this.productId;
            productReviewQuery.IsCount   = true;
            productReviewQuery.PageIndex = pageIndex;
            productReviewQuery.PageSize  = pageSize;
            productReviewQuery.SortBy    = "ReviewId";
            productReviewQuery.SortOrder = SortAction.Desc;
            this.rptProducts             = (AliOHTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(productReviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
예제 #52
0
		private void RenderCallBackUrls(List<AppLogOffCallBackUrl> urls)
		{
			foreach (AppLogOffCallBackUrl au in urls)
			{
				HtmlGenericControl tRow = new HtmlGenericControl("div");
				appsContainer.Controls.Add(tRow);

				tRow.Attributes["class"] = "form-group";

				HtmlGenericControl imgCell = new HtmlGenericControl("div");

				tRow.Controls.Add(imgCell);
				imgCell.Attributes["class"] = "col-lg-2 col-md-2 col-sm-2 col-xs-2";

				HtmlImage img = new HtmlImage();
				img.Align = "absmiddle";
				img.Src = au.LogOffCallBackUrl;
				img.Alt = img.Src;
				imgCell.Controls.Add(img);

				HtmlGenericControl txtCell = new HtmlGenericControl("div");

				tRow.Controls.Add(txtCell);

				txtCell.Attributes["class"] = "col-lg-10 col-md-10 col-sm-10 col-xs-10";

				txtCell.InnerText = string.Format(Translate("退出应用程序{0}"), au.AppID);
			}
		}
예제 #53
0
        private void loadDevicePath(Device device, DatabaseEntities db)
        {
            var brandQuery = db.Brands.Where(b => b.brand_id == device.brand_id);
            var brand = brandQuery.FirstOrDefault<Brand>();

            HtmlImage firstArrow = new HtmlImage();
            firstArrow.Src = "~/images/directory_arrow.png";
            HtmlGenericControl brandDiv = new HtmlGenericControl("div");
            brandDiv.Attributes["class"] = "directory_path";
            //HtmlGenericControl brandAnchor = new HtmlGenericControl("a");
            HtmlAnchor brandAnchor = new HtmlAnchor();
            brandAnchor.HRef = "~/?brand=" + brand.name;
            brandAnchor.Attributes["id"] = "firstDirectory";
            brandAnchor.InnerText = brand.name;
            brandDiv.Controls.Add(brandAnchor);

            HtmlImage secondArrow = new HtmlImage();
            secondArrow.Src = "~/images/directory_arrow.png";

            HtmlGenericControl deviceDiv = new HtmlGenericControl("div");
            deviceDiv.Attributes["class"] = "directory_path";
            //HtmlGenericControl deviceAnchor = new HtmlGenericControl("a");
            HtmlAnchor deviceAnchor = new HtmlAnchor();
            deviceAnchor.HRef = "~/Device.aspx?id=" + device.device_id;
            deviceAnchor.Attributes["id"] = "secondDirectory";
            deviceAnchor.InnerText = device.device_name;
            deviceDiv.Controls.Add(deviceAnchor);

            path.Controls.Add(firstArrow);
            path.Controls.Add(brandDiv);
            path.Controls.Add(secondArrow);
            path.Controls.Add(deviceDiv);
        }
예제 #54
0
        private bool SetRestaurantMap(FileUpload fileUpload, HtmlImage img, string deleteImg, string configPath, ref string imgUrl, ref string imgUrl_Nail)
        {
            if (!string.IsNullOrEmpty(fileUpload.PostedFile.FileName))
            {
                if (!fileUpload.PostedFile.ContentType.Contains("image"))
                {
                    this.lMsg.InnerText = string.Format("保存失败,原因:文件{0}必须是图片格式!", fileUpload.PostedFile.FileName);
                    return false;
                }
                if (fileUpload.PostedFile.ContentLength > (1024 * 1024 * 2))
                {
                    this.lMsg.InnerText = string.Format("保存失败,原因:文件{0}大小不能超过2M!", fileUpload.PostedFile.FileName);
                    return false;
                }
                if (!Directory.Exists(Server.MapPath(configPath)))
                    Directory.CreateDirectory(Server.MapPath(configPath));
                var ext = Path.GetExtension(fileUpload.PostedFile.FileName);
                var fileName = Guid.NewGuid().ToString();
                var filePath = Path.Combine(configPath, fileName) + ext;
                var filePath_Nail = Path.Combine(configPath, fileName) + "_nail" + ext;

                try
                {
                    fileUpload.SaveAs(Server.MapPath(filePath));
                    ImageHelper imageHelper = new ImageHelper(Server.MapPath(filePath));
                    imageHelper.GetReducedImage(ConfigHelper.GetConfigInt("FOOD_IMAGE_MAX_SIZE"), Server.MapPath(filePath_Nail));
                }
                catch (Exception ex)
                {
                    this.lMsg.InnerText = string.Format("保存失败,原因:{0}!", ex.ToString());
                    return false;
                }

                imgUrl = filePath.Replace(@"\", @"/");
                imgUrl_Nail = filePath_Nail.Replace(@"\", @"/");
                return true;
            }
            else
            {
                if (deleteImg.Contains(img.ClientID))
                {
                    imgUrl = string.Empty;
                    imgUrl_Nail = string.Empty;
                    if (img.Src != "Images/OriginalImages/pic-none.png")
                    {
                        try
                        {
                            var filePath = Server.MapPath(img.Src);
                            File.Delete(filePath);
                            var ext = Path.GetExtension(filePath);
                            var filePath_Nail = Path.GetFileNameWithoutExtension(filePath) + "_nail" + ext;
                            File.Delete(filePath_Nail);
                        }
                        catch { }
                    }
                }
                return true;
            }
        }
예제 #55
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            cornerImage.ImageUrl = "images/style" + CssStyleNum.ToString() + "/tab_corn.gif";
            cornerImage.CssClass = "t_act";

            if (IsRoot == true)
            {
                Table.Rows[0].Cells[0].CssClass = "t_white";
                Table.Rows[0].Cells[1].CssClass = "t_white";


                //if(EnableLogoutButton==true && IsRoot==true)
                //{
                //    System.Web.UI.WebControls.Literal capt=new System.Web.UI.WebControls.Literal();
                //    capt.Text=WelcomeNote + "&nbsp;&nbsp;";
                //    System.Web.UI.HtmlControls.HtmlAnchor anch=new System.Web.UI.HtmlControls.HtmlAnchor();
                //    anch.HRef=LogoutHref;
                //    System.Web.UI.HtmlControls.HtmlImage img=new System.Web.UI.HtmlControls.HtmlImage();
                //    img.Alt="Logout";
                //    img.Src="images/logout.gif";
                //    img.Border=0;
                //    anch.Controls.Add(img);
                //    Table.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Right;
                //    Table.Rows[0].Cells[0].VerticalAlign = VerticalAlign.Middle;
                //    Table.Rows[0].Cells[0].Controls.Add(capt);
                //    Table.Rows[0].Cells[1].Controls.Add(anch);
                //    Table.Rows[0].Cells[1].VerticalAlign = VerticalAlign.Middle;
                //}

                if (IsRoot)
                {
                    Table.Rows[1].Cells[1].CssClass      = "t_white";
                    Table.Rows[0].Cells[1].VerticalAlign = VerticalAlign.Middle;

                    string logoUrl = "~/images/logo.gif";
                    if (File.Exists(this.Server.MapPath(logoUrl)))
                    {
                        // logo
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Alt    = FI.Common.AppConfig.AppName;
                        img.Src    = logoUrl;
                        img.Border = 0;
                        Table.Rows[0].Cells[1].Controls.Add(img);
                    }
                    else
                    {
                        // appname
                        System.Web.UI.WebControls.Literal capt = new System.Web.UI.WebControls.Literal();
                        capt.Text = FI.Common.AppConfig.AppName;
                        Table.Rows[0].Cells[1].Controls.Add(capt);
                    }
                }


                Table.Rows[0].Cells[2].CssClass = "t_white";
            }
            else
            {
                Table.Rows[0].Cells[0].CssClass = "t_act";
                Table.Rows[0].Cells[1].CssClass = "t_act";
                Table.Rows[0].Cells[2].CssClass = "t_act";
            }

            Table.Rows[1].Cells[0].CssClass = "t_white";
            Table.Rows[1].Cells[1].CssClass = "t_white";
            Table.Rows[1].Cells[2].CssClass = "t_white";

            Table.Rows[2].Cells[0].CssClass = "t_act";
            Table.Rows[2].Cells[1].CssClass = "t_act";
            Table.Rows[2].Cells[2].CssClass = "t_act";
        }
예제 #56
0
        public void LoadHtmlTable()
        {
            System.Web.UI.HtmlControls.HtmlTable tblPivot = new System.Web.UI.HtmlControls.HtmlTable();
            tblPivot.CellPadding = 0;
            tblPivot.CellSpacing = 0;
            tblPivot.Width       = "100%";
            tblPivot.Height      = "100%";
            tblPivot.Attributes.Add("class", "tbl1_T");
            pnlPivot.Controls.Add(tblPivot);

            if (_report == null || _report.Cellset.IsValid == false)
            {
                return;
            }

            int Ax0MemCount = _report.Cellset.Axis0TupleMemCount;
            int Ax1MemCount = _report.Cellset.Axis1TupleMemCount;
            int Ax0PosCount = _report.Cellset.Axis0PosCount;
            int Ax1PosCount = _report.Cellset.Axis1PosCount;

            int ax0OrderPos = _report.GetOrderPosition(_report.Axes[0]);
            int ax1OrderPos = _report.GetOrderPosition(_report.Axes[1]);

            Hierarchy ax1Hier = null;
            Hierarchy ax0Hier = null;

            //table
            System.Web.UI.HtmlControls.HtmlTableRow  tr = null;
            System.Web.UI.HtmlControls.HtmlTableCell td = null;

            if (Ax0PosCount == 0 && Ax1PosCount == 0)
            {
                tr = new HtmlTableRow();
                tblPivot.Rows.Add(tr);
                td = new HtmlTableCell();
                tr.Cells.Add(td);
                td.Attributes.Add("class", "tbl1_err");
                td.Attributes.Add("nowrap", "true");
                td.InnerText = "Query successfully executed, cellset contains no data";
                return;
            }


            for (int i = 0; i < Ax0MemCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_HC");
                    td.NoWrap = true;
                    tr.Cells.Add(td);

                    //hier controls in last row
                    if (i == Ax0MemCount - 1)
                    {
                        this.CreateHierControls(_report.Axes[1].Hierarchies[j], td);
                    }
                }

                ax0Hier = _report.Axes[0].Hierarchies[i];
                for (int j = 0; j < Ax0PosCount; j++)
                {
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(0, i, j);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (j != 0 && _report.Cellset.GetCellsetMember(0, i, j - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (j == ax0OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle colspan
                    int spanCount = 1;
                    for (int n = j + 1; n < Ax0PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(0, i, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax0OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H3");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H2");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.ColSpan = spanCount;
                    }


                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(0, j, i);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);

                    tr.Cells.Add(td);
                }


                // hier controls in last col
                td = new System.Web.UI.HtmlControls.HtmlTableCell();
                td.Attributes.Add("class", "tbl1_HC");
                td.NoWrap = true;
                CreateHierControls(ax0Hier, td);
                tr.Cells.Add(td);
            }



            for (int i = 0; i < Ax1PosCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    ax1Hier = _report.Axes[1].Hierarchies[j];
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(1, j, i);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (i != 0 && _report.Cellset.GetCellsetMember(1, j, i - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (i == ax1OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle rowspan
                    int spanCount = 1;
                    for (int n = i + 1; n < Ax1PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(1, j, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax1OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H1");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.RowSpan = spanCount;
                    }



                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(1, i, j);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);


                    tr.Cells.Add(td);
                }

                for (int j = 0; j < Ax0PosCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_C");
                    td.NoWrap = true;
                    Cell olapCell = _report.Cellset.GetCell(j, i);
                    td.InnerText = olapCell.FormattedValue;
                    tr.Cells.Add(td);
                }
            }
        }
예제 #57
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺推广");
            int        num           = Globals.RequestQueryNum("ReferralId");
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (num > 0 && currentMember == null)
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + num);
                this.Page.Response.End();
            }
            if (!int.TryParse(this.Page.Request.QueryString["UserId"], out this.userId))
            {
                base.GotoResourceNotFound("");
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);

            if (userIdDistributors == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litStroeDesc = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeDesc");
            this.litLinkurl   = (System.Web.UI.WebControls.Literal) this.FindControl("litLinkurl");
            this.litStoreurl  = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreurl");
            string text = Globals.FullPath("/Default.aspx?ReferralId=" + this.userId);

            this.litLinkurl.Text  = text;
            this.litStoreurl.Text = text;
            this.Logoimage        = (System.Web.UI.WebControls.Image) this.FindControl("Logoimage");
            this.storeCode        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("storeCode");
            this.storeFollowCode  = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("storeFollowCode");
            if (!string.IsNullOrEmpty(userIdDistributors.Logo))
            {
                this.Logoimage.ImageUrl = Globals.HostPath(this.Page.Request.Url) + userIdDistributors.Logo;
            }
            else
            {
                userIdDistributors.Logo = "/Utility/pics/headLogo.jpg";
            }
            this.storeCode.Src       = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(text) + "&Logo=" + userIdDistributors.Logo;
            this.storeFollowCode.Src = "";
            ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");

            if (scanInfosByUserId == null)
            {
                ScanHelp.CreatNewScan(this.userId, "WX", 0);
                scanInfosByUserId = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");
            }
            string text2 = "";

            if (scanInfosByUserId != null && !string.IsNullOrEmpty(scanInfosByUserId.CodeUrl))
            {
                text2 = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                string       token_Message  = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                if (TokenApi.CheckIsRightToken(token_Message))
                {
                    string text3 = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                    if (!string.IsNullOrEmpty(text3))
                    {
                        text2 = BarCodeApi.GetQRImageUrlByTicket(text3);
                        scanInfosByUserId.CodeUrl        = text3;
                        scanInfosByUserId.CreateTime     = System.DateTime.Now;
                        scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                        ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                    }
                }
            }
            if (!string.IsNullOrEmpty(text2))
            {
                this.storeFollowCode.Src = "/Api/CreatQRCode.ashx?Combin=" + Globals.UrlEncode(text2) + "&Logo=" + userIdDistributors.Logo;
            }
            else
            {
                this.storeFollowCode.Src = "";
            }
            this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
            this.litStroeName.Text = userIdDistributors.StoreName;
            this.litStroeDesc.Text = userIdDistributors.StoreDescription;
        }
예제 #58
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("申请分销");
            this.Page.Session["stylestatus"] = "2";
            MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);

            if (userIdDistributors != null && userIdDistributors.ReferralStatus == 0)
            {
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            bool         flag           = VshopBrowser.IsPassAutoToDistributor(currentMember, true);

            if (flag)
            {
                DistributorsBrower.MemberAutoToDistributor(currentMember);
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            else
            {
                if (!VshopBrowser.IsPassAutoToDistributor(currentMember, false))
                {
                    this.Page.Response.Redirect("/Vshop/DistributorRegCheck.aspx", true);
                    this.Page.Response.End();
                }
                if (!masterSettings.IsShowDistributorSelfStoreName)
                {
                    DistributorsBrower.MemberAutoToDistributor(currentMember);
                    this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                    this.Page.Response.End();
                }
                else
                {
                    int num = 0;
                    this.idImg = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("idImg");
                    string text = string.Empty;
                    if (int.TryParse(this.Page.Request.QueryString["ReferralId"], out num))
                    {
                        if (num > 0)
                        {
                            DistributorsInfo userIdDistributors2 = DistributorsBrower.GetUserIdDistributors(num);
                            if (userIdDistributors2 != null)
                            {
                                if (!string.IsNullOrEmpty(userIdDistributors2.Logo))
                                {
                                    text = userIdDistributors2.Logo;
                                }
                            }
                        }
                    }
                    if (string.IsNullOrEmpty(text))
                    {
                        text = masterSettings.DistributorLogoPic;
                    }
                    this.idImg.Src = text;
                    if (userIdDistributors != null && userIdDistributors.ReferralStatus != 0)
                    {
                        this.litIsEnable       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litIsEnable");
                        this.litIsEnable.Value = userIdDistributors.ReferralStatus.ToString();
                    }
                }
            }
        }
예제 #59
0
        protected override void AttachChildControls()
        {
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                this.Page.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString() + "&ReferralUserId=" + HiContext.Current.User.UserId);
                return;
            }
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.hiddenpid         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddenpid");
            this.hiddeSkuId        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeSkuId");
            this.hiddeCategoryId   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryId");
            this.hiddeCategoryName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryName");
            this.hidCartQuantity   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txCartQuantity");
            this.hiddeProductCode  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductCode");
            this.hiddeUserId       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeUserId");
            this.hiddeProductName  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductName");
            this.buyCardinality    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("buyCardinality");
            this.hiddenpid.Value   = this.productId.ToString();
            this.promote           = (ProductPromote)this.FindControl("ProductPromote");
            this.common_Location   = (Common_Location)this.FindControl("common_Location");
            this.litProductName    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
            this.lblProductCode    = (System.Web.UI.WebControls.Literal) this.FindControl("lblProductCode");
            this.lblSku            = (SkuLabel)this.FindControl("lblSku");
            this.lblStock          = (StockLabel)this.FindControl("lblStock");
            this.litUnit           = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
            this.litBuyCardinality = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality");
            this.litWeight         = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
            this.litBrosedNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
            this.litBrand          = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
            this.litSaleCounts     = (System.Web.UI.WebControls.Literal) this.FindControl("litSaleCounts");
            this.lblMarkerPrice    = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
            this.lblBuyPrice       = (System.Web.UI.WebControls.Label) this.FindControl("lblBuyPrice");
            this.lblsmalltitle     = (System.Web.UI.WebControls.Label) this.FindControl("lblsmalltitle");

            this.lblTotalPrice       = (TotalLabel)this.FindControl("lblTotalPrice");
            this.litDescription      = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.btnaddgouwu             = (AddCartButton)this.FindControl("btnaddgouwu");
            this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
            this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
            this.hpkProductSales         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductSales");
            this.litReviewCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewCount");
            this.litItemNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litItemNumber");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            //this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.expandAttributes   = (Common_ExpandAttributes1)this.FindControl("expandAttributes");
            this.skuSelector        = (SKUSelector)this.FindControl("SKUSelector");
            this.reviews            = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
            this.consultations      = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative        = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.hidden_skuItem     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
            this.litTaxRate         = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.imgIcon            = (HiImage)this.FindControl("imgIcon");
            this.litCnArea          = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            this.litShipping        = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.hotSale            = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale"); //销售排行
            this.litCategoryNotes3  = (System.Web.UI.WebControls.Literal) this.FindControl("litCategoryNotes3");
            this.productImg         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImg");       //二维码图片
            this.nowBuyBtn          = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("nowBuyBtn");
            this.litviewcount       = (System.Web.UI.WebControls.Literal) this.FindControl("litviewcount");
            this.hiddensupplierid   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddensupplierid");
            this.litMarkPrice       = (System.Web.UI.WebControls.Literal) this.FindControl("litMarkPrice");
            this.txtBuyAmount       = (BuyAmountBox)this.FindControl("txtBuyAmount");
            if (!this.Page.IsPostBack)
            {
                ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
                if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
                    return;
                }
                if (this.hidCartQuantity != null)
                {
                    this.hidCartQuantity.Value = this.GetQuantity_Product(productBrowseInfo.Product.ProductId);
                }
                System.Collections.IEnumerable value =
                    from item in productBrowseInfo.Product.Skus
                    select item.Value;
                if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
                {
                    this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
                }
                if (this.hidden_skus != null)
                {
                    this.hidden_skus.Value = JsonConvert.SerializeObject(value);
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
                {
                    this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("unproductdetails", new object[]
                    {
                        this.Page.Request.QueryString["productId"]
                    }));
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }

                if (productBrowseInfo.cIsDisable == 1)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }


                this.LoadPageSearch(productBrowseInfo.Product);
                if (this.lbUserProductRefer != null)
                {
                    this.lbUserProductRefer.product = productBrowseInfo.Product;
                }
                this.hpkProductReviews.Text       = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
                this.litviewcount.Text            = productBrowseInfo.ReviewCount.ToString();
                this.hpkProductConsultations.Text = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
                string count = ProductBrowser.GetLineItemNumber(this.productId).ToString();
                //this.hpkProductSales.Text = "查看全部" + count + "条成交记录";

                int countt = ProductBrowser.GetLineItemCount(this.productId);
                if (countt > 0)
                {
                    this.hpkProductSales.Text        = "查看全部" + countt + "条成交记录";
                    this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                }
                else
                {
                    this.hpkProductSales.Text = "暂无成交记录";
                }

                this.litReviewCount.Text = productBrowseInfo.ReviewCount.ToString();
                this.litItemNumber.Text  = countt.ToString();
                this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
                this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
                //this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);

                this.hiddeCategoryId.Value   = productBrowseInfo.CategoryId;
                this.hiddeCategoryName.Value = productBrowseInfo.CategoryName;
                this.hiddeProductName.Value  = productBrowseInfo.Product.ProductName;
                this.hiddeProductCode.Value  = productBrowseInfo.Product.ProductCode;
                this.hiddeUserId.Value       = HiContext.Current.User.UserId.ToString();
                this.btnBuy.Stock            = productBrowseInfo.Product.Stock;
                this.txtBuyAmount.Quantity   = productBrowseInfo.Product.BuyCardinality;
                this.btnaddgouwu.Stock       = productBrowseInfo.Product.Stock;
                BrowsedProductQueue.EnQueue(this.productId);
                this.images.ImageInfo = productBrowseInfo.Product;
                if (this.promote != null)
                {
                    this.promote.ProductId = this.productId;
                }
                if (productBrowseInfo.DbAttribute != null)
                {
                    this.expandAttributes.DbAttribute = productBrowseInfo.DbAttribute;//商品扩展属性
                    //this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                    //this.rptExpandAttributes.DataBind();
                }
                if (productBrowseInfo.DbSKUs != null)
                {
                    this.skuSelector.ProductId  = this.productId;
                    this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
                }
                if (productBrowseInfo.DBReviews != null)
                {
                    this.reviews.DataSource = productBrowseInfo.DBReviews;
                    this.reviews.DataBind();
                }
                if (productBrowseInfo.DBConsultations != null)
                {
                    this.consultations.DataSource = productBrowseInfo.DBConsultations;
                    this.consultations.DataBind();
                }
                if (productBrowseInfo.DbCorrelatives != null)
                {
                    this.correlative.DataSource = productBrowseInfo.DbCorrelatives;//推荐 ,捆绑或同类型下的商品
                    this.correlative.DataBind();
                }
                if (productBrowseInfo.DBHotSale != null)
                {
                    this.hotSale.DataSource = productBrowseInfo.DBHotSale;
                    this.hotSale.DataBind();
                }
                if (this.productImg != null)
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.QRcode))
                    {
                        this.productImg.Src = productBrowseInfo.Product.QRcode;
                    }
                    //else
                    //{
                    //    //this.productImg.Attributes.Add("display", "none");
                    //}
                }
                this.litCategoryNotes3.Text = productBrowseInfo.CategoryNote3;
            }
        }
예제 #60
0
        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("结算支付");
        }