Exemplo n.º 1
0
        public void BindFrmLib()
        {
            this.Pub1.AddH2("表单库");

            this.Pub1.AddTable("width=100% align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("物理表");

            //this.Pub1.AddTDTitle("设计者");
            //this.Pub1.AddTDTitle("设计单位");
            //this.Pub1.AddTDTitle("联系方式");
            this.Pub1.AddTREnd();

            MapDatas mds = new MapDatas();

            mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application);

            SysFormTrees fss = new SysFormTrees();

            fss.RetrieveAll();
            int idx = 0;

            foreach (SysFormTree fs in fss)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD("colspan=6", "<b>" + fs.Name + "</b>");
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FrmSort != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(md.No);
                    this.Pub1.AddTDA("FlowFrms.aspx?ShowType=Frm&FK_MapData=" + md.No + "&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow, md.Name);
                    this.Pub1.AddTD(md.PTable);
                    //this.Pub1.AddTD(md.Designer);
                    //this.Pub1.AddTD(md.DesignerUnit);
                    //this.Pub1.AddTD(md.DesignerContact);
                    this.Pub1.AddTREnd();

                    //this.Pub1.AddTR();
                    //this.Pub1.AddTD();
                    //this.Pub1.AddTD();
                    //this.Pub1.AddTDBegin("colspan=5");
                    //this.Pub1.AddTDEnd();
                    //this.Pub1.AddTREnd();
                }
            }
            this.Pub1.AddTableEnd();
        }
Exemplo n.º 2
0
        public void BindFrmSorts()
        {
            SysFormTrees fss = new SysFormTrees();

            fss.RetrieveAll();
            this.Pub1.AddH2("表单类别维护");
            this.Pub1.AddHR();

            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序号");
            this.Pub1.AddTDTitle("类别编号");
            this.Pub1.AddTDTitle("类别名称");
            this.Pub1.AddTREnd();

            for (int i = 1; i <= 15; i++)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(i);


                TextBox tb = new TextBox();
                tb.Text = i.ToString().PadLeft(2, '0');
                SysFormTree fs = fss.GetEntityByKey(SysFormTreeAttr.No, tb.Text) as SysFormTree;

                tb.ID       = "TB_No_" + i;
                tb.Columns  = 5;
                tb.ReadOnly = true;
                this.Pub1.AddTD(tb.Text);

                tb         = new TextBox();
                tb.ID      = "TB_Name_" + i;
                tb.Columns = 40;
                if (fs != null)
                {
                    tb.Text = fs.Name;
                }

                this.Pub1.AddTD(tb);
                this.Pub1.AddTREnd();
            }

            Button btn = new Button();

            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFrmSort_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=2", btn);
            this.Pub1.AddTD("要删除类别,请把文本框数据清空保存即可。");
            this.Pub1.AddTREnd();

            this.Pub1.AddTableEndWithHR();
        }
