Пример #1
0
        public void AddFEnum()
        {
            this.Title = "增加新字段向导";
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "'>增加新字段向导</a> - <a href='SysEnum.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "' ><img src='../Img/Btn/New.gif' />新建枚举</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("编号(点击增加到表单)");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTDTitle();
            this.Pub1.AddTREnd();

            BP.Sys.SysEnumMains sems = new SysEnumMains();
            QueryObject         qo   = new QueryObject(sems);

            this.Pub2.BindPageIdx(qo.GetCount(), pageSize, this.PageIdx, "Do.aspx?DoType=AddSysEnum&MyPK=" + this.MyPK + "&Idx=&GroupField");
            qo.DoQuery("No", pageSize, this.PageIdx);

            bool is1 = false;
            int  Idx = 0;

            foreach (BP.Sys.SysEnumMain sem in sems)
            {
                BP.Web.Controls.DDL ddl = null;
                try
                {
                    ddl = new BP.Web.Controls.DDL();
                    ddl.BindSysEnum(sem.No);
                }
                catch
                {
                    sem.Delete();
                }
                Idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(Idx);
                this.Pub1.AddTD("<a  href=\"javascript:AddEnum('" + this.MyPK + "','" + this.Idx + "','" + sem.No + "')\" >" + sem.No + "</a>");
                this.Pub1.AddTD(sem.Name);
                this.Pub1.AddTD("[<a href='SysEnum.aspx?DoType=Edit&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&RefNo=" + sem.No + "' >编辑</a>]");
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "特性集";
            this.BindLeft();
            if (this.DoType == null)
            {
                this.Pub2.AddFieldSet("帮助", " 特性集就是整个流程节点中的特定属性批量的修改。");
                return;
            }

            this.Pub2.AddFieldSet("编辑:" + this.Lab);
            this.Pub2.AddTable("border=0");
            this.Pub2.AddTR();
            switch (this.DoType)
            {
            case "Base":
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle("是否可以退回");
                this.Pub2.AddTDTitle("是否可删除");
                this.Pub2.AddTDTitle("是否可转发");
                this.Pub2.AddTDTitle("允许分配工作否?");
                this.Pub2.AddTDTitle("是否可以查看工作报告?");
                this.Pub2.AddTDTitle("是否是保密步骤?");
                break;

            case "FormType":
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle("类型");
                this.Pub2.AddTDTitle("URL");
                break;

            default:
                this.Pub2.AddTDTitle("步骤");
                this.Pub2.AddTDTitle("节点名称");
                this.Pub2.AddTDTitle(this.Lab);
                break;
            }
            this.Pub2.AddTREnd();

            BP.WF.Template.NodeSheets nds = new BP.WF.Template.NodeSheets();
            nds.Retrieve("FK_Flow", this.FK_Flow);

            BP.WF.Template.NodeSheet mynd = new BP.WF.Template.NodeSheet();
            Attr attr = null;

            try
            {
                attr = mynd.EnMap.GetAttrByKey(this.DoType);
            }
            catch
            {
            }

            foreach (BP.WF.Template.NodeSheet nd in nds)
            {
                if (this.FK_Node == nd.NodeID)
                {
                    this.Pub2.AddTR1();
                }
                else
                {
                    this.Pub2.AddTR();
                }

                switch (this.DoType)
                {
                case "Base":
                    break;

                case "FormType":
                    this.Pub2.AddTDIdx(nd.Step);
                    this.Pub2.AddTD(nd.Name);
                    BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                    ddl.ID = "DDL_" + nd.NodeID;
                    ddl.BindSysEnum("NodeFormType", nd.GetValIntByKey(NodeAttr.FormType));
                    this.Pub2.AddTD(ddl);
                    TextBox mytbURL = new TextBox();
                    mytbURL.ID      = "TB_" + nd.NodeID;
                    mytbURL.Text    = nd.GetValStringByKey(NodeAttr.FormUrl);
                    mytbURL.Columns = 50;
                    this.Pub2.AddTD(mytbURL);
                    break;

                default:
                    this.Pub2.AddTDIdx(nd.Step);
                    this.Pub2.AddTD(nd.Name);
                    switch (attr.UIContralType)
                    {
                    case UIContralType.TB:
                        TextBox mytb = new TextBox();
                        mytb.ID      = "TB_" + nd.NodeID;
                        mytb.Text    = nd.GetValStringByKey(this.DoType);
                        mytb.Columns = 50;
                        this.Pub2.AddTD(mytb);
                        break;

                    case UIContralType.CheckBok:
                        CheckBox mycb = new CheckBox();
                        mycb.ID      = "CB_" + nd.NodeID;
                        mycb.Text    = attr.Desc;
                        mycb.Checked = nd.GetValBooleanByKey(this.DoType);
                        this.Pub2.AddTD(mycb);
                        break;

                    case UIContralType.DDL:
                        BP.Web.Controls.DDL ddlm = new BP.Web.Controls.DDL();
                        ddlm.ID = "DDL_" + nd.NodeID;
                        ddlm.BindSysEnum(attr.UIBindKey, nd.GetValIntByKey(this.DoType));
                        this.Pub2.AddTD(ddlm);
                        break;

                    default:
                        break;
                    }
                    break;
                }
                this.Pub2.AddTREnd();
            }
            this.Pub2.AddTableEndWithHR();
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub2.Add(btn);
            this.Pub2.AddFieldSetEnd();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "表单事件";
            FrmEventXmls xmls = new FrmEventXmls();

            xmls.RetrieveAll();

            FrmEventXml curr = null;

            this.Pub1.Add("<a href='http://ccflow.org' target=_blank ><img src='/DataUser/ICON/" + SystemConfig.CompanyID + "/LogBiger.png' border=0 width='120px;' /></a><hr>");
            this.Pub1.AddUL();
            foreach (FrmEventXml xml in xmls)
            {
                if (xml.No == this.DoType)
                {
                    curr = xml;
                    this.Pub1.AddLi("<a href='FrmEvent.aspx?DoType=" + xml.No + "&FK_MapData=" + this.FK_MapData + "' ><b>" + xml.Name + "</b></a>");
                }
                else
                {
                    this.Pub1.AddLi("<a href='FrmEvent.aspx?DoType=" + xml.No + "&FK_MapData=" + this.FK_MapData + "' >" + xml.Name + "</a>");
                }
            }
            this.Pub1.AddULEnd();

            if (this.DoType == null)
            {
                this.Pub2.AddFieldSet("Help");
                this.Pub2.AddH2("什么是表单事件?");
                this.Pub2.AddH2("如何使用表单事件?");
                this.Pub2.Add("请参考操作手册, http://ccflow.org .");
                this.Pub2.AddFieldSetEnd();
                return;
            }

            FrmEvent fe = new FrmEvent(this.FK_MapData, this.DoType);

            this.Pub2.AddTable("width=100%");
            this.Pub2.AddCaptionLeft("表单事件:" + curr.Name);
            this.Pub2.AddTR();
            this.Pub2.AddTD("事件类型");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + FrmEventAttr.FK_Event;
            ddl.BindSysEnum("EventDoType", (int)fe.HisDoType);
            this.Pub2.AddTD(ddl);
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行内容<br>");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.DoDoc;
            tb.Text     = fe.DoDoc;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行成功提示<br>");
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.MsgOK;
            tb.Text     = fe.MsgOKString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();

            this.Pub2.AddTR();
            this.Pub2.AddTDBegin("colspan=2");
            this.Pub2.Add("执行错误提示<br>");
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + FrmEventAttr.MsgError;
            tb.Text     = fe.MsgErrorString;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 60;
            tb.Rows     = 5;
            this.Pub2.Add(tb);
            this.Pub2.AddTDEnd();
            this.Pub2.AddTREnd();
            this.Pub2.AddTableEndWithHR();

            Button btn = new Button();

            btn.Click   += new EventHandler(btn_Click);
            btn.Text     = " Save ";
            btn.CssClass = "Btn";
            this.Pub2.Add(btn);
        }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.UCSys1.AddTable();
        this.UCSys1.AddCaptionLeft("站点全局信息配置:(您也可以打开web.config中直接修改它)");
        this.UCSys1.AddTR();
        this.UCSys1.AddTDTitle("IDX");
        this.UCSys1.AddTDTitle("项目Key");
        this.UCSys1.AddTDTitle("名称");
        this.UCSys1.AddTDTitle("值");
        this.UCSys1.AddTDTitle("描述");
        this.UCSys1.AddTREnd();

        // BP.Web.WebUser.Style

        WebConfigDescs ens = new WebConfigDescs();

        ens.RetrieveAll();
        Configuration      cfg        = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
        AppSettingsSection appSetting = cfg.AppSettings;
        bool is1 = false;
        int  i   = 1;

        foreach (System.Configuration.KeyValueConfigurationElement mycfg in appSetting.Settings)
        {
            WebConfigDesc en = ens.GetEnByKey("No", mycfg.Key) as WebConfigDesc;
            if (en == null)
            {
                en    = new WebConfigDesc();
                en.No = mycfg.Key;
            }

            is1 = this.UCSys1.AddTR(is1);
            this.UCSys1.AddTDIdx(i++);
            this.UCSys1.AddTD(en.No);
            this.UCSys1.AddTD(en.Name);
            switch (en.DBType)
            {
            case "Boolen":

                RadioButton rb1 = new RadioButton();
                rb1.Text      = "是";
                rb1.GroupName = en.No;
                rb1.ID        = "rb1" + en.No;
                rb1.Enabled   = en.IsEnable;

                RadioButton rb0 = new RadioButton();
                rb0.Text      = "否";
                rb0.GroupName = en.No;
                rb0.ID        = "rb0" + en.No;
                rb0.Enabled   = en.IsEnable;


                if (System.Web.Configuration.WebConfigurationManager.AppSettings[en.No] == "1")
                {
                    rb1.Checked = true;
                }
                else
                {
                    rb0.Checked = true;
                }


                this.UCSys1.AddTDBegin();
                this.UCSys1.Add(rb1);
                this.UCSys1.Add(rb0);
                this.UCSys1.AddTDEnd();
                break;

            case "Enum":
                BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
                ddl.ID      = "DDL_" + en.No;
                ddl.Enabled = en.IsEnable;

                BP.Sys.SysEnums ses = new BP.Sys.SysEnums(en.No, en.Vals);
                ddl.BindSysEnum(en.No, int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings[en.No]));
                this.UCSys1.AddTD(ddl);
                break;

            case "String":
            default:
                TextBox tb = new TextBox();
                tb.ID      = "TB_" + en.No;
                tb.Text    = System.Web.Configuration.WebConfigurationManager.AppSettings[en.No];
                tb.Columns = 80;
                tb.Enabled = en.IsEnable;
                this.UCSys1.AddTD(tb);
                break;
            }
            this.UCSys1.AddTD(en.Note);
            //    this.UCSys1.AddTDBigDoc(en.Note);

            this.UCSys1.AddTREnd();
        }
        this.UCSys1.AddTRSum();
        this.UCSys1.AddTD();
        this.UCSys1.AddTD();
        this.UCSys1.AddTD();

        Button btn = new Button();

        btn.ID       = "Btn_Save";
        btn.Text     = " 保存全局设置 ";
        btn.CssClass = "Btn";

        this.UCSys1.AddTD(btn);
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.AddTD();
        this.UCSys1.AddTREnd();
        this.UCSys1.AddTableEnd();
    }
Пример #5
0
    public void SearchCond()
    {
        MapData  md            = new MapData(this.FK_MapData);
        MapAttrs attrs         = new MapAttrs(this.FK_MapData);
        MapAttrs attrsOfSearch = md.HisShowColsAttrs;

        #region 查询条件定义
        this.Pub2.AddH2("查询条件定义");

        this.Pub2.AddFieldSet("是否增加关键字查询");
        this.Pub2.Add("关键字查询是接受用户输入一个关键字,在整个表的列中用like 查询(外键、枚举、数值类型的除外)");
        this.Pub2.AddBR();
        CheckBox mycb = new CheckBox();
        mycb.ID      = "CB_IsSearchKey";
        mycb.Text    = "是否增加关键字查询";
        mycb.Checked = md.IsSearchKey;
        this.Pub2.Add(mycb);
        this.Pub2.AddFieldSetEnd();

        this.Pub2.AddFieldSet("外键与枚举类型");
        this.Pub2.Add("外键现枚举类型的数据才能进行下拉框查询,请选择要给查询。");
        this.Pub2.AddBR();

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

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

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

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

        if (isHave)
        {
            this.Pub2.AddFieldSet("时间段");
            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.HisDTSearchWay);
            this.Pub2.Add(ddl);

            this.Pub2.Add("&nbsp;字段:");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_DTSearchKey";
            foreach (MapAttr mattr in attrsOfSearch)
            {
                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.DTSearchKey);
            this.Pub2.Add(ddl);
            this.Pub2.AddFieldSetEnd();
        }

        this.Pub2.AddHR();
        Button btn = new Button();
        btn.Text     = "保存";
        btn.ID       = "Btn_Save";
        btn.CssClass = "Btn";
        btn.Click   += new EventHandler(btn_SearchCond_Click);
        this.Pub2.Add(btn);
        #endregion
    }
Пример #6
0
    public void BindAdv()
    {
        EnsAppCfgs ens = new EnsAppCfgs();

        ens.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        if (ens.Count == 0)
        {
            this.UCSys1.AddMsgOfInfo("提示:", "没有设置应用程序配置。");
            return;
        }

        this.UCSys1.AddTable("width=100%");
        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>");
        }
        else
        {
            this.UCSys1.AddCaptionLeftTX("基本设置");
        }

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

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

        foreach (Attr attr in attrs)
        {
            if (attr.IsRefAttr)
            {
                continue;
            }
            EnsAppCfg en = ens.GetEntityByKey(EnsAppCfgAttr.CfgKey, attr.Key) as EnsAppCfg;
            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 (en == null)
                {
                    ddl.SetSelectItem(attr.DefaultVal.ToString());
                }
                else
                {
                    ddl.SetSelectItem(en.CfgValOfInt);
                }

                this.UCSys1.AddTD(ddl);
                break;

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

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

        this.UCSys1.AddTableEnd();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";

        btn.Text   = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Pub1.AddTable();
            this.Pub1.AddCaption("演示使用BP的用户控件来呈现与采集数据.");

            this.Pub1.AddTR();
            this.Pub1.AddTD("帐号");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.No;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("不能为空,字母或者下划线组合.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("密码");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Pass;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("重输密码");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_Pass1";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("两次密码不能重复.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("姓名");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("不能为空");
            this.Pub1.AddTREnd();

            //枚举类型.
            this.Pub1.AddTR();
            this.Pub1.AddTD("性别");
            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.BindSysEnum("XB"); // 在Sys_Eumm 已经注册了该枚举值.
            ddl.ID = "TB_" + BPUserAttr.XB;
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请选择");
            this.Pub1.AddTREnd();


            // 数值类型.
            this.Pub1.AddTR();
            this.Pub1.AddTD("年龄");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Age;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("输入int类型数据.");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("地址");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Addr;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("电话");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Tel;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("邮件");
            tb    = new BP.Web.Controls.TB();
            tb.ID = "TB_" + BPUserAttr.Email;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            Button btn = new Button();

            btn.ID     = "Btn_Reg";
            btn.Text   = "注册新用户";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.AddTD("colspan=3", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Пример #8
0
    public void BindNormal()
    {
        EnsAppCfgs ens = new EnsAppCfgs();

        ens.Retrieve(EnsAppCfgAttr.EnsName, this.EnsName);

        EnsAppXmls xmls = new EnsAppXmls();

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

        this.UCSys1.AddTable("width=100%");
        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>");
        }
        else
        {
            this.UCSys1.AddCaptionLeftTX("基本设置");
        }
        this.UCSys1.AddTR();

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

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

        bool is1 = false;

        foreach (EnsAppXml xml in xmls)
        {
            EnsAppCfg en = ens.GetEntityByKey(EnsAppCfgAttr.CfgKey, xml.No) as EnsAppCfg;
            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 (en == null)
                {
                    ddl.SetSelectItem(xml.DefValInt);
                }
                else
                {
                    ddl.SetSelectItem(en.CfgValOfInt);
                }
                this.UCSys1.AddTD(ddl);
                break;

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

            default:
                TextBox tb = new TextBox();
                tb.ID = "TB_" + xml.No;
                if (en == null)
                {
                    tb.Text = xml.DefVal;
                }
                else
                {
                    tb.Text = en.CfgVal;
                }
                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();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";
        btn.Text     = "保存并关闭";
        btn.Click   += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Пример #9
0
    public void BindAdv()
    {
        this.UCSys1.AddTable("width=100%");

        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.AddTDTitle("配置项");
        this.UCSys1.AddTDTitle("内容");
        this.UCSys1.AddTDTitle("信息");
        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();
        Button btn = new Button();

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

        btn          = new Button();
        btn.ID       = "Btn_SaveAndClose";
        btn.CssClass = "Btn";

        btn.Text   = "保存并关闭";
        btn.Click += new EventHandler(btn_Click);
        this.UCSys1.Add(btn);
    }
Пример #10
0
        public void BindSFTable(SFTable en)
        {
            string star = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑表");
                }
            }
            else
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外键</a> - 新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外键</a> - 编辑表");
                }
            }

            if (this.RefNo == null)
            {
                this.Title = "新建表";
            }
            else
            {
                this.Title = "编辑表";
            }

            int  idx    = 0;
            bool isItem = false;

            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");


            // this.Ucsys1.AddFieldSet("帮助", help);

            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_FK_SFDBSrc";
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveDBSrc();
            ddl.Bind(srcs, en.FK_SFDBSrc);
            this.Ucsys1.AddTD(ddl);

            //  this.Ucsys1.AddTD("外键表的数据源必须与该表单的数据源一致.");
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("表中文名称" + star);
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID           = "TB_Name";
            tb.Text         = en.Name;
            tb.AutoPostBack = true;
            tb.TextChanged += new EventHandler(tbName_TextChanged);
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("该表的中文名称,比如:物料类别,科目。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("表英文名称" + star);
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_No";
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            if (tb.Text == "")
            {
                tb.Text = "";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();



            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("用于在下拉框中不同格式的展现.");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("数据源" + star);
            //ddl = new BP.Web.Controls.DDL();
            //SFDBSrcs srcs = new SFDBSrcs();
            //BP.En.QueryObject qo = new QueryObject(srcs);
            //qo.AddWhere(SFDBSrcAttr.DBSrcType, " < ", "100");
            //qo.DoQuery();
            //ddl.Bind(srcs, en.FK_SFDBSrc);
            //this.Ucsys1.AddTD(ddl);
            //this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            //this.Ucsys1.AddTREnd();


            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("描述" + star);
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_TableDesc";
            //tb.Text = en.TableDesc;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("对该表的备注,比如:物料类别字典表,科目字典表。");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }

            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);


            btn      = new Button();
            btn.ID   = "Btn_Edit";
            btn.Text = "编辑数据"; // "编辑数据"
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }
            if (en.IsClass)
            {
                btn.Attributes["onclick"] = "WinOpen('../Search.aspx?EnsName=" + en.No + "', 'dg'); return false;";
            }
            else
            {
                btn.Attributes["onclick"] = "WinOpen('SFTableEditData.aspx?RefNo=" + this.RefNo + "', 'dg'); return false;";
            }

            this.Ucsys1.Add(btn);

            if (this.FromApp != "SL")
            {
                btn          = new Button();
                btn.ID       = "Btn_Add";
                btn.CssClass = "Btn";

                btn.Text = "添加到表单";;  // "添加到表单";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Add_Click);
                if (this.RefNo == null)
                {
                    btn.Enabled = false;
                }
            }

            this.Ucsys1.Add(btn);
            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";

            btn.Text = "删除";
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }

            btn.Click += new EventHandler(btn_Del_Click);
            this.Ucsys1.Add(btn);

            //string help = "<ul>";
            //help += "<li>输入:新表名或已经存在的表名或者视图,必须是英文字母或者下划线。</li>";
            //help += "<li>如果该表或者视图已经存在本机中,系统就会把他注册到ccform的数据源(Sys_SFTable)里,您可以打开Sys_SFTable查看ccform对外部数据源管理的信息。</li>";
            //help += "<li>如果不存在ccform就会自动创建表,该表有No,Name两个列,并且初始化3笔数据,您可以对该表进行编辑。</li>";
            //help += "</ul>";

            this.Ucsys1.Add(BP.WF.Glo.GenerHelpCCForm("帮助", null, null));

            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();
        }
