public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "simple");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"pro_simple{0} cssEdite\" type=\"simple\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId);
                DataTable productList = this.GetProductList(xmlNode);
                if (productList != null && productList.Rows.Count > 0)
                {
                    if (xmlNode.Attributes["SkinName"] != null && !string.IsNullOrEmpty(xmlNode.Attributes["SkinName"].Value))
                    {
                        this.SkinName = xmlNode.Attributes["SkinName"].Value;
                        this.WriteSkin(productList, stringBuilder, xmlNode);
                    }
                    else
                    {
                        this.WriteNoSkin(productList, stringBuilder, xmlNode);
                    }
                }
                stringBuilder.Append("</div>");
            }
            return(stringBuilder.ToString());
        }
Пример #2
0
        public string RendHtml()
        {
            StringBuilder stringBuilder = new StringBuilder();
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "floor");

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"floor{0} cssEdite\" type=\"floor\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendLine("<div class=\"floor_bd\">");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["AdImage"].Value))
                {
                    stringBuilder.AppendFormat("<div class=\"floor_ad\"><img src=\"{0}\"  /></div>", xmlNode.Attributes["AdImage"].Value).AppendLine();
                }
                else
                {
                    stringBuilder.AppendFormat("<div class=\"floor_ad\"><img src=\"{0}\"  /></div>", SettingsManager.GetMasterSettings(true).DefaultProductImage).AppendLine();
                }
                stringBuilder.AppendLine("<div class=\"floor_pro\">");
                DataTable productList = this.GetProductList(xmlNode);
                if (productList != null && productList.Rows.Count > 0)
                {
                    stringBuilder.AppendLine("<ul>");
                    foreach (DataRow dataRow in productList.Rows)
                    {
                        SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                        string       str            = masterSettings.DefaultProductImage;
                        if (dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value] != DBNull.Value)
                        {
                            str = dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value].ToString();
                        }
                        stringBuilder.AppendLine("<li>");
                        stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), Globals.ApplicationPath + str, dataRow["ProductName"]).AppendLine();
                        stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), dataRow["ProductName"]).AppendLine();
                        string arg = string.Empty;
                        if (dataRow["MarketPrice"] != DBNull.Value)
                        {
                            arg = Globals.FormatMoney((decimal)dataRow["MarketPrice"]);
                        }
                        stringBuilder.AppendFormat("<div class=\"price\"><b><em>¥</em>{0}</b><span><em>¥</em>{1}</span></div>", Globals.FormatMoney((decimal)dataRow["RankPrice"]), arg).AppendLine();
                        stringBuilder.AppendFormat("<a class=\"productview\" target=\"_blank\" href=\"{0}\">查看详细</a>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        })).AppendLine();
                        stringBuilder.AppendLine("</li>");
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "tab");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"pro_tab{0} cssEdite\" type=\"tab\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendFormat("<div class=\"tab_item\" id=\"products_{0}_item_1\">", this.SubjectId);
                this.RenderProdcutItem(xmlNode, stringBuilder, "Where1");
                stringBuilder.AppendLine("</div>");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle2"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_2\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where2");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle3"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_3\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where3");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle4"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_4\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where4");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle5"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_5\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where5");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle6"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_6\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where6");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle7"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_7\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where7");
                    stringBuilder.AppendLine("</div>");
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["TabTitle8"].Value))
                {
                    stringBuilder.AppendFormat("<div style=\"display:none;\" class=\"tab_item\" id=\"products_{0}_item_8\">", this.SubjectId);
                    this.RenderProdcutItem(xmlNode, stringBuilder, "Where8");
                    stringBuilder.AppendLine("</div>");
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Пример #4
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "simple");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"pro_simple{0} cssEdite\" type=\"simple\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId);
                DataTable productList = this.GetProductList(xmlNode);
                if (productList != null && productList.Rows.Count > 0)
                {
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    string       text           = this.ShowDefaultProductImage(xmlNode.Attributes["ImageSize"].Value, masterSettings);
                    stringBuilder.AppendLine("<ul>");
                    foreach (DataRow dataRow in productList.Rows)
                    {
                        string str = text;
                        if (dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value] != DBNull.Value)
                        {
                            str = dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value].ToString();
                        }
                        stringBuilder.AppendLine("<li>");
                        stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), Globals.ApplicationPath + str).AppendLine();
                        stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), dataRow["ProductName"]).AppendLine();
                        decimal money = 0m;
                        string  arg   = string.Empty;
                        if (dataRow["MarketPrice"] != DBNull.Value)
                        {
                            arg = Globals.FormatMoney((decimal)dataRow["MarketPrice"]);
                        }
                        if (dataRow["RankPrice"] != DBNull.Value)
                        {
                            money = (decimal)dataRow["RankPrice"];
                        }
                        stringBuilder.AppendFormat("<div class=\"price\"><b><em>¥</em>{0}</b><span><em>¥</em>{1}</span></div>", Globals.FormatMoney(money), arg).AppendLine();
                        stringBuilder.AppendFormat("<a class=\"productview\" target=\"_blank\" href=\"{0}\">查看详情</a>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), dataRow["ProductName"]).AppendLine();
                        stringBuilder.AppendLine("</li>");
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.Append("</div>");
            }
            return(stringBuilder.ToString());
        }
Пример #5
0
        public string RendHtml()
        {
            StringBuilder sb   = new StringBuilder();
            XmlNode       node = TagsHelper.FindProductNode(this.SubjectId, "floor");

            if (node != null)
            {
                sb.AppendFormat("<div class=\"floor{0} cssEdite\" type=\"floor\" id=\"products_{1}\" >", node.Attributes["ImageSize"].Value, this.SubjectId).AppendLine();
                this.RenderHeader(node, sb);
                sb.AppendLine("<div class=\"floor_bd\">");
                if (!string.IsNullOrEmpty(node.Attributes["AdImage"].Value))
                {
                    sb.AppendFormat("<div class=\"floor_ad\"><img src=\"{0}\"  /></div>", node.Attributes["AdImage"].Value).AppendLine();
                }
                else
                {
                    sb.AppendFormat("<div class=\"floor_ad\"><img src=\"{0}\"  /></div>", SettingsManager.GetMasterSettings(true).DefaultProductImage).AppendLine();
                }
                sb.AppendLine("<div class=\"floor_pro\">");
                DataTable productList = this.GetProductList(node);
                if ((productList != null) && (productList.Rows.Count > 0))
                {
                    sb.AppendLine("<ul>");
                    foreach (DataRow row in productList.Rows)
                    {
                        string defaultProductImage = SettingsManager.GetMasterSettings(false).DefaultProductImage;
                        if (row["ThumbnailUrl" + node.Attributes["ImageSize"].Value] != DBNull.Value)
                        {
                            defaultProductImage = row["ThumbnailUrl" + node.Attributes["ImageSize"].Value].ToString();
                        }
                        sb.AppendLine("<li>");
                        sb.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), Globals.ApplicationPath + defaultProductImage).AppendLine();
                        sb.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), row["ProductName"]).AppendLine();
                        string str2 = string.Empty;
                        if (row["MarketPrice"] != DBNull.Value)
                        {
                            str2 = Globals.FormatMoney((decimal)row["MarketPrice"]);
                        }
                        sb.AppendFormat("<div class=\"price\"><b>{0}</b><span>{1}</span></div>", Globals.FormatMoney((decimal)row["RankPrice"]), str2).AppendLine();
                        sb.AppendLine("</li>");
                    }
                    sb.AppendLine("</ul>");
                }
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
            }
            return(sb.ToString());
        }
Пример #6
0
        private XmlNode FindXmlNode(string xmlname, int Id, string type)
        {
            XmlNode result = null;

            if (!(xmlname == "ads"))
            {
                if (xmlname == "products")
                {
                    result = TagsHelper.FindProductNode(Id, type);
                }
            }
            else
            {
                result = TagsHelper.FindAdNode(Id, type);
            }
            return(result);
        }