Exemplo n.º 3
0
        private string GetFlowFormTree()
        {
            string flowId = getUTF8ToString("flowId");
            string nodeId = getUTF8ToString("nodeId");

            //add root
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.No       = "01";
            root.ParentNo = "0";
            root.Name     = "目录";
            root.NodeType = "root";
            appFlowFormTree.Clear();
            appFlowFormTree.AddEntity(root);

            #region 添加表单及文件夹

            //节点表单
            FrmNodes    frmNodes = new FrmNodes();
            QueryObject qo       = new QueryObject(frmNodes);
            qo.AddWhere(FrmNodeAttr.FK_Node, nodeId);
            qo.addAnd();
            qo.AddWhere(FrmNodeAttr.FK_Flow, flowId);
            qo.addOrderBy(FrmNodeAttr.Idx);
            qo.DoQuery();
            //文件夹
            SysFormTrees formTrees = new SysFormTrees();
            formTrees.RetrieveAll(SysFormTreeAttr.Name);
            //所有表单集合
            MapDatas mds = new MapDatas();
            mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application);
            foreach (FrmNode frmNode in frmNodes)
            {
                foreach (MapData md in mds)
                {
                    if (frmNode.FK_Frm != md.No)
                    {
                        continue;
                    }

                    foreach (SysFormTree formTree in formTrees)
                    {
                        if (md.FK_FormTree != formTree.No)
                        {
                            continue;
                        }

                        if (!appFlowFormTree.Contains("No", formTree.No))
                        {
                            BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                            nodeFolder.No       = formTree.No;
                            nodeFolder.ParentNo = root.No;
                            nodeFolder.Name     = formTree.Name;
                            nodeFolder.NodeType = "folder";
                            appFlowFormTree.AddEntity(nodeFolder);
                        }
                    }
                    //检查必填项
                    bool        IsNotNull  = false;
                    FrmFields   formFields = new FrmFields();
                    QueryObject obj        = new QueryObject(formFields);
                    obj.AddWhere(FrmFieldAttr.FK_Node, nodeId);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.FK_MapData, md.No);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.IsNotNull, "1");
                    obj.DoQuery();
                    if (formFields != null && formFields.Count > 0)
                    {
                        IsNotNull = true;
                    }

                    BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree();
                    nodeForm.No       = md.No;
                    nodeForm.ParentNo = md.FK_FormTree;
                    nodeForm.Name     = md.Name;
                    nodeForm.NodeType = IsNotNull ? "form|1" : "form|0";
                    appFlowFormTree.AddEntity(nodeForm);
                }
            }
            #endregion
            //扩展工具,显示位置为表单树类型
            NodeToolbars extToolBars = new NodeToolbars();
            QueryObject  info        = new QueryObject(extToolBars);
            info.AddWhere(NodeToolbarAttr.FK_Node, nodeId);
            info.addAnd();
            info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree);
            info.DoQuery();

            foreach (NodeToolbar item in extToolBars)
            {
                string url = "";
                if (string.IsNullOrEmpty(item.Url))
                {
                    continue;
                }

                url = item.Url;

                BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree();
                formTree.No       = item.OID.ToString();
                formTree.ParentNo = "01";
                formTree.Name     = item.Title;
                formTree.NodeType = "tools|0";
                if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK")
                {
                    formTree.NodeType = "tools|1";
                }

                formTree.Url = url;
                appFlowFormTree.AddEntity(formTree);
            }
            TansEntitiesToGenerTree(appFlowFormTree, root.No, "");
            return(appendMenus.ToString());
        }
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string path = this.GetValStrByKey("Path") + "_" + DateTime.Now.ToString("yy年MM月dd日HH时mm分");

            if (System.IO.Directory.Exists(path))
            {
                return("系统正在执行中,请稍后。");
            }

            System.IO.Directory.CreateDirectory(path);
            System.IO.Directory.CreateDirectory(path + "\\Flow.流程模板");
            System.IO.Directory.CreateDirectory(path + "\\Frm.表单模板");

            Flows fls = new Flows();

            fls.RetrieveAll();
            FlowSorts sorts = new FlowSorts();

            sorts.RetrieveAll();

            // 生成流程模板。
            foreach (FlowSort sort in sorts)
            {
                string pathDir = path + "\\Flow.流程模板\\" + sort.No + "." + sort.Name;
                System.IO.Directory.CreateDirectory(pathDir);
                foreach (Flow fl in fls)
                {
                    fl.DoExpFlowXmlTemplete(pathDir);
                }
            }

            // 生成表单模板。
            foreach (FlowSort sort in sorts)
            {
                string pathDir = path + "\\Frm.表单模板\\" + sort.No + "." + sort.Name;
                System.IO.Directory.CreateDirectory(pathDir);
                foreach (Flow fl in fls)
                {
                    string pathFlowDir = pathDir + "\\" + fl.No + "." + fl.Name;
                    System.IO.Directory.CreateDirectory(pathFlowDir);
                    Nodes nds = new Nodes(fl.No);
                    foreach (Node nd in nds)
                    {
                        MapData             md = new MapData("ND" + nd.NodeID);
                        System.Data.DataSet ds = md.GenerHisDataSet();
                        ds.WriteXml(pathFlowDir + "\\" + nd.NodeID + "." + nd.Name + ".Frm.xml");
                    }
                }
            }

            // 流程表单模板.
            SysFormTrees frmSorts = new SysFormTrees();

            frmSorts.RetrieveAll();
            foreach (SysFormTree sort in frmSorts)
            {
                string pathDir = path + "\\Frm.表单模板\\" + sort.No + "." + sort.Name;
                System.IO.Directory.CreateDirectory(pathDir);

                MapDatas mds = new MapDatas();
                mds.Retrieve(MapDataAttr.FK_FrmSort, sort.No);
                foreach (MapData md in mds)
                {
                    System.Data.DataSet ds = md.GenerHisDataSet();
                    ds.WriteXml(pathDir + "\\" + md.No + "." + md.Name + ".Frm.xml");
                }
            }
            return("生成成功,请打开" + path + "。<br>如果您想共享出来请压缩后发送到template@ccflow.org");
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取表单库所有表单
        /// </summary>
        /// <returns></returns>
        public string BindForm_GenerForms()
        {
            //形成树
            FlowFormTrees appendFormTrees = new FlowFormTrees();
            //节点绑定表单
            FrmNodes frmNodes = new FrmNodes(this.FK_Flow, this.FK_Node);
            //所有表单类别
            SysFormTrees formTrees = new SysFormTrees();

            formTrees.RetrieveAll(SysFormTreeAttr.Idx);

            //根节点
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.Name = "表单库";
            int i = root.Retrieve(FlowFormTreeAttr.ParentNo, 0);

            if (i != 0)
            {
                root.Name     = "表单库";
                root.No       = "1";
                root.NodeType = "root";
                root.Insert();
            }
            root.NodeType = "root";

            appendFormTrees.AddEntity(root);

            foreach (SysFormTree formTree in formTrees)
            {
                //已经添加排除
                if (appendFormTrees.Contains("No", formTree.No) == true)
                {
                    continue;
                }

                //根节点排除
                if (formTree.ParentNo.Equals("0"))
                {
                    root.No = formTree.No;
                    continue;
                }



                //文件夹
                BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                nodeFolder.No       = formTree.No;
                nodeFolder.ParentNo = formTree.ParentNo;
                nodeFolder.Name     = formTree.Name;
                nodeFolder.NodeType = "folder";
                if (formTree.ParentNo.Equals("0"))
                {
                    nodeFolder.ParentNo = root.No;
                }
                appendFormTrees.AddEntity(nodeFolder);

                //表单
                MapDatas mapS = new MapDatas();
                mapS.RetrieveByAttr(MapDataAttr.FK_FormTree, formTree.No);
                if (mapS != null && mapS.Count > 0)
                {
                    foreach (MapData map in mapS)
                    {
                        BP.WF.Template.FlowFormTree formFolder = new BP.WF.Template.FlowFormTree();
                        formFolder.No       = map.No;
                        formFolder.ParentNo = map.FK_FormTree;
                        formFolder.Name     = map.Name + "[" + map.No + "]";
                        formFolder.NodeType = "form";
                        appendFormTrees.AddEntity(formFolder);
                    }
                }
            }

            string strCheckedNos = "";

            //设置选中
            foreach (FrmNode frmNode in frmNodes)
            {
                strCheckedNos += "," + frmNode.FK_Frm + ",";
            }
            //重置
            appendMenus.Clear();
            //生成数据
            TansEntitiesToGenerTree(appendFormTrees, root.No, strCheckedNos);
            return(appendMenus.ToString());
        }