Пример #11
0
        public void BindSFTable(SFTable en)
        {
            bool   isItem = false;
            string star   = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            #region 生成标题.
            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑表");
                }
            }
            else
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外部表</a> - 新建表");
                }
                else
                {
                    this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>外部表</a> - 编辑表");
                }
            }

            if (this.RefNo == null)
            {
                this.Title = "新建表";
            }
            else
            {
                this.Title = "编辑表";
            }

            #endregion 生成标题.

            int idx = 0;
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);

            BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_FK_SFDBSrc";

            SFDBSrcs srcs = new SFDBSrcs();
            srcs.RetrieveDBSrc();

            ddl.Bind(srcs, en.FK_SFDBSrc);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("中文名称" + star);
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ID           = "TB_" + SFTableAttr.Name;
            tb.Text         = en.Name;
            tb.Columns      = 35;
            tb.AutoPostBack = true;
            tb.TextChanged += new EventHandler(tbName_TextChanged);
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("该表的中文名称,比如:物料类别,科目。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("英文名称" + star);
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.No;
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            if (tb.Text == "")
            {
                tb.Text = "";
            }
            tb.Columns = 35;
            tb.Attributes["onkeyup"] = "return IsDigit(this);";


            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();


            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("字典表的数据结构,用于在下拉框中不同格式的展现。");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("描述");
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_"+SFTableAttr.TableDesc;
            //tb.Text = en.TableDesc;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("对该表的备注,比如:物料类别字典表,科目字典表。");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "查询SQL" + star + "支持ccform表达式,允许有@WebUser.No,@WebUser.Name,@WebUser.FK_Dept变量。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + SFTableAttr.SelectStatement; //查询.
            tb.Text     = en.SelectStatement;                  //查询语句.
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 4;
            tb.Columns  = 70;
            //tb.Attributes["width"] = "98%";
            this.Ucsys1.AddTD("colspan=3", tb);
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "比如:SELECT BH AS No, MC as Name FROM CC_USER WHERE CCType=3<br>SELECT BH AS No, MC as Name FROM CC_USER WHERE [email protected]_Dept");
            this.Ucsys1.AddTREnd();

            //isItem = this.Ucsys1.AddTR(isItem);
            //this.Ucsys1.AddTDIdx(idx++);
            //this.Ucsys1.AddTD("数据缓存(分钟)" + star);
            //tb = new BP.Web.Controls.TB();
            //tb.ID = "TB_"+SFTableAttr.CashMinute;
            //tb.TextExtInt = en.CashMinute;
            //tb.Columns = 5;
            //this.Ucsys1.AddTD(tb);
            //this.Ucsys1.AddTD("默认为0表示不缓存,缓存的数据存储在Sys_Dict里面.");
            //this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }
            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);

            //btn = new Button();
            //btn.ID = "Btn_Edit";
            //btn.CssClass = "Btn";
            //btn.Text =  "查看数据"; // "编辑数据"
            //if (this.RefNo == null)
            //    btn.Enabled = false;
            //if (en.IsClass)
            //    btn.Attributes["onclick"] = "WinOpen('../Search.aspx?EnsName=" + en.No + "','dg' ); return false;";
            //else
            //    btn.Attributes["onclick"] = "WinOpen('SFTableEditData.aspx?RefNo=" + this.RefNo + "','dg' ); return false;";
            //this.Ucsys1.Add(btn);

            if (this.FromApp != "SL")
            {
                btn          = new Button();
                btn.ID       = "Btn_Add";
                btn.CssClass = "Btn";
                btn.Text     = "添加到表单";; // "添加到表单";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Add_Click);
                if (this.RefNo == null)
                {
                    btn.Enabled = false;
                }
                this.Ucsys1.Add(btn);
            }

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "删除";
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }

            btn.Click += new EventHandler(btn_Del_Click);
            this.Ucsys1.Add(btn);
            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();

            //string help = "<ul>";
            //help += "<li>输入:新表名或已经存在的表名或者视图,必须是英文字母或者下划线。</li>";
            //help += "<li>如果该表或者视图已经存在本机中,系统就会把他注册到ccform的数据源(Sys_SFTable)里,您可以打开Sys_SFTable查看ccform对外部数据源管理的信息。</li>";
            //help += "<li>如果不存在ccform就会自动创建表,该表有No,Name两个列,并且初始化3笔数据,您可以对该表进行编辑。</li>";
            //help += "</ul>";
            //this.Ucsys1.AddFieldSet("帮助", help);
        }
