Esempio n. 1
0
        /// <summary>
        /// 绑定战略合作伙伴与友情链接
        /// </summary>
        private void BindPartnerLinks()
        {
            StringBuilder strBuilder = new StringBuilder();//字符串拼接

            strBuilder.Append("<div class=\"links\"><s class=\"linksL\"></s><div class=\"links-cont\">");
            //操作BLL
            EyouSoft.IBLL.SystemStructure.ISysFriendLink linkBll = EyouSoft.BLL.SystemStructure.SysFriendLink.CreateInstance();
            //获取友情链接集合
            int recordCount = 1;
            IList <EyouSoft.Model.SystemStructure.SysFriendLink> linkList = linkBll.GetSysFriendLinkList(8, 1, ref recordCount, 1, EyouSoft.Model.SystemStructure.FriendLinkType.战略合作);

            if (linkList != null && linkList.Count > 0)
            {
                strBuilder.Append("<ul class=\"links-pic fixed\">");
                foreach (EyouSoft.Model.SystemStructure.SysFriendLink linkModel in linkList)
                {
                    strBuilder.AppendFormat("<li><a target=\"blank\" href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a></li>", linkModel.LinkAddress, EyouSoft.Common.Domain.FileSystem + linkModel.ImgPath, linkModel.LinkName);
                }
                strBuilder.Append("</ul><div class=\"hr_5\"></div>");
            }
            //获取合作伙伴集合
            IList <EyouSoft.Model.SystemStructure.SysFriendLink> partnerList = linkBll.GetSysFriendLinkList(EyouSoft.Model.SystemStructure.FriendLinkType.文字);

            if (partnerList != null && partnerList.Count > 0)
            {
                strBuilder.Append("<p>");
                int partnerCount = partnerList.Count;
                foreach (EyouSoft.Model.SystemStructure.SysFriendLink linkModel in partnerList)
                {
                    partnerCount--;
                    //判断是否拼接最后一个有情链接(不加分隔符)
                    if (partnerCount > 0)
                    {
                        strBuilder.AppendFormat("<a target=\"blank\" href=\"{0}\">{1}</a> |", linkModel.LinkAddress, linkModel.LinkName);
                    }
                    else
                    {
                        strBuilder.AppendFormat("<a target=\"blank\" href=\"{0}\">{1}</a></p>", linkModel.LinkAddress, linkModel.LinkName);
                    }
                }
            }
            strBuilder.Append("</div><s class=\"linksR\"></s></div>");
            partnerlinks = strBuilder.ToString();//输出拼接结果
        }
Esempio n. 2
0
 public void BindRp()
 {
     EyouSoft.IBLL.SystemStructure.ISysFriendLink Itest = EyouSoft.BLL.SystemStructure.SysFriendLink.CreateInstance();
     rp1.DataSource = Itest.GetSysFriendLinkList(EyouSoft.Model.SystemStructure.FriendLinkType.未知);
     rp1.DataBind();
 }