Exemplo n.º 6
0
        private string GetFlowFormTree()
        {
            //add root
            BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree();
            root.No       = "00";
            root.ParentNo = "0";
            root.Name     = "目录";
            root.NodeType = "root";
            appFlowFormTree.Clear();
            appFlowFormTree.AddEntity(root);

            #region 添加表单及文件夹

            //节点表单
            string     tfModel = SystemConfig.AppSettings["TreeFrmModel"];
            BP.WF.Node nd      = new BP.WF.Node(this.FK_Node);

            FrmNodes    frmNodes = new FrmNodes();
            QueryObject qo       = new QueryObject(frmNodes);
            qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node);
            qo.addAnd();
            qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow);
            //如果配置了启用关键字段,一下会判断绑定的独立表单中的关键字段是否有数据,没有就不会被显示
            // add  by  海南  zqp
            if (tfModel == "1")
            {
                //针对合流点与分合流节点有效
                //获取独立表单的字段
                MapDatas mdes  = new MapDatas();
                string   mypks = "";
                if (nd.IsStartNode == false)
                {
                    qo.addOrderBy(FrmNodeAttr.Idx);
                    qo.DoQuery();
                    foreach (FrmNode fn in frmNodes)
                    {
                        if (fn.HisFrmType == FrmType.Column4Frm || fn.HisFrmType == FrmType.FreeFrm)
                        {
                            mdes.Retrieve(MapDataAttr.No, fn.FK_Frm);
                            //根据设置的关键字段是否有值,进行判断
                            foreach (MapData md in mdes)
                            {
                                Paras ps = new Paras();
                                ps.SQL = "SELECT " + fn.GuanJianZiDuan + " FROM " + md.PTable + " WHERE "
                                         + " OID=" + SystemConfig.AppCenterDBVarStr + "OID";
                                if (this.FID == 0)
                                {
                                    ps.Add("OID", this.WorkID);
                                }
                                else
                                {
                                    ps.Add("OID", this.FID);
                                }
                                try
                                {
                                    DataTable dtmd  = BP.DA.DBAccess.RunSQLReturnTable(ps);
                                    string    dtVal = dtmd.Rows[0]["" + fn.GuanJianZiDuan + ""].ToString();
                                    if (string.IsNullOrWhiteSpace(dtVal))
                                    {
                                        mypks = mypks + "'" + md.No + "',";
                                    }
                                }
                                catch (Exception ex)
                                {
                                    mypks = mypks + "'" + md.No + "',";
                                }
                            }
                        }
                    }
                    mypks = mypks.TrimEnd(',');
                    if (!string.IsNullOrWhiteSpace(mypks))
                    {
                        //添加查询条件
                        qo = new QueryObject(frmNodes);
                        qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node);
                        qo.addAnd();
                        qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow);
                        qo.addAnd();
                        qo.AddWhere(FrmNodeAttr.FK_Frm + " not in(" + mypks + ")");
                        qo.addOrderBy(FrmNodeAttr.Idx);
                        qo.DoQuery();
                    }
                }
                else
                {
                    qo.addOrderBy(FrmNodeAttr.Idx);
                    qo.DoQuery();
                }
            }
            else
            {
                qo.addOrderBy(FrmNodeAttr.Idx);
                qo.DoQuery();
            }
            //文件夹
            SysFormTrees formTrees = new SysFormTrees();
            formTrees.RetrieveAll(SysFormTreeAttr.Name);

            //所有表单集合
            MapDatas mds = new MapDatas();
            mds.RetrieveInSQL("SELECT FK_Frm FROM WF_FrmNode WHERE FK_Node=" + this.FK_Node);

            foreach (FrmNode frmNode in frmNodes)
            {
                #region 增加判断是否启用规则.
                switch (frmNode.FrmEnableRole)
                {
                case FrmEnableRole.Allways:
                    break;

                case FrmEnableRole.WhenHaveData:     //判断是否有数据.
                    MapData md = new MapData(frmNode.FK_Frm);
                    if (DBAccess.RunSQLReturnValInt("SELECT COUNT(*) as Num FROM " + md.PTable + " WHERE OID=" + this.WorkID) == 0)
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.WhenHaveFrmPara:     //判断是否有参数.
                    string frms = this.Request.QueryString["Frms"];
                    if (frms != null && frms.Contains(frmNode.FK_Frm) == true)
                    {
                        /*包含这个表单.*/
                    }
                    else
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.ByFrmFields:
                    throw new Exception("@这种类型的判断,ByFrmFields 还没有完成。");

                case FrmEnableRole.BySQL:      // 按照SQL的方式.
                    string mysql = frmNode.FrmEnableExp.Clone() as string;
                    mysql = mysql.Replace("@OID", this.WorkID.ToString());
                    mysql = mysql.Replace("@WorkID", this.WorkID.ToString());

                    mysql = mysql.Replace("@NodeID", this.FK_Node.ToString());
                    mysql = mysql.Replace("@FK_Node", this.FK_Node.ToString());

                    mysql = mysql.Replace("@FK_Flow", this.FK_Flow);

                    if (DBAccess.RunSQLReturnValFloat(mysql) <= 0)
                    {
                        continue;
                    }
                    break;

                case FrmEnableRole.Disable:      // 如果禁用了,就continue出去..
                    continue;

                default:
                    throw new Exception("@没有判断的规则." + frmNode.FrmEnableRole);
                }
                #endregion

                #region 检查是否有没有目录的表单?
                bool isHave = false;
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree == "")
                    {
                        isHave = true;
                        break;
                    }
                }

                string treeNo = "0";
                if (isHave && mds.Count == 1)
                {
                    treeNo = "0";
                }
                else if (isHave == true)
                {
                    foreach (MapData md in mds)
                    {
                        if (md.FK_FormTree != "")
                        {
                            treeNo = md.FK_FormTree;
                            break;
                        }
                    }
                }
                #endregion 检查是否有没有目录的表单?

                foreach (MapData md in mds)
                {
                    if (frmNode.FK_Frm != md.No)
                    {
                        continue;
                    }

                    #warning 这里有错误, 如果是节点表单的话,就没有这个值,没有这个值就绑定不到表单树,代国强解决.
                    if (md.FK_FormTree == "")
                    {
                        md.FK_FormTree = treeNo;
                    }

                    foreach (SysFormTree formTree in formTrees)
                    {
                        if (md.FK_FormTree != formTree.No)
                        {
                            continue;
                        }
                        if (appFlowFormTree.Contains("No", formTree.No) == false)
                        {
                            BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree();
                            nodeFolder.No       = formTree.No;
                            nodeFolder.ParentNo = root.No;
                            nodeFolder.Name     = formTree.Name;
                            nodeFolder.NodeType = "folder";
                            appFlowFormTree.AddEntity(nodeFolder);
                        }
                    }
                    //检查必填项
                    bool        IsNotNull  = false;
                    FrmFields   formFields = new FrmFields();
                    QueryObject obj        = new QueryObject(formFields);
                    obj.AddWhere(FrmFieldAttr.FK_Node, this.FK_Node);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.FK_MapData, md.No);
                    obj.addAnd();
                    obj.AddWhere(FrmFieldAttr.IsNotNull, "1");
                    obj.DoQuery();
                    if (formFields != null && formFields.Count > 0)
                    {
                        IsNotNull = true;
                    }

                    BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree();
                    nodeForm.No       = md.No;
                    nodeForm.ParentNo = md.FK_FormTree;
                    nodeForm.Name     = md.Name;
                    nodeForm.NodeType = IsNotNull ? "form|1" : "form|0";
                    nodeForm.IsEdit   = Convert.ToString(Convert.ToInt32(frmNode.IsEdit));
                    appFlowFormTree.AddEntity(nodeForm);
                }
            }
            #endregion

            //扩展工具,显示位置为表单树类型
            NodeToolbars extToolBars = new NodeToolbars();
            QueryObject  info        = new QueryObject(extToolBars);
            info.AddWhere(NodeToolbarAttr.FK_Node, this.FK_Node);
            info.addAnd();
            info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree);
            info.DoQuery();

            foreach (NodeToolbar item in extToolBars)
            {
                string url = "";
                if (string.IsNullOrEmpty(item.Url))
                {
                    continue;
                }

                url = item.Url;

                BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree();
                formTree.No       = item.OID.ToString();
                formTree.ParentNo = "01";
                formTree.Name     = item.Title;
                formTree.NodeType = "tools|0";
                if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK")
                {
                    formTree.NodeType = "tools|1";
                }

                formTree.Url = url;
                appFlowFormTree.AddEntity(formTree);
            }
            TansEntitiesToGenerTree(appFlowFormTree, root.No, "");
            return(appendMenus.ToString());
        }