Пример #7
0
        public string RendHtml()
        {
            StringBuilder sb   = new StringBuilder();
            XmlNode       node = TagsHelper.FindProductNode(this.SubjectId, "group");

            if (node != null)
            {
                int.TryParse(node.Attributes["CategoryId"].Value, out this.categoryId);
                sb.AppendFormat("<div class=\"group{0} cssEdite\" type=\"group\" id=\"products_{1}\" >", node.Attributes["ImageSize"].Value, this.SubjectId).AppendLine();
                this.RenderHeader(node, sb);
                sb.AppendLine("<div class=\"group_bd\">");
                this.RenderLift(node, sb);
                this.RenderMiddle(node, sb);
                this.RenderRight(node, sb);
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
            }
            return(sb.ToString());
        }
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "top");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"sale_top{0} cssEdite\" type=\"top\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId);
                if (xmlNode.Attributes["SkinName"] != null && !string.IsNullOrEmpty(xmlNode.Attributes["SkinName"].Value))
                {
                    this.SkinName = xmlNode.Attributes["SkinName"].Value;
                    this.RenderWriteSkin(stringBuilder, xmlNode);
                }
                else
                {
                    this.RenderNoSkin(stringBuilder, xmlNode);
                }
                stringBuilder.Append("</div>");
            }
            return(stringBuilder.ToString());
        }
Пример #9
0
        private XmlNode FindXmlNode(string xmlname, int Id, string type)
        {
            XmlNode node = null;
            string  str  = xmlname;

            if (str == null)
            {
                return(node);
            }
            if (!(str == "ads"))
            {
                if (str != "products")
                {
                    return(node);
                }
            }
            else
            {
                return(TagsHelper.FindAdNode(Id, type));
            }
            return(TagsHelper.FindProductNode(Id, type));
        }
