Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapExt me = new MapExt();
            // me.MyPK = this.FK_MapData + "_" + this.ExtType + "_" + me.AttrOfOper + "_" + me.AttrsOfActive;

            int i = me.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                                MapExtAttr.AttrOfOper, this.RefNo);

            this.Pub1.AddEasyUiPanelInfoBegin("为下拉框[" + this.RefNo + "]设置联动.", "icon-edit");
            me.FK_MapData = this.FK_MapData;

            this.Pub1.AddTableNormal();

            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("联动下拉框:");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_Attr";
            foreach (MapAttr attr in attrs)
            {
                if (attr.UIVisible == false)
                {
                    continue;
                }

                if (attr.UIIsEnable == false)
                {
                    continue;
                }

                if (attr.UIContralType != UIContralType.DDL)
                {
                    continue;
                }

                if (attr.KeyOfEn == this.RefNo)
                {
                    continue;
                }

                ddl.Items.Add(new ListItem(attr.KeyOfEn + " - " + attr.Name, attr.KeyOfEn));
            }
            ddl.SetSelectItem(me.AttrsOfActive);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("要实现联动的菜单");
            this.Pub1.AddTREnd();

            // 数据源列表.
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=1", "数据源");

            ddl = new DDL();
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            ddl.BindEntitiesNoName(srcs);

            this.Pub1.AddTD(ddl);
            // this.Pub1.AddTD("ccform允许从其他数据源中取数据,<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='/WF/Img/Setting.png' border=0/>设置/新建数据源</a>, <a href=\"javascript:window.localhost.href=window.localhost.href;\" >刷新数据源</a>");
            this.Pub1.AddTD("ccform允许从其他数据源中取数据,<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs','d2')\" ><img src='/WF/Img/Setting.png' border=0/>设置/新建数据源</a>, <a href=\"javascript:window.localhost.href=window.localhost.href;\" >刷新数据源</a>");

            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin("colspan='3'");
            RadioButton rb = new RadioButton();

            rb.Text      = "通过sql获取联动";
            rb.GroupName = "sdr";
            rb.ID        = "RB_0";
            if (me.DoWay == 0)
            {
                rb.Checked = true;
            }

            this.Pub1.Add("在下面文本框中输入一个SQL,具有编号,标签列,用来绑定下从动下拉框。<br />");
            this.Pub1.Add("比如:SELECT No, Name FROM CN_City WHERE FK_SF = '@Key' ");
            this.Pub1.AddBR();
            TextBox tb = new TextBox();

            tb.ID       = "TB_Doc";
            tb.Text     = me.Doc;
            tb.Columns  = 80;
            tb.CssClass = "TH";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 7;
            tb.Style.Add("width", "99%");
            this.Pub1.Add(tb);
            this.Pub1.AddBR();
            this.Pub1.Add("说明:@Key是ccflow约定的关键字,是主下拉框传递过来的值");
            //this.Pub1.AddFieldSetEnd();

            rb           = new RadioButton();
            rb.Text      = "通过编码标识获取";
            rb.GroupName = "sdr";
            rb.Enabled   = false;
            rb.ID        = "RB_1";
            if (me.DoWay == 1)
            {
                rb.Checked = true;
            }

            //this.Pub1.AddFieldSet(rb);
            this.Pub1.Add("主菜单是编号的是从动菜单编号的前几位,不必联动内容。<br />");
            this.Pub1.Add("比如: 主下拉框是省份,联动菜单是城市。");
            //this.Pub1.AddFieldSetEnd();

            //this.Pub1.Add("</TD>");
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_SaveJiLian_Click);
            this.Pub1.AddTD("colspan=2", btn);

            if (i != 0)
            {
                btn        = new LinkBtn(false, NamesOfBtn.Delete, "删除");
                btn.Click += new EventHandler(btn_Del_Click);
                this.Pub1.AddTD("colspan=1", btn);
            }

            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
            this.Pub1.AddEasyUiPanelInfoEnd();
        }