Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                BP.WF.Flow fl = new BP.WF.Flow(this.FK_Flow);

                //设置状态.
                if (fl.DTSWay == BP.WF.Template.FlowDTSWay.None)
                {
                    this.RB_DTSWay0.Checked = true;
                }
                else
                {
                    this.RB_DTSWay1.Checked = true;
                }

                //绑定数据源.
                BP.Sys.SFDBSrcs srcs = new BP.Sys.SFDBSrcs();
                srcs.RetrieveAll();
                BP.Web.Controls.Glo.DDL_BindEns(this.DDL_DBSrc, srcs, fl.DTSDBSrc);

                //设置自动.
                this.DDL_DBSrc.AutoPostBack          = true;
                this.DDL_DBSrc.SelectedIndexChanged += new EventHandler(DDL_DBSrc_SelectedIndexChanged);

                //绑定表.
                BP.Sys.SFDBSrc src = new SFDBSrc(fl.DTSDBSrc);
                DataTable      dt  = src.GetTables();
                dt = RemoveView(dt);//去除视图

                BP.Web.Controls.Glo.DDL_BindDataTable(this.DDL_Table, dt, fl.DTSBTable);
                //设置自动.
                this.DDL_Table.AutoPostBack          = true;
                this.DDL_Table.SelectedIndexChanged += new EventHandler(DDL_Table_SelectedIndexChanged);

                //绑定字段同步的方式.
                if (fl.DTSField == BP.WF.Template.DTSField.SameNames)
                {
                    this.RB_DTSField0.Checked = true;
                }
                else
                {
                    this.RB_DTSField1.Checked = true;
                }

                //绑定同步的时间.
                if (fl.DTSTime == BP.WF.Template.FlowDTSTime.AllNodeSend)
                {
                    this.RB_DTSTime0.Checked = true;
                }
                if (fl.DTSTime == BP.WF.Template.FlowDTSTime.SpecNodeSend)
                {
                    this.RB_DTSTime1.Checked = true;
                }
                if (fl.DTSTime == BP.WF.Template.FlowDTSTime.WhenFlowOver)
                {
                    this.RB_DTSTime2.Checked = true;
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Response.Redirect("ImpTableField1504.aspx?EnsName=" + this.FK_MapData,
            //    true);
            //return;

            #region 第1步.
            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();

                Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='ImpTableField.aspx?Step=2&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('/WF/Comm/RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion 第1步.

            #region 第2步.
            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                this.Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                this.Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 数据表/视图'\" style='width:200px;'>",
                                            src.DBName));

                DataTable dt = src.GetTables();
                this.Pub1.AddUL();
                foreach (DataRow dr in dt.Rows)
                {
                    string url = "?Step=" + this.Step + "&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + this.FK_SFDBSrc + "&STable=" + dr["No"].ToString();
                    if (dr["No"].ToString() == this.STable)
                    {
                        this.Pub1.Add("<li><font color=red><b>" + dr["Name"] + "</font></b></li>");
                    }
                    else
                    {
                        this.Pub1.Add("<li><a href='" + url + "' >" + dr["Name"] + "</a></li>");
                    }
                }
                this.Pub1.AddULEnd();

                Pub1.AddDivEnd();

                this.Pub1.Add("<div data-options=\"region:'center',title:'第2步:请选择要导入的数据列(" + this.STable + ")'\" style='padding:5px;'>");

                //加载选中数据表/视图的列信息
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                this.Pub1.AddTR();

                var cb = new CheckBox();
                cb.ID = "CB_CheckAll";
                cb.Attributes["onclick"] = "CheckAll(this.checked)";

                this.Pub1.AddTDGroupTitle("style='width:40px;text-align:center'", cb);
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("style='width:80px;text-align:center'", "类型");
                this.Pub1.AddTDGroupTitle("style='width:50px;text-align:center'", "最大长度");
                this.Pub1.AddTREnd();

                MapAttrs attrs  = new MapAttrs(this.FK_MapData);
                bool     isHave = false;

                var tableColumns = src.GetColumns(this.STable);
                foreach (DataRow dr in tableColumns.Rows)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_Col_" + dr["name"];
                    cb.Checked = this.SColumns == null ? false : this.SColumns.Contains(dr["name"] + ",");

                    //如果已经有该字段,就放弃.
                    if (attrs.Contains(MapAttrAttr.KeyOfEn, dr["name"].ToString()))
                    {
                        continue;
                        cb.Enabled = false;
                    }

                    this.Pub1.AddTR();
                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(dr["colid"].ToString());
                    this.Pub1.AddTD(dr["name"].ToString());
                    this.Pub1.AddTD(dr["Desc"].ToString());
                    this.Pub1.AddTD(dr["type"].ToString());
                    this.Pub1.AddTD(Convert.ToInt32(dr["length"]));
                    this.Pub1.AddTREnd();
                }


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

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}?Step=1&FK_MapData={1}' class='easyui-linkbutton'>上一步</a>", Request.Url.AbsolutePath, this.FK_MapData));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddDivEnd();
                this.Pub1.AddDivEnd();
            }
            #endregion 第2步.

            #region 第3步.
            if (this.Step == 3)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0' border='0' style='width:100%'");
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("数据类型");
                this.Pub1.AddTDGroupTitle("逻辑类型");
                this.Pub1.AddTDGroupTitle("绑定值(双击选择)");
                this.Pub1.AddTDGroupTitle("最大长度");
                this.Pub1.AddTDGroupTitle("顺序");
                this.Pub1.AddTREnd();

                var tableColumns = src.GetColumns(this.STable);
                var idx          = 0;

                foreach (DataRow dr in tableColumns.Rows)
                {
                    if (this.SColumns.Contains(dr["name"] + ",") == false)
                    {
                        continue;
                    }

                    string typeString = dr["type"].ToString().ToLower();
                    int    mydatatype = 1;
                    if (typeString.Contains("int"))
                    {
                        mydatatype = BP.DA.DataType.AppInt;
                    }
                    if (typeString.Contains("float"))
                    {
                        mydatatype = BP.DA.DataType.AppFloat;
                    }
                    if (typeString.Contains("double"))
                    {
                        mydatatype = BP.DA.DataType.AppDouble;
                    }

                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(dr["name"].ToString());

                    //中文描述.
                    var tb = new TB();
                    tb.ID      = "TB_Desc_" + dr["name"];
                    tb.Columns = 20;
                    tb.Text    = dr["Desc"].ToString();
                    if (tb.Text.Length == 0)
                    {
                        tb.Text = dr["name"].ToString();
                    }
                    this.Pub1.AddTD(tb);

                    //数据类型.
                    var ddl = new DDL();
                    ddl.ID = "DDL_DBType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.MyDataType);
                    ddl.SetSelectItem(mydatatype); //设置选择的项目.
                    this.Pub1.AddTD(ddl);

                    //逻辑类型.
                    ddl    = new DDL();
                    ddl.ID = "DDL_LogicType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.LGType);
                    this.Pub1.AddTD(ddl);


                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_BindKey_" + dr["name"];
                    tb.Columns = 30;
                    tb.Text    = dr["name"].ToString();
                    tb.Attributes["ondblclick"] = "OpenSelectBindKey(this)";
                    this.Pub1.AddTD(tb);

                    //最大长度.
                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_Len_" + dr["name"];
                    tb.Columns = 5;
                    tb.Text    = dr["length"].ToString();
                    this.Pub1.AddTD(tb);

                    this.Pub1.AddTDBegin("style='text-align:center'");
                    var hiddenIdx = new HiddenField();
                    hiddenIdx.ID    = "HID_Idx_" + dr["name"];
                    hiddenIdx.Value = idx.ToString();
                    this.Pub1.Add(hiddenIdx);

                    this.Pub1.Add("<a href='javascript:void(0)' onclick='up(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-up'\"></a>&nbsp;");
                    this.Pub1.Add("<a href='javascript:void(0)' onclick='down(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-down'\"></a>");

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

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

                var btn = new LinkBtn(false, NamesOfBtn.Save, "导入字段,生成表单");
                btn.Click += new EventHandler(btn_Save_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}' class='easyui-linkbutton'>上一步</a>", Request.Url.ToString().Replace("Step=3", "Step=2")));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
            }
            #endregion 第3步.
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Step = 1

            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();


                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                Pub1.AddLi("<div><a href='SFGuide.aspx?Step=12&FK_SFDBsrc=local'><img src='../../Img/New.gif' align='middle' /><span>创建本地编码字典表</span></a></div>");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='SFGuide.aspx?Step=2&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('../RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion

            #region Step = 2

            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 表/视图'\" style='width:200px;'>",
                                       src.No));

                var lb = new LB();
                lb.ID = "LB_Table";
                lb.BindByTableNoName(src.GetTables());
                lb.Style.Add("width", "100%");
                lb.Style.Add("height", "100%");
                lb.AutoPostBack          = true;
                lb.SelectedIndexChanged += new EventHandler(lb_SelectedIndexChanged);
                Pub1.Add(lb);

                Pub1.AddDivEnd();

                Pub1.Add("<div data-options=\"region:'center',title:'第2步:请填写基础信息'\" style='padding:5px;'>");
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");

                var dbType = src.DBSrcType;
                if (dbType == DBSrcType.Localhost)
                {
                    switch (SystemConfig.AppCenterDBType)
                    {
                    case DBType.MSSQL:
                        dbType = DBSrcType.SQLServer;
                        break;

                    case DBType.Oracle:
                        dbType = DBSrcType.Oracle;
                        break;

                    case DBType.MySQL:
                        dbType = DBSrcType.MySQL;
                        break;

                    case DBType.Informix:
                        dbType = DBSrcType.Infomax;
                        break;

                    default:
                        throw new Exception("没有涉及到的连接测试类型...");
                    }
                }

                var islocal = (src.DBSrcType == DBSrcType.Localhost).ToString().ToLower();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "值(编号):");
                var ddl = new DDL();
                ddl.ID = "DDL_ColValue";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;编号列,比如:类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("标签(名称):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColText";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;显示的列,比如:类别名称");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("父结点值(字段):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColParentNo";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;如果是树类型实体,该列设置有效,比如:上级类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("字典表类型:");

                ddl    = new DDL();
                ddl.ID = "DDL_SFTableType";
                ddl.SelfBindSysEnum(SFTableAttr.SFTableType);
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTD(ddl);
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("查询语句:");
                var tb = new TB();
                tb.ID       = "TB_SelectStatement";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Columns  = 60;
                tb.Rows     = 10;
                tb.Style.Add("width", "99%");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("<br />&nbsp;说明:查询语句可以修改,但请保证查询语句的准确性及有效性!");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");

                Pub1.AddDivEnd();
                Pub1.AddDivEnd();

                if (!IsPostBack && lb.Items.Count > 0)
                {
                    lb.SelectedIndex = 0;
                    ShowSelectedTableColumns();
                }
            }
            #endregion

            #region Step = 12

            if (this.Step == 12)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Local_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion

            #region Step = 3

            if (this.Step == 3)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第3步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion
        }