Пример #10
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindProductNode(this.SubjectId, "top");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                int num = 0;
                int.TryParse(xmlNode.Attributes["ImageNum"].Value, out num);
                bool flag = false;
                bool.TryParse(xmlNode.Attributes["IsShowPrice"].Value, out flag);
                bool flag2 = false;
                bool.TryParse(xmlNode.Attributes["IsShowSaleCounts"].Value, out flag2);
                bool flag3 = false;
                bool.TryParse(xmlNode.Attributes["IsImgShowPrice"].Value, out flag3);
                bool flag4 = false;
                bool.TryParse(xmlNode.Attributes["IsImgShowSaleCounts"].Value, out flag4);
                stringBuilder.AppendFormat("<div class=\"sale_top{0} cssEdite\" type=\"top\" id=\"products_{1}\" >", xmlNode.Attributes["ImageSize"].Value, this.SubjectId);
                DataTable productList = this.GetProductList(xmlNode);
                if (productList != null && productList.Rows.Count > 0)
                {
                    int num2 = 0;
                    stringBuilder.AppendLine("<ul>");
                    foreach (DataRow dataRow in productList.Rows)
                    {
                        SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                        string       str            = masterSettings.DefaultProductImage;
                        if (dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value] != DBNull.Value)
                        {
                            str = dataRow["ThumbnailUrl" + xmlNode.Attributes["ImageSize"].Value].ToString();
                        }
                        num2++;
                        stringBuilder.AppendFormat("<li class=\"sale_top{0}\">", num2).AppendLine();
                        stringBuilder.AppendFormat("<em>{0}</em>", num2).AppendLine();
                        if (num2 <= num)
                        {
                            stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                            {
                                dataRow["ProductId"]
                            }), Globals.ApplicationPath + str, dataRow["ProductName"]).AppendLine();
                        }
                        stringBuilder.AppendLine("<div class=\"info\">");
                        stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                        {
                            dataRow["ProductId"]
                        }), dataRow["ProductName"]).AppendLine();
                        if ((flag && num2 > num) || (flag3 && num2 <= num))
                        {
                            string arg = string.Empty;
                            if (dataRow["MarketPrice"] != DBNull.Value)
                            {
                                arg = Globals.FormatMoney((decimal)dataRow["MarketPrice"]);
                            }
                            stringBuilder.AppendFormat("<div class=\"price\"><b><em>¥</em>{0}</b><span><em>¥</em>{1}</span></div>", Globals.FormatMoney((decimal)dataRow["RankPrice"]), arg).AppendLine();
                            stringBuilder.AppendFormat("<a class=\"productview\" target=\"_blank\" href=\"{0}\">查看详细</a>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[]
                            {
                                dataRow["ProductId"]
                            })).AppendLine();
                        }
                        if ((flag2 && num2 > num) || (flag4 && num2 <= num))
                        {
                            stringBuilder.AppendFormat("<div class=\"sale\">已售出<b>{0}</b>件 </div>", dataRow["SaleCounts"]).AppendLine();
                        }
                        stringBuilder.Append("</div>");
                        stringBuilder.AppendLine("</li>");
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.Append("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       node    = TagsHelper.FindProductNode(this.SubjectId, "top");
            StringBuilder builder = new StringBuilder();

            if (node != null)
            {
                int result = 0;
                int.TryParse(node.Attributes["ImageNum"].Value, out result);
                bool flag = false;
                bool.TryParse(node.Attributes["IsShowPrice"].Value, out flag);
                bool flag2 = false;
                bool.TryParse(node.Attributes["IsShowSaleCounts"].Value, out flag2);
                bool flag3 = false;
                bool.TryParse(node.Attributes["IsImgShowPrice"].Value, out flag3);
                bool flag4 = false;
                bool.TryParse(node.Attributes["IsImgShowSaleCounts"].Value, out flag4);
                builder.AppendFormat("<div class=\"sale_top{0} cssEdite\" type=\"top\" id=\"products_{1}\" >", node.Attributes["ImageSize"].Value, this.SubjectId);
                DataTable productList = this.GetProductList(node);
                if ((productList != null) && (productList.Rows.Count > 0))
                {
                    int num2 = 0;
                    builder.AppendLine("<ul>");
                    foreach (DataRow row in productList.Rows)
                    {
                        string defaultProductImage = SettingsManager.GetMasterSettings(false).DefaultProductImage;
                        if (row["ThumbnailUrl" + node.Attributes["ImageSize"].Value] != DBNull.Value)
                        {
                            defaultProductImage = row["ThumbnailUrl" + node.Attributes["ImageSize"].Value].ToString();
                        }
                        num2++;
                        builder.AppendFormat("<li class=\"sale_top{0}\">", num2).AppendLine();
                        builder.AppendFormat("<em>{0}</em>", num2).AppendLine();
                        if (num2 <= result)
                        {
                            builder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), Globals.ApplicationPath + defaultProductImage).AppendLine();
                        }
                        builder.AppendLine("<div class=\"info\">");
                        builder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), row["ProductName"]).AppendLine();
                        if ((flag && (num2 > result)) || (flag3 && (num2 <= result)))
                        {
                            string str2 = string.Empty;
                            if (row["MarketPrice"] != DBNull.Value)
                            {
                                str2 = Globals.FormatMoney((decimal)row["MarketPrice"]);
                            }
                            builder.AppendFormat("<div class=\"price\"><b>{0}</b><span>{1}</span></div>", Globals.FormatMoney((decimal)row["RankPrice"]), str2).AppendLine();
                        }
                        if ((flag2 && (num2 > result)) || (flag4 && (num2 <= result)))
                        {
                            builder.AppendFormat("<div class=\"sale\">已售出<b>{0}</b>件 </div>", row["SaleCounts"]).AppendLine();
                        }
                        builder.Append("</div>");
                        builder.AppendLine("</li>");
                    }
                    builder.AppendLine("</ul>");
                }
                builder.Append("</div>");
            }
            return(builder.ToString());
        }