protected void BuildCommonProblems()
        {
            LookupCodeDa lDa = new LookupCodeDa();
            DataTable    lDt = lDa.GetLookupCodes("Problem,Disease,Osteoporosis");

            if (lDt.Rows.Count > 0)
            {
                CommonProblems.DataSource = lDt.DefaultView;
                CommonProblems.DataBind();
            }
        }
示例#2
0
        /// <summary>
        /// 获取尾部的信息
        /// </summary>
        /// <param name="indexContent">头部,轮播图,尾部</param>
        /// <returns></returns>
        public static string GetFooter(List <webmaster> indexContent)
        {
            FooterLogo            footerLogo         = new FooterLogo();
            ProductService        proService         = new ProductService();
            AboutUs               aboutUs            = new AboutUs();
            CommonProblems        commonProblems     = new CommonProblems();
            Contact               contact            = new Contact();
            RemarkFooter          remarkFooters      = new RemarkFooter();
            List <FooterLogo>     footersList        = new List <FooterLogo>();
            List <ProductService> productsList       = new List <ProductService>();
            List <AboutUs>        aboutUsList        = new List <AboutUs>();
            List <CommonProblems> commonProblemsList = new List <CommonProblems>();
            List <Contact>        contactsList       = new List <Contact>();
            List <RemarkFooter>   remarkFootList     = new List <RemarkFooter>();
            IndexAllFooter        indexAllFooter     = new IndexAllFooter();
            string footerJsonTxt = null;

            if (indexContent != null)
            {
                foreach (var item in indexContent)
                {
                    if (item != null)
                    {
                        if (item.vcName == "footerLogo")
                        {
                            footerLogo.Logo = item.vcContent;
                            footersList.Add(footerLogo);
                            indexAllFooter.footerLogo = footersList;
                        }
                        if (item.vcName == "nav")
                        {
                            JObject navs = (JObject)JsonConvert.DeserializeObject(item.vcContent);//将数据进行序列化
                            //检查
                            //产品服务
                            proService.productService = Convert.ToString(navs["productService"]) != null?Convert.ToString(navs["productService"]) : "";

                            proService.teamApply = Convert.ToString(navs["teamApply"]) != null?Convert.ToString(navs["teamApply"]) : "";

                            proService.honorApply = Convert.ToString(navs["honorApply"]) != null?Convert.ToString(navs["honorApply"]) : "";

                            proService.activeApply = Convert.ToString(navs["activeApply"]) != null?Convert.ToString(navs["activeApply"]) : "";

                            proService.perfectinformation = Convert.ToString(navs["perfectinformation"]) != null?Convert.ToString(navs["perfectinformation"]) : "";

                            productsList.Add(proService);
                            indexAllFooter.proService = productsList;
                            //产品服务结束
                            //关于我们
                            aboutUs.teamIntroduce = Convert.ToString(navs["teamIntroduce"]) != null?Convert.ToString(navs["teamIntroduce"]) : "";

                            aboutUs.joinUs = Convert.ToString(navs["joinUs"]) != null?Convert.ToString(navs["joinUs"]) : "";

                            aboutUs.problemBack = Convert.ToString(navs["problemBack"]) != null?Convert.ToString(navs["problemBack"]) : "";

                            aboutUsList.Add(aboutUs);
                            indexAllFooter.aboutUs = aboutUsList;
                            //关于我们结束
                            //常见问题
                            commonProblems.UnableLogin = Convert.ToString(navs["UnableLogin"]) != null?Convert.ToString(navs["UnableLogin"]) : "";

                            commonProblems.UnableRegister = Convert.ToString(navs["UnableRegister"]) != null?Convert.ToString(navs["UnableRegister"]) : "";

                            commonProblemsList.Add(commonProblems);
                            indexAllFooter.comProblems = commonProblemsList;
                            //常见问题结束
                            //BarQ群
                            contact.qqGroup = Convert.ToString(navs["qqGroup"]) != null?Convert.ToString(navs["qqGroup"]) : "";

                            contactsList.Add(contact);
                            indexAllFooter.contacts = contactsList;
                            //BarQ群结束
                        }
                        if (item.vcName == "footer")
                        {
                            JObject footers = (JObject)JsonConvert.DeserializeObject(item.vcContent);//将数据进行序列化
                            //底部备注
                            remarkFooters.copyRight = Convert.ToString(footers["copyRight"]) != null?Convert.ToString(footers["copyRight"]) : "";

                            remarkFooters.address = Convert.ToString(footers["address"]) != null?Convert.ToString(footers["address"]) : "";

                            remarkFooters.record = Convert.ToString(footers["record"]) != null?Convert.ToString(footers["record"]) : "";

                            remarkFooters.maintenance = Convert.ToString(footers["maintenance"]) != null?Convert.ToString(footers["maintenance"]) : "";

                            remarkFootList.Add(remarkFooters);
                            indexAllFooter.remarkFoots = remarkFootList;
                            //底部备注结束
                        }
                    }
                }
                footerJsonTxt = JsonConvert.SerializeObject(indexAllFooter, Newtonsoft.Json.Formatting.Indented);
                //footerJsonTxt = ClearCharacter(footerJsonTxt);
            }
            return(footerJsonTxt);//返回整个底部信息
        }