Пример #12
0
        public void BindSFTable(SFTable en)
        {
            bool   isItem = false;
            string star   = "<font color=red><b>(*)</b></font>";

            this.Ucsys1.AddTable();

            #region 生成标题.
            if (this.FromApp == "SL")
            {
                if (this.RefNo == null)
                {
                    this.Ucsys1.AddCaption("新建WebService数据源接口");
                }
                else
                {
                    this.Ucsys1.AddCaption("编辑WebService数据源接口");
                }
            }
            else
            {
                this.Ucsys1.AddCaption("<a href='Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'><img src='/WF/Img/Btn/Back.gif'>返回</a> - <a href='Do.aspx?DoType=AddSFWS&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "'>WebService数据源接口</a> - 新建WebService数据源接口");
            }

            if (this.RefNo == null)
            {
                this.Title = "新建WebService数据源接口";
            }
            else
            {
                this.Title = "编辑WebService数据源接口";
            }

            #endregion 生成标题.

            int idx = 0;
            this.Ucsys1.AddTR();
            this.Ucsys1.AddTDTitle("Idx");
            this.Ucsys1.AddTDTitle("项目");
            this.Ucsys1.AddTDTitle("采集");
            this.Ucsys1.AddTDTitle("备注");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("接口英文名称" + star);
            var tb = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.No;
            tb.Text = en.No;
            if (this.RefNo == null)
            {
                tb.Enabled = true;
            }
            else
            {
                tb.Enabled = false;
            }

            if (tb.Text == "")
            {
                tb.Text = "SF_";
            }

            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTDBigDoc("必须以字母或者下划线开头,不能包含特殊字符。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("接口中文名称" + star);
            tb      = new BP.Web.Controls.TB();
            tb.ID   = "TB_" + SFTableAttr.Name;
            tb.Text = en.Name;
            this.Ucsys1.AddTD(tb);
            this.Ucsys1.AddTD("WebService中的接口方法的中文名称。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("数据源" + star);
            BP.Web.Controls.DDL ddl  = new BP.Web.Controls.DDL();
            SFDBSrcs            srcs = new SFDBSrcs();
            BP.En.QueryObject   qo   = new QueryObject(srcs);
            qo.AddWhere(SFDBSrcAttr.DBSrcType, " = ", "100");
            qo.DoQuery();
            ddl.Bind(srcs, en.FK_SFDBSrc);
            ddl.ID                    = "DDL_" + SFTableAttr.FK_SFDBSrc;
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("选择数据源,点击这里<a href=\"javascript:WinOpen('/WF/Comm/Search.aspx?EnsName=BP.Sys.SFDBSrcs')\">创建</a>,<a href='SFWS.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx='>刷新</a>。");
            this.Ucsys1.AddTREnd();

            var rt = en.TableDesc.Split(',');

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("选择接口" + star);
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.TableDesc;

            if (srcs.Count > 0)
            {
                var ms = GetWebServiceMethods(!string.IsNullOrWhiteSpace(en.FK_SFDBSrc) ? (SFDBSrc)srcs.GetEntityByKey(SFDBSrcAttr.No, en.FK_SFDBSrc) : (SFDBSrc)srcs[0]);

                foreach (var m in ms)
                {
                    ddl.Items.Add(new ListItem(m.Value, m.Key));
                }

                ddl.SetSelectItem(rt.Length == 2 ? rt[0] : ms.Count > 0 ? ms.First().Key : string.Empty);
            }

            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTDBigDoc("选择WebService中的接口方法名。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "接口参数定义" + star + "支持ccform表达式,允许有@WebUser.No,@WebUser.Name,@WebUser.FK_Dept变量。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_" + SFTableAttr.SelectStatement;
            tb.Text     = en.SelectStatement;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 3;
            tb.Columns  = 70;
            this.Ucsys1.AddTD("colspan=3", tb);
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("colspan=3", "如:WorkId=@WorkID&FK_Flow=@FK_Flow&FK_Node=@FK_Node&SearchType=1,带@的参数值在运行时自动使用发起流程的相关参数值替换,而不带@的参数值使用后面的赋值;参数个数与WebServices接口方法的参数个数一致,且顺序一致,且值均为字符类型。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("返回值类型" + star);
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_ResultType";

            ddl.Items.Add(new ListItem("DataTable数据表", "DataTable"));
            ddl.Items.Add(new ListItem("DataSet数据集", "DataSet"));
            ddl.Items.Add(new ListItem("Json字符串", "Json"));
            ddl.Items.Add(new ListItem("Xml字符串", "Xml"));

            if (rt.Length == 2)
            {
                ddl.SetSelectItem(rt[1]);
            }

            this.Ucsys1.AddTDBegin();
            this.Ucsys1.Add(ddl);
            this.Ucsys1.AddBR();
            this.Ucsys1.Add("注意:所有返回值类型都需有No,Name这两列。" +
                            "<script type='text/javascript'>" +
                            "   var info = '1. DataTable数据表,必须为DataTable命名。\\n" +
                            "2. DataSet数据集,只取数据集里面的第1个DataTable。\\n" +
                            "3. Json字符串,格式如:\\n" +
                            "[\\n" +
                            "  {\"No\":\"001\",\"Name\":\"生产部\"},\\n" +
                            "  {\"No\":\"002\",\"Name\":\"研发部\"},\\n" +
                            "  ...\\n" +
                            "]\\n" +
                            "4. Xml字符串,格式如:\\n" +
                            "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\\n" +
                            "<Array>\\n" +
                            "  <Item>\\n" +
                            "    <No>001</No>\\n" +
                            "    <Name>生产部</Name>\\n" +
                            "  </Item>\\n" +
                            "  <Item>\\n" +
                            "    <No>002</No>\\n" +
                            "    <Name>研发部</Name>\\n" +
                            "  </Item>\\n" +
                            "  ...\\n" +
                            "</Array>';" +
                            "</script>" +
                            "<a href='javascript:void(0)' onclick='alert(info)'>格式说明</a>");
            this.Ucsys1.AddTDEnd();
            this.Ucsys1.AddTDBigDoc("选择WebService中的接口方法返回值的类型。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.AddTD("返回数据结构");
            ddl    = new BP.Web.Controls.DDL();
            ddl.ID = "DDL_" + SFTableAttr.CodeStruct;
            ddl.BindSysEnum(SFTableAttr.CodeStruct, (int)en.CodeStruct);
            this.Ucsys1.AddTD(ddl);
            this.Ucsys1.AddTD("WebService接口返回的数据结构,用于在下拉框中不同格式的展现。");
            this.Ucsys1.AddTREnd();

            isItem = this.Ucsys1.AddTR(isItem);
            this.Ucsys1.AddTDIdx(idx++);
            this.Ucsys1.Add("<TD colspan=3 align=center>");
            Button btn = new Button();
            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            if (this.RefNo == null)
            {
                btn.Text = "创建";
            }
            else
            {
                btn.Text = "保存";
            }
            btn.Click += new EventHandler(btn_Save_Click);
            this.Ucsys1.Add(btn);

            if (this.FromApp != "SL")
            {
                btn          = new Button();
                btn.ID       = "Btn_Add";
                btn.CssClass = "Btn";
                btn.Text     = "添加到表单";; // "添加到表单";
                btn.Attributes["onclick"] = " return confirm('您确认吗?');";
                btn.Click += new EventHandler(btn_Add_Click);
                if (this.RefNo == null)
                {
                    btn.Enabled = false;
                }
                this.Ucsys1.Add(btn);
            }

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "删除";
            btn.Attributes["onclick"] = " return confirm('您确认吗?');";
            if (this.RefNo == null)
            {
                btn.Enabled = false;
            }

            btn.Click += new EventHandler(btn_Del_Click);
            this.Ucsys1.Add(btn);
            this.Ucsys1.Add("</TD>");
            this.Ucsys1.AddTREnd();
            this.Ucsys1.AddTableEnd();
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //没有指定父容器高宽,宽度100%不可用,
            //指定固定width,页面放大缩小,布局不会乱
            this.Pub1.AddTable(" style='width:100%;' ");
            this.Pub1.AddCaption("表单[" + md.Name + "]与流程[" + flow.Name + "]上全部节点的绑定");

            this.Pub1.AddTR();
            string thCenter = "' style='text-align:center;'";

            this.Pub1.AddTH(thCenter, "节点编号");
            this.Pub1.AddTH(thCenter, "是否绑定");
            this.Pub1.AddTH(thCenter, "可否编辑");
            this.Pub1.AddTH(thCenter, "可否打印");
            this.Pub1.AddTH(thCenter, "是否启用装载填充事件");
            this.Pub1.AddTH(thCenter, "权限控制方案");
            this.Pub1.AddTH(thCenter, "表单元素控制方案");
            this.Pub1.AddTH(thCenter, "谁是主键");
            this.Pub1.AddTREnd();


            int      idx = 1;
            FrmNode  fn  = null;
            CheckBox cb  = null;

            BP.Web.Controls.DDL ddl = null;

            #region 循环添加Node
            foreach (Node nd in nds)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(nd.NodeID);

                //检索出来的数据是唯一的
                fn = new FrmNode(this.FK_Flow,
                                 nd.NodeID, this.FK_MapData);

                cb      = new CheckBox();
                cb.ID   = "CB_NodeName_" + nd.NodeID;
                cb.Text = nd.Name;

                if (fn.FK_Node == nd.NodeID)
                {
                    cb.Checked = true;
                }
                else
                {
                    cb.Checked = false;
                }

                this.Pub1.AddTD(" ' style='with:100px;' ", cb);


                cb         = new CheckBox();
                cb.ID      = "CB_IsEdit_" + nd.NodeID;
                cb.Text    = "可否编辑";
                cb.Checked = fn.IsEdit;
                this.Pub1.AddTD(thCenter, cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsPrint_" + nd.NodeID;
                cb.Text    = "可否打印";
                cb.Checked = fn.IsPrint;
                this.Pub1.AddTD(thCenter, cb);

                cb         = new CheckBox();
                cb.ID      = "CB_IsEnableLoadData_" + nd.NodeID;
                cb.Text    = "是否启用";
                cb.Checked = fn.IsEnableLoadData;
                this.Pub1.AddTD(thCenter, cb);

                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_Sln_" + nd.NodeID;
                ddl.Items.Add(new ListItem("默认方案", "0"));
                ddl.Items.Add(new ListItem("自定义", nd.NodeID.ToString()));
                ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案.
                this.Pub1.AddTD(thCenter, ddl);


                this.Pub1.AddTDBegin(" style='text-align:center;' ");
                this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >字段</a>");
                this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >附件</a>");
                this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >从表</a>");

                if (md.HisFrmType == FrmType.ExcelFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>");
                }

                if (md.HisFrmType == FrmType.WordFrm)
                {
                    this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + nd.NodeID + "','" + this.FK_Flow + "')\" >ToolbarWord</a>");
                }

                this.Pub1.AddTDEnd();


                ddl    = new BP.Web.Controls.DDL();
                ddl.ID = "DDL_WhoIsPK_" + nd.NodeID;
                ddl.BindSysEnum("WhoIsPK");
                ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?.
                this.Pub1.AddTD(thCenter, ddl);

                this.Pub1.AddTREnd();
                idx += 1;
            }
            #endregion  循环添加Node

            this.Pub1.AddTR();
            this.Pub1.AddTDBegin(" colspan='8' style='text-align:right;border:none;padding-top:20px;' ");

            Button btn = new Button();
            btn.ID       = "Save";
            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SavePowerOrders_Click);

            this.Pub1.Add(btn);

            string text = "<input style='margin-left:20px;margin-right:40px;' type=button " +
                          "onclick=\"javascript:closeCurTab(\'" + md.Name + "\');\" value='关闭'  class=Btn />";
            this.Pub1.Add(text);

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