Esempio n. 4
0
        /// <summary>
        /// 初始化 导入的界面 .
        /// </summary>
        /// <returns></returns>
        public string Imp_Init()
        {
            DataSet ds = new DataSet();

            string sql = "";

            System.Data.DataTable dt;

            if (this.FK_Flow != null)
            {
                //加入节点表单. 如果没有流程参数.

                Paras ps = new Paras();
                ps.SQL = "SELECT NodeID, Name  FROM WF_Node WHERE FK_Flow=" + SystemConfig.AppCenterDBVarStr + "FK_Flow ORDER BY NODEID ";
                ps.Add("FK_Flow", this.FK_Flow);
                dt = BP.DA.DBAccess.RunSQLReturnTable(ps);

                dt.TableName = "WF_Node";

                if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
                {
                    dt.Columns["NODEID"].ColumnName = "NodeID";
                    dt.Columns["NAME"].ColumnName   = "Name";
                }

                ds.Tables.Add(dt);
            }

            #region 加入表单库目录.
            if (SystemConfig.AppCenterDBType == DBType.Oracle)
            {
                sql = "SELECT NO as No ,Name,ParentNo FROM Sys_FormTree ORDER BY  PARENTNO, IDX ";
            }
            else
            {
                sql = "SELECT No,Name,ParentNo FROM Sys_FormTree ORDER BY  PARENTNO, IDX ";
            }

            dt           = BP.DA.DBAccess.RunSQLReturnTable(sql);
            dt.TableName = "Sys_FormTree";
            if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
            {
                dt.Columns["NO"].ColumnName       = "No";
                dt.Columns["NAME"].ColumnName     = "Name";
                dt.Columns["PARENTNO"].ColumnName = "ParentNo";
            }
            ds.Tables.Add(dt);

            //加入表单
            sql          = "SELECT A.No, A.Name, A.FK_FormTree  FROM Sys_MapData A, Sys_FormTree B WHERE A.FK_FormTree=B.No";
            dt           = BP.DA.DBAccess.RunSQLReturnTable(sql);
            dt.TableName = "Sys_MapData";
            ds.Tables.Add(dt);
            if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
            {
                dt.Columns["NO"].ColumnName          = "No";
                dt.Columns["NAME"].ColumnName        = "Name";
                dt.Columns["FK_FORMTREE"].ColumnName = "FK_FormTree";
            }
            #endregion 加入表单库目录.

            #region 加入流程树目录.
            sql = "SELECT No,Name,ParentNo FROM WF_FlowSort ORDER BY  PARENTNO, IDX ";

            dt           = BP.DA.DBAccess.RunSQLReturnTable(sql);
            dt.TableName = "WF_FlowSort";
            if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
            {
                dt.Columns["NO"].ColumnName       = "No";
                dt.Columns["NAME"].ColumnName     = "Name";
                dt.Columns["PARENTNO"].ColumnName = "ParentNo";
            }
            ds.Tables.Add(dt);

            //加入表单
            sql          = "SELECT No, Name, FK_FlowSort  FROM WF_Flow ";
            dt           = BP.DA.DBAccess.RunSQLReturnTable(sql);
            dt.TableName = "WF_Flow";
            ds.Tables.Add(dt);
            if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL)
            {
                dt.Columns["NO"].ColumnName          = "No";
                dt.Columns["NAME"].ColumnName        = "Name";
                dt.Columns["FK_FLOWSORT"].ColumnName = "FK_FlowSort";
            }
            #endregion 加入流程树目录.

            #region 数据源
            BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
            ens.RetrieveAll();
            ds.Tables.Add(ens.ToDataTableField("SFDBSrcs"));
            #endregion

            //加入系统表.
            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Step = 1

            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();

                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:选择下拉框数据来源类型");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                this.Pub1.AddLi("<a href='/WF/MapDef/SFTable.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&FromApp=SL' ><b><img src='./Img/Table.png' border=0 style='width:17px;height:17px;' />外键型表或视图</b></a> -  比如:岗位、税种、行业、科目,本机上一个表组成一个下拉框。");
                this.Pub1.AddLi("<a href='/WF/MapDef/SFSQL.aspx?DoType=New&MyPK=" + this.MyPK + "&Idx=" + this.Idx + "&FromApp=SL'><b><img src='./Img/View.png' border=0  style='width:17px;height:17px;' />外部表SQL数据源</b></a> -  比如:配置一个SQL通过数据库连接或获取的外部数据,组成一个下拉框。");
                this.Pub1.AddLi("<a href='/WF/MapDef/SFWS.aspx?DoType=AddSFWebServeces&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "&FromApp=SL'><b><img src='./Img/WS.png' border=0 />WebServices数据</b></a> -  比如:通过调用Webservices接口获得数据,组成一个下拉框。");

                //// Pub1.AddLi("<div><a href='SFGuide.aspx?Step=12&FK_SFDBsrc=local'><img src='../../Img/New.gif' align='middle' /><span>创建本地编码字典表</span></a></div>");
                // foreach (BP.Sys.SFDBSrc item in ens)
                // {
                //     Pub1.AddLi("<div><a href='SFGuide.aspx?Step=2&FK_SFDBSrc=" + item.No + "'><span class='nav'>" +item.IP+ item.No + "  -  " + item.Name + "</span></a></div>");
                // }

                // this.Pub1.AddFieldSet("新增下拉框(外键、外部表、WebServices)字段(通常只有编号名称两个列)");
                // this.Pub1.AddUL();
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFTable&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>外键型</b></a> -  比如:岗位、税种、行业、科目,本机上一个表组成一个下拉框。");
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFSQL&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>外部表</b></a> -  比如:配置一个SQL通过数据库连接或获取的外部数据,组成一个下拉框。");
                // this.Pub1.AddLi("<a href='Do.aspx?DoType=AddSFWebServeces&MyPK=" + this.MyPK + "&FType=Class&Idx=" + this.Idx + "&GroupField=" + this.GroupField + "'><b>WebServices</b></a> -  比如:通过调用Webservices接口获得数据,组成一个下拉框。");
                // this.Pub1.AddULEnd();
                // this.Pub1.AddFieldSetEnd();

                //创建.
                //Pub1.AddLi("<div><a href=\"javascript:WinOpen('../RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");
                //Pub1.AddLi("<div><a href='SFGuide.aspx?Step=22'><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建WebService数据源</span></a></div>");


                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTREnd();


                Pub1.AddTableEnd();
            }
            #endregion

            #region Step = 2

            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 表/视图'\" style='width:200px;'>",
                                       src.No));

                var lb = new LB();
                lb.ID = "LB_Table";
                lb.BindByTableNoName(src.GetTables());
                lb.Style.Add("width", "100%");
                lb.Style.Add("height", "100%");
                lb.AutoPostBack          = true;
                lb.SelectedIndexChanged += new EventHandler(lb_SelectedIndexChanged);
                Pub1.Add(lb);

                Pub1.AddDivEnd();

                Pub1.Add("<div data-options=\"region:'center',title:'第2步:请填写基础信息'\" style='padding:5px;'>");
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");

                var dbType = src.DBSrcType;
                if (dbType == DBSrcType.Localhost)
                {
                    switch (SystemConfig.AppCenterDBType)
                    {
                    case DBType.MSSQL:
                        dbType = DBSrcType.SQLServer;
                        break;

                    case DBType.Oracle:
                        dbType = DBSrcType.Oracle;
                        break;

                    case DBType.MySQL:
                        dbType = DBSrcType.MySQL;
                        break;

                    case DBType.Informix:
                        dbType = DBSrcType.Informix;
                        break;

                    default:
                        throw new Exception("没有涉及到的连接测试类型...");
                    }
                }

                var islocal = (src.DBSrcType == DBSrcType.Localhost).ToString().ToLower();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "值(编号):");
                var ddl = new DDL();
                ddl.ID = "DDL_ColValue";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;编号列,比如:类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("标签(名称):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColText";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;显示的列,比如:类别名称");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("父结点值(字段):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColParentNo";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;如果是树类型实体,该列设置有效,比如:上级类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("字典表类型:");

                ddl    = new DDL();
                ddl.ID = "DDL_CodeStruct";
                ddl.SelfBindSysEnum(SFTableAttr.CodeStruct);
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTD(ddl);
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("查询语句:");
                var tb = new TB();
                tb.ID       = "TB_SelectStatement";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Columns  = 60;
                tb.Rows     = 10;
                tb.Style.Add("width", "99%");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("<br />&nbsp;说明:查询语句可以修改,但请保证查询语句的准确性及有效性!");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");

                Pub1.AddDivEnd();
                Pub1.AddDivEnd();

                if (!IsPostBack && lb.Items.Count > 0)
                {
                    lb.SelectedIndex = 0;
                    ShowSelectedTableColumns();
                }
            }
            #endregion

            #region Step = 12

            if (this.Step == 12)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Local_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion

            #region Step = 22

            if (this.Step == 22)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建本地WebService数据源表");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "WebService数据源编号:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头,比如:HR,CRM");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService数据源名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的数据源名称,比如:人力资源系统,客户关系管理系统.");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService连接Url:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;WebService地址,比如:http://127.0.0.1/CCFormTester.asmx");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.SrcTable;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService接口名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;比如:GetEmps");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.SelectStatement;
                tb.Style.Add("width", "300px");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "WebService接口参数:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

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


                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_WebService_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }

            #endregion

            #region Step = 3

            if (this.Step == 3)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第3步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion
        }