Exemplo n.º 1
0
    public void BindNormal()
    {
        //EnsAppCfgs ens = new EnsAppCfgs();
        //ens.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        Entities ens = BP.En.ClassFactory.GetEns(this.EnsName);

        UIConfig cfg = new UIConfig(ens.GetNewEntity);

        EnsAppXmls xmls = new EnsAppXmls();

        xmls.Retrieve("EnsName", this.EnsName);

        //this.UCSys1.AddTable("width=100%");
        this.UCSys1.AddTableNormal();

        if (BP.Web.WebUser.No == "admin")
        {
            //this.UCSys1.AddCaptionLeftTX("<a href='?EnsName=" + this.EnsName + "'>基本设置</a> - <a href='?EnsName=" + this.EnsName + "&DoType=Adv'>高级设置</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "' >导入导出</a>");
            this.UCSys1.AddTRGroupTitle(4,
                                        "<a href='?EnsName=" + this.EnsName + "'>基本设置</a> - <a href='?EnsName=" +
                                        this.EnsName + "&DoType=Adv'>高级设置</a> - <a href='EnsDataIO.aspx?EnsName=" +
                                        this.EnsName + "&T=" +
                                        DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                        "' >导入导出</a>");
        }
        else
        {
            //this.UCSys1.AddCaptionLeftTX("基本设置");
            this.UCSys1.AddTRGroupTitle(4, "基本设置");
        }

        this.UCSys1.AddTR();

        this.UCSys1.AddTR();
        this.UCSys1.AddTDGroupTitle("配置项");
        this.UCSys1.AddTDGroupTitle("内容");
        this.UCSys1.AddTDGroupTitle("信息");
        this.UCSys1.AddTDGroupTitle("备注");
        this.UCSys1.AddTREnd();

        bool is1 = false;

        foreach (EnsAppXml xml in xmls)
        {
            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTD(xml.No);
            this.UCSys1.AddTD(xml.Name);
            switch (xml.DBType)
            {
            case "Enum":
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + xml.No;

                SysEnums ses = new SysEnums(xml.EnumKey, xml.EnumVals);
                ddl.BindSysEnum(xml.EnumKey);

                if (cfg.HisAP.GetValStrByKey(xml.No) == null)
                {
                    ddl.SetSelectItem(xml.DefValInt);
                }
                else
                {
                    ddl.SetSelectItem(cfg.HisAP.GetValIntByKey(xml.No));
                }
                this.UCSys1.AddTD(ddl);
                break;

            case "Boolen":
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + xml.No;
                cb.Text = xml.Name;
                if (cfg.HisAP.GetValStrByKey(xml.No) == null)
                {
                    cb.Checked = xml.DefValBoolen;
                }
                else
                {
                    cb.Checked = cfg.HisAP.GetValBoolenByKey(xml.No);
                }
                this.UCSys1.AddTD(cb);
                break;

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + xml.No;
                if (cfg.HisAP.GetValStrByKey(xml.No) == null)
                {
                    tb.Text = xml.DefVal;
                }
                else
                {
                    tb.Text = cfg.HisAP.GetValStrByKey(xml.No);
                }
                tb.Attributes["width"] = "100%";
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTDBigDoc(xml.Desc);
            this.UCSys1.AddTREnd();
        }

        if (xmls.Count == 0)
        {
            this.UCSys1.AddTableEnd();
            return;
        }

        this.UCSys1.AddTableEnd();
        this.UCSys1.AddBR();
        this.UCSys1.AddSpace(1);

        //Button btn = new Button();
        LinkBtn btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

        //btn.ID = "Btn_Save";
        //btn.Text = "保存";
        //btn.CssClass = "Btn";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
        this.UCSys1.AddSpace(1);

        //btn = new Button();
        btn = new LinkBtn(false, NamesOfBtn.SaveAndClose, "保存并关闭");
        //btn.ID = "Btn_SaveAndClose";
        //btn.CssClass = "Btn";
        //btn.Text = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData md = new MapData();

            md.No = this.RptNo;
            md.RetrieveFromDBSources();

            MapAttrs attrs = new MapAttrs(this.RptNo);

            #region 查询条件定义

            this.Pub2.Add("<div style='width:100%'>");
            this.Pub2.Add("<div class='easyui-panel' title='是否增加关键字查询' data-options=\"iconCls:'icon-tip',fit:true\" style='height:auto;padding:10px'>");
            this.Pub2.Add("关键字查询是接受用户输入一个关键字,在整个报表的显示列中使用like查询(外键、枚举、数值类型的除外)");
            this.Pub2.AddBR();

            CheckBox mycb = new CheckBox();
            mycb.ID      = "CB_IsSearchKey";
            mycb.Text    = "是否增加关键字查询";
            mycb.Checked = md.RptIsSearchKey;
            this.Pub2.Add(mycb);
            this.Pub2.AddDivEnd();
            this.Pub2.AddDivEnd();
            this.Pub2.AddBR();

            this.Pub2.Add("<div style='width:100%'>");
            this.Pub2.Add("<div class='easyui-panel' title='外键与枚举类型' data-options=\"iconCls:'icon-tip',fit:true\" style='height:auto;padding:10px'>");
            this.Pub2.Add("外键、枚举类型的数据可以添加到查询条件中,请选择要添加的查询条件:");
            this.Pub2.AddBR();

            foreach (MapAttr mattr in attrs)
            {
                if (mattr.UIContralType != UIContralType.DDL)
                {
                    continue;
                }

                CheckBox cb = new CheckBox();
                cb.ID = "CB_F_" + mattr.KeyOfEn;
                if (md.RptSearchKeys.Contains("*" + mattr.KeyOfEn))
                {
                    cb.Checked = true;
                }

                cb.Text = mattr.Name + "(" + mattr.KeyOfEn + ")";
                this.Pub2.Add(cb);
                this.Pub2.AddBR();
            }

            this.Pub2.AddDivEnd();
            this.Pub2.AddDivEnd();
            this.Pub2.AddBR();

            bool isHave = false;

            foreach (MapAttr mattr in attrs)
            {
                if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
                {
                    isHave = true;
                    break;
                }
            }

            if (isHave)
            {
                this.Pub2.Add("<div style='width:100%'>");
                this.Pub2.Add("<div class='easyui-panel' title='时间段' data-options=\"iconCls:'icon-tip',fit:true\" style='height:auto;padding:10px'>");
                this.Pub2.Add("对数据按照时间段进行查询,比如:按流程的发起时间,在指定时间段内进行查询。");
                this.Pub2.AddBR();

                this.Pub2.Add("选择方式:");
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_DTSearchWay";
                ddl.BindSysEnum("DTSearchWay");
                ddl.SetSelectItem((int)md.RptDTSearchWay);
                this.Pub2.Add(ddl);
                this.Pub2.AddSpace(3);

                this.Pub2.Add("字段:");
                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_DTSearchKey";

                foreach (MapAttr mattr in attrs)
                {
                    if (mattr.MyDataType == DataType.AppDate || mattr.MyDataType == DataType.AppDateTime)
                    {
                        if (mattr.UIVisible == false)
                        {
                            continue;
                        }
                        ddl.Items.Add(new ListItem(mattr.KeyOfEn + "  " + mattr.Name, mattr.KeyOfEn));
                    }
                }

                ddl.SetSelectItem(md.RptDTSearchKey);
                this.Pub2.Add(ddl);
                this.Pub2.AddDivEnd();
                this.Pub2.AddDivEnd();
            }
            #endregion
        }
Exemplo n.º 3
0
    public void BindAdv()
    {
        //this.UCSys1.AddTable("width=100%");
        this.UCSys1.AddTableNormal();
        this.UCSys1.AddTRGroupTitle(3,
                                    "<b>基本配置</b> - <a href='?EnsName=" + this.EnsName + "&DoType=SelectCols&T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "'>选择列</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "&T=" +
                                    DateTime.Now.ToString("yyyyMMddHHmmssfff") +
                                    "' >数据导入导出</a>");
        //this.UCSys1.AddCaptionLeftTX("<b>基本配置</b> - <a href='?EnsName=" + this.EnsName + "&DoType=SelectCols&T=" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "'>选择列</a> - <a href='EnsDataIO.aspx?EnsName=" + this.EnsName + "' >数据导入导出</a>");

        this.UCSys1.AddTR();
        this.UCSys1.AddTDGroupTitle("配置项");
        this.UCSys1.AddTDGroupTitle("内容");
        this.UCSys1.AddTDGroupTitle("信息");
        this.UCSys1.AddTREnd();

        Entity   en1   = BP.En.ClassFactory.GetEns(this.EnsName).GetNewEntity;
        Attrs    attrs = en1.EnMap.HisCfgAttrs;
        UIConfig cfg   = new UIConfig(en1);
        bool     is1   = false;

        foreach (Attr attr in attrs)
        {
            if (attr.IsRefAttr)
            {
                continue;
            }

            if (attr.UIVisible == false)    //added by liuxc,2015-8-7
            {
                continue;
            }

            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTD(attr.Key);
            this.UCSys1.AddTD(attr.Desc);
            switch (attr.UIContralType)
            {
            case UIContralType.DDL:
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_" + attr.Key;

                SysEnums ses = new SysEnums(attr.Key, attr.UITag);
                ddl.BindSysEnum(attr.Key);

                if (string.IsNullOrEmpty(cfg.HisAP.GetValStrByKey(attr.Key)))
                {
                    ddl.SetSelectItem(attr.DefaultVal.ToString());
                }
                else
                {
                    ddl.SetSelectItem(cfg.HisAP.GetValIntByKey(attr.Key));
                }

                this.UCSys1.AddTD(ddl);
                break;

            case UIContralType.CheckBok:
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + attr.Key;
                cb.Text = attr.Desc;
                if (string.IsNullOrEmpty(cfg.HisAP.GetValStrByKey(attr.Key)))
                {
                    if (attr.DefaultVal.ToString() == "0")
                    {
                        cb.Checked = false;
                    }
                    else
                    {
                        cb.Checked = true;
                    }
                }
                else
                {
                    cb.Checked = cfg.HisAP.GetValBoolenByKey(attr.Key);    // en.CfgValOfBoolen;
                }
                this.UCSys1.AddTD(cb);
                break;

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + attr.Key;
                if (cfg.HisAP.GetValStrByKey(attr.Key) == null)
                {
                    tb.Text = attr.DefaultVal.ToString();
                }
                else
                {
                    tb.Text = cfg.HisAP.GetValStrByKey(attr.Key);
                }
                tb.Attributes["width"] = "100%";
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTREnd();
        }

        this.UCSys1.AddTableEnd();
        this.UCSys1.AddBR();
        this.UCSys1.AddSpace(1);

        //Button btn = new Button();
        LinkBtn btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

        //btn.ID = "Btn_Save";
        //btn.CssClass = "Btn";
        //btn.Text = "保存";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
        this.UCSys1.AddSpace(1);

        //btn = new Button();
        btn = new LinkBtn(false, NamesOfBtn.SaveAndClose, "保存并关闭");
        //btn.ID = "Btn_SaveAndClose";
        //btn.CssClass = "Btn";
        //btn.Text = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }