Ejemplo n.º 1
0
        /// <summary>
        /// 绑定模版,颜色
        /// </summary>
        /// <param name="wid"></param>
        private void RptBind(int wid)
        {
            // 首页模版数据绑定
            this.rptList2.DataSource = tBll.GetModelList("typeId=1");
            this.rptList2.DataBind();

            //二级页面模版
            rptErJiList.DataSource = tBll.GetModelList("typeId=4");
            rptErJiList.DataBind();

            //列表页面图片列表
            rptLieBiaoList.DataSource = tBll.GetModelList("typeId=2");
            rptLieBiaoList.DataBind();

            //详情页面图片列表
            rptDetailList.DataSource = tBll.GetModelList("typeId=3");
            rptDetailList.DataBind();

            //---------- 绑定颜色  start-----------
            IList <Model.wx_wsite_modulebase> mlist = mBll.GetModelList("1=1");

            Model.wx_wsite_modulebase mbase = new Model.wx_wsite_modulebase();
            for (int i = 0; i < mlist.Count; i++)
            {
                mbase = mlist[i];
                if (mbase.mCode.IndexOf("no") >= 0)
                {
                }
                else
                {
                    mbase.mName = "<img src=\"" + mbase.mName + "\">";
                }
            }

            //颜色选择
            this.rptColor.DataSource = mlist;
            this.rptColor.DataBind();
            //---------- 绑定颜色 end-----------

            //绑定当前微帐号选择的模版Id和颜色
            IList <Model.wx_templates_wcode> twlist = twBll.GetModelList("wid=" + wid);

            if (twlist != null && twlist.Count() > 0)
            {
                hidWTId.Value = twlist[0].id.ToString();
                //aLookIndex.NavigateUrl = "/index.aspx?wid=" + wid;
                //aLookIndex.Target = "_blank";
                int selectColorId = 0;
                if (twlist[0].topcolorTypeId == null || twlist[0].topcolorTypeId < 0)
                {
                    selectColorId = 3; //红色的1
                }
                else
                {
                    selectColorId = twlist[0].topcolorTypeId.Value;
                }
                MessageBox.ResponseScript(this, "$(\"#rad" + twlist[0].tid + "\").attr(\"checked\",\"checked\"); $(\"#rad_erji" + twlist[0].channelTid + "\").attr(\"checked\",\"checked\"); $(\"#rad_liebiao" + twlist[0].listTid + "\").attr(\"checked\",\"checked\"); $(\"#rad_detail" + twlist[0].detailTid + "\").attr(\"checked\",\"checked\");$(\"#radcolor" + selectColorId + "\").attr(\"checked\",\"checked\");");
            }
        }
        /// <summary>
        /// 绑定模版,颜色
        /// </summary>
        /// <param name="wid"></param>
        private void RptBind(int wid)
        {
          
            // 首页模版数据绑定
            this.rptList2.DataSource = tBll.GetModelList("typeId=1");
            this.rptList2.DataBind();

            //二级页面模版
            rptErJiList.DataSource = tBll.GetModelList("typeId=4");
            rptErJiList.DataBind();
            
            //---------- 绑定颜色  start-----------
            IList<Model.wx_wsite_modulebase> mlist = mBll.GetModelList("1=1");
            Model.wx_wsite_modulebase mbase = new Model.wx_wsite_modulebase();
            for (int i = 0; i < mlist.Count; i++)
            {
                mbase = mlist[i];
                if (mbase.mCode.IndexOf("no") >= 0)
                {
                }
                else
                {
                    mbase.mName = "<img src=\"" + mbase.mName + "\">";
                }
            }

            //颜色选择
            this.rptColor.DataSource = mlist;
            this.rptColor.DataBind();
            //---------- 绑定颜色 end-----------

            //绑定当前微帐号选择的模版Id和颜色
            IList<Model.wx_templates_wcode> twlist = twBll.GetModelList("wid=" + wid);
             if (twlist != null && twlist.Count()>0 )
             {
                 hidWTId.Value = twlist[0].id.ToString();
                 aLookIndex.NavigateUrl = "/index.aspx?wid=" + wid;
                 aLookIndex.Target = "_blank";
                 int selectColorId = 0;
                 if (twlist[0].topcolorTypeId == null || twlist[0].topcolorTypeId < 0)
                 {
                     selectColorId = 3; //红色的1
                 }
                 else
                 {
                     selectColorId = twlist[0].topcolorTypeId.Value;
                 }
                 MessageBox.ResponseScript(this, "$(\"#rad" + twlist[0].tid + "\").attr(\"checked\",\"checked\"); $(\"#rad_erji" + twlist[0].channelTid + "\").attr(\"checked\",\"checked\");$(\"#radcolor" + selectColorId + "\").attr(\"checked\",\"checked\");");
             }

        }