Exemplo n.º 7
0
        public void BindFrm()
        {
            MapData md = new MapData();

            if (string.IsNullOrEmpty(this.FK_MapData) == false)
            {
                md.No = this.FK_MapData;
                md.RetrieveFromDBSources();
                this.Pub1.AddH2("表单属性" + md.Name);
                this.Pub1.AddHR();
            }
            else
            {
                this.Pub1.AddH2("新建表单");
                this.Pub1.AddHR();
            }

            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("属性");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单名称");
            TextBox tb = new TextBox();

            tb.ID   = "TB_Name";
            tb.Text = md.Name;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("描述");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单编号");
            tb      = new TextBox();
            tb.ID   = "TB_No";
            tb.Text = md.No;
            if (string.IsNullOrEmpty(md.No) == false)
            {
                tb.Attributes["readonly"] = "true";
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("也是表单ID.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("表单类型");
            DDL ddl = new DDL();

            ddl.ID = "DDL_FrmType";
            ddl.BindSysEnum(MapDataAttr.FrmType, (int)md.HisFrmType);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("物理表/视图");
            tb      = new TextBox();
            tb.ID   = "TB_PTable";
            tb.Text = md.No;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTD("多个表单可以对应同一个表或视图<br>如果表不存在,ccflow会自动创建.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("类别");
            ddl    = new DDL();
            ddl.ID = "DDL_FK_FrmSort";
            SysFormTrees fss = new SysFormTrees();

            fss.RetrieveAll();

            ddl.Bind(fss, md.FK_FrmSort);

            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            //this.Pub1.AddTR();
            //this.Pub1.AddTD("设计单位");
            //tb = new TextBox();
            //tb.ID = "TB_" + MapDataAttr.DesignerUnit;
            //tb.Text = md.DesignerUnit;
            //if (string.IsNullOrEmpty(tb.Text))
            //    tb.Text = BP.Sys.SystemConfig.DeveloperName;

            //tb.Columns = 60;
            //this.Pub1.AddTD("colspan=2", tb);
            //this.Pub1.AddTREnd();

            //this.Pub1.AddTR();
            //this.Pub1.AddTD("联系方式");
            //tb = new TextBox();
            //tb.ID = "TB_" + MapDataAttr.DesignerContact;
            //tb.Text = md.DesignerContact;
            //if (string.IsNullOrEmpty(tb.Text))
            //    tb.Text = BP.Sys.SystemConfig.ServiceTel + "," + BP.Sys.SystemConfig.ServiceMail;
            //tb.Columns = 60;
            //this.Pub1.AddTD("colspan=2", tb);
            //this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            this.Pub1.AddTDBegin();
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFrm_Click);
            this.Pub1.Add(btn);

            if (string.IsNullOrEmpty(md.No) == false)
            {
                btn          = new Button();
                btn.ID       = "Btn_Delete";
                btn.Text     = "Delete";
                btn.CssClass = "Btn";
                btn.Attributes["onclick"] = "return window.confirm('您确定要删除吗?')";
                btn.Click += new EventHandler(btn_SaveFrm_Click);
                this.Pub1.Add(btn);
            }

            this.Pub1.AddTDEnd();
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();

            if (string.IsNullOrEmpty(md.No) == false)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTDBegin("colspan=3");
                //// this.Pub1.Add("<a href='FlowFrms.aspx?ShowType=FrmLib&DoType=DelFrm&FK_Node=" + FK_Node + "&FK_MapData=" + md.No + "'  ><img src='./Img/Btn/Delete.gif' border=0 />删除</a>");
                //this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=Column4Frm&FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />傻瓜表单预览</a>");
                //this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "&IsTest=1&WorkID=0' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />自由表单预览</a>");
                //this.Pub1.Add("<a href='../MapDef/ViewFrm.aspx?DoType=dd&FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />手机表单预览</a>");
                //this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动自由表单设计器</a>");
                //this.Pub1.Add("<a href='../MapDef/MapDef.aspx?PK=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动傻瓜表单设计器</a>");
                this.Pub1.Add("<a href='../CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "' target=_blank  ><img src='../Img/Btn/View.gif' border=0 />启动自由表单设计器</a>");
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }