public string DoRenameField(string newField)
        {
            string sql = "";

            if (this.FK_MapData.IndexOf("ND") == 0)
            {
                string strs = this.FK_MapData.Replace("ND", "");
                strs = strs.Substring(0, strs.Length - 2);

                string   rptTable = "ND" + strs + "Rpt";
                MapDatas mds      = new MapDatas();
                mds.Retrieve(MapDataAttr.PTable, rptTable);

                foreach (MapData item in mds)
                {
                    sql = "UPDATE Sys_MapAttr SET KeyOfEn='" + newField + "',  MyPK='" + newField + "_" + item.No + " WHERE KeyOfEn='" + this.KeyOfEn + "' AND FK_MapData='" + item.No + "'";
                    DBAccess.RunSQL(sql);
                }
            }
            else
            {
                sql = "UPDATE Sys_MapAttr SET KeyOfEn='" + newField + "', MyPK='" + newField + "_" + this.FK_MapData + "  WHERE KeyOfEn='" + this.KeyOfEn + "' AND FK_MapData='" + this.FK_MapData + "'";
                DBAccess.RunSQL(sql);
            }

            return("重名称成功,如果是自由表单,请关闭表单设计器重新打开.");
        }
Exemple #2
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string oldNo = this.GetValStrByKey("P1");
            string newNo = this.GetValStrByKey("P2");

            string sqls = "";

            sqls += "UPDATE Port_Emp Set No='" + newNo + "' WHERE No='" + oldNo + "'";
            sqls += "\t\n UPDATE " + BP.WF.Glo.EmpStation + " Set FK_Emp='" + newNo + "' WHERE FK_Emp='" + oldNo + "'";

            MapDatas mds = new MapDatas();

            mds.RetrieveAll();

            foreach (MapData md in mds)
            {
                MapAttrs attrs = new MapAttrs(md.No);
                foreach (MapAttr attr in attrs)
                {
                    if (attr.UIIsEnable == false && attr.DefValReal == "@WebUser.No")
                    {
                        sqls += "\t\n UPDATE " + md.PTable + " SET ";
                    }
                    continue;
                }
                sqls += "UPDATE";
            }

            return("执行成功..." + sqls);
        }
Exemple #3
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();
        }
Exemple #4
0
        void btn_SaveFlowFrms_Click(object sender, EventArgs e)
        {
            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);
            MapDatas mds = new MapDatas();

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

            //BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            string ids = ",";

            foreach (MapData md in mds)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + md.No);
                if (cb == null || cb.Checked == false)
                {
                    continue;
                }
                ids += md.No + ",";
            }

            //删除已经删除的。
            foreach (FrmNode fn in fns)
            {
                if (ids.Contains("," + fn.FK_Frm + ",") == false)
                {
                    fn.Delete();
                    continue;
                }
            }

            // 增加集合中没有的。
            string[] strs = ids.Split(',');
            foreach (string s in strs)
            {
                if (string.IsNullOrEmpty(s))
                {
                    continue;
                }
                if (fns.Contains(FrmNodeAttr.FK_Frm, s))
                {
                    continue;
                }

                FrmNode fn = new FrmNode();
                fn.FK_Frm  = s;
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Node = this.FK_Node;
                fn.Save();
            }
            this.Response.Redirect("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow, true);
        }
Exemple #5
0
 public Map(MapDatas map)
 {
     ActualPath   = new List <Cell>();
     Entities     = new ConcurrentDictionary <int, IEntity>();
     Interactives = new ConcurrentDictionary <int, InteractiveObject>();
     MapDatas     = map;
     //Getting map infos
     Id     = (short)map.Id;
     Width  = byte.Parse(map.SwfDatas.Width.ToString());
     Height = byte.Parse(map.SwfDatas.Height.ToString());
     XCoord = map.XPos;
     YCoord = map.YPos;
     DecompressMap(map.SwfDatas.DecypheredMapData);
 }
        void btn_Click(object sender, EventArgs e)
        {
            MapDatas mds      = this.GetMDs;
            MapAttr  mattrOld = new MapAttr(this.FK_MapData, this.KeyOfEn);
            MapAttr  mattr    = new MapAttr(this.FK_MapData, this.KeyOfEn);

            foreach (MapData md in mds)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + md.No);
                if (cb == null)
                {
                    continue;
                }

                if (cb.Checked == false)
                {
                    continue;
                }

                if (this.DoType == "Copy")
                {
                    /*执行批量Copy*/
                    mattr.FK_MapData = md.No;
                    mattr.Insert();
                    mattr.Idx = mattrOld.Idx;
                }

                if (this.DoType == "Update")
                {
                    /*执行批量Update*/
                    MapAttr mattrUpdate = new MapAttr(md.No, this.KeyOfEn);
                    int     gID         = mattrUpdate.GroupID;
                    mattrUpdate.Copy(mattrOld);
                    mattrUpdate.FK_MapData = md.No;
                    mattrUpdate.GroupID    = gID;
                    mattrUpdate.Update();
                }

                if (this.DoType == "Delete")
                {
                    /*执行批量 Delete */
                    MapAttr mattrDelete = new MapAttr(md.No, this.KeyOfEn);
                    mattrDelete.Delete();
                }
            }
            // 转向.
            this.Response.Redirect(this.Request.RawUrl, true);
        }
Exemple #7
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string rpt = BP.PubClass.DBRpt(BP.DBLevel.High);

            // 手动升级. 2011-07-08 补充节点字段分组.
            string sql = "DELETE FROM Sys_EnCfg WHERE No='BP.WF.Ext.NodeSheet'";

            BP.DA.DBAccess.RunSQL(sql);

            sql = "INSERT INTO Sys_EnCfg(No,GroupTitle) VALUES ('BP.WF.Ext.NodeSheet','NodeID=基本配置@WarningDays=考核属性@SendLab=功能按钮标签与状态')";
            BP.DA.DBAccess.RunSQL(sql);

            // 修复因bug丢失的字段.
            MapDatas mds = new MapDatas();

            mds.RetrieveAll();
            foreach (MapData md in mds)
            {
                string nodeid = md.No.Replace("ND", "");
                try
                {
                    BP.WF.Node nd = new Node(int.Parse(nodeid));
                    nd.RepareMap();
                    continue;
                }
                catch (Exception ex)
                {
                }

                MapAttr attr = new MapAttr();
                if (attr.IsExit(MapAttrAttr.KeyOfEn, "OID", MapAttrAttr.FK_MapData, md.No) == false)
                {
                    attr.FK_MapData    = md.No;
                    attr.KeyOfEn       = "OID";
                    attr.Name          = "OID";
                    attr.MyDataType    = BP.DA.DataType.AppInt;
                    attr.UIContralType = UIContralType.TB;
                    attr.LGType        = FieldTypeS.Normal;
                    attr.UIVisible     = false;
                    attr.UIIsEnable    = false;
                    attr.DefVal        = "0";
                    attr.HisEditType   = BP.En.EditType.Readonly;
                    attr.Insert();
                }
            }
            return("执行成功...");
        }
Exemple #8
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string path = "C:\\CCFlowTemplete" + DateTime.Now.ToString("yy年MM月dd日HH时mm分ss秒");

            if (System.IO.Directory.Exists(path) == false)
            {
                System.IO.Directory.CreateDirectory(path);
            }

            Flows fls = new Flows();

            fls.RetrieveAllFromDBSource();
            foreach (Flow fl in fls)
            {
                FlowSort fs      = new FlowSort(fl.FK_FlowSort);
                string   pathDir = path + "\\Flow\\" + fs.No + "." + fs.Name;
                if (System.IO.Directory.Exists(pathDir) == false)
                {
                    System.IO.Directory.CreateDirectory(pathDir);
                }

                //  fl.GenerFlowXmlTemplete(pathDir + "\\" + fl.Name + ".xml");
                fl.GenerFlowXmlTemplete(pathDir);
            }

            MapDatas mds = new MapDatas();

            mds.RetrieveAllFromDBSource();
            foreach (MapData md in mds)
            {
                if (md.FK_FrmSort.Length < 2)
                {
                    continue;
                }

                FrmSort fs      = new FrmSort(md.FK_FrmSort);
                string  pathDir = path + "\\Form\\" + fs.No + "." + fs.Name;
                if (System.IO.Directory.Exists(pathDir) == false)
                {
                    System.IO.Directory.CreateDirectory(pathDir);
                }
                DataSet ds = md.GenerHisDataSet();
                ds.WriteXml(pathDir + "\\" + md.Name + ".xml");
            }
            return("执行成功,存放路径:" + path);
        }
Exemple #9
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            MapDatas mds = new MapDatas();

            mds.RetrieveAll();

            string msg = "";
            Node   nd  = new Node();

            foreach (MapData item in mds)
            {
                if (item.No.Contains("ND") == false)
                {
                    continue;
                }

                string temp   = item.No.Replace("ND", "");
                int    nodeID = 0;
                try
                {
                    nodeID = int.Parse(temp);
                }
                catch
                {
                    continue;
                }

                nd.NodeID = nodeID;
                if (nd.IsExits == false)
                {
                    msg += "@" + item.No + "," + item.Name;
                    //删除该模版.
                    item.Delete();
                }
            }
            if (msg == "")
            {
                msg = "数据良好.";
            }
            else
            {
                msg = "如下节点已经删除,但是节点表单数据没有被删除." + msg;
            }

            return(msg);
        }
Exemple #10
0
 public void UpdateMapData(string packet)
 {
     Task.Factory.StartNew(() =>
     {
         Dispose();
         string[] splitted = packet.Split('|');
         MapDatas map      = DataManager.GetMapContent(splitted[1], splitted[2], splitted[3]);
         Id     = (short)map.Id;
         Width  = byte.Parse(map.SwfDatas.Width.ToString());
         Height = byte.Parse(map.SwfDatas.Height.ToString());
         XCoord = map.XPos;
         YCoord = map.YPos;
         DecompressMap(map.SwfDatas.DecypheredMapData);
         Map_updated = true;
         StringHelper.WriteLine($"Current map Coords : [{Client.MapManager.XCoord},{Client.MapManager.YCoord} Area [{DataManager.GlobalMapsInfos.First(x => x.Id == Id).AreaId}] - SubArea [{DataManager.GlobalMapsInfos.First(x => x.Id == Id).SubAreaId}]]", ConsoleColor.Green);
         StringHelper.WriteLine($"Current size : [{Client.MapManager.Width},{Client.MapManager.Height}]", ConsoleColor.Green);
     });
 }
 /// <summary>
 ///  MapDataの作成
 /// </summary>
 public void CreateMapDatas()
 {
     _BigMapData = new List <MapDatas>();
     for (int i = 0; i < _param.FieldSizeHorizontal; i++)
     {
         var datas = new MapDatas();
         int num   = 0;
         for (int j = 0; j < _param.FieldSizeVertical; j++)
         {
             var     x    = i;          /*- (_param.FieldSizeHorizontal / 2);*/
             var     y    = j - (_param.FieldSizeVertical / 2);
             MapData data = new MapData();
             var     pos  = new Vector3(x, y, 0) + this.transform.position;
             data._position = pos;
             data._isItem   = false;
             data._id       = num + i * 10;
             datas._fieldDatas.Add(data);
             num++;
         }
         _BigMapData.Add(datas);
     }
 }
    private void Start()
    {
        Application.runInBackground = true;
        _finished   = 0;
        _score      = 0;
        _timeOut    = 0;
        _isDown     = 0;
        _currentMap = new MapDatas(SceneManager.GetActiveScene().buildIndex);
        InitRobot();
        if (demoWalk & debugMode)
        {
            InitWalkDemo();
        }
        RefreshMotors();
        RefreshSensorValues();
        _prorokTestUnit2Copy = prorokTestUnit2;
        StartCoroutine(CheckForProgress());
        StartCoroutine(Timer(_currentMap.GetGameDuration()));
        StartCoroutine(CheckIfDown());
        /*    DEBUG    */

        _frameCount = 0;
    }
Exemple #13
0
        private void AddChildNode(string parentNo, MapDatas mds, FrmNodes fns)
        {
            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, parentNo);
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(md.Name);
                    this.Pub1.AddTD(md.PTable);
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
        }
Exemple #14
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            if (BP.Web.WebUser.No != "admin")
            {
                return("非法的用户执行。");
            }

            //DBAccess.RunSQL("DELETE FROM WF_CHOfFlow");

            DBAccess.RunSQL("DELETE FROM WF_Bill");
            DBAccess.RunSQL("DELETE FROM WF_GenerWorkerlist");
            DBAccess.RunSQL("DELETE FROM WF_GenerWorkFlow");
            DBAccess.RunSQL("DELETE FROM WF_ReturnWork");
            DBAccess.RunSQL("DELETE FROM WF_SelectAccper");
            DBAccess.RunSQL("DELETE FROM WF_TransferCustom");
            DBAccess.RunSQL("DELETE FROM WF_RememberMe");
            DBAccess.RunSQL("DELETE FROM Sys_FrmAttachmentDB");
            DBAccess.RunSQL("DELETE FROM WF_CCList");
            DBAccess.RunSQL("DELETE FROM WF_CH"); //删除考核.

            Flows fls = new Flows();

            fls.RetrieveAll();
            foreach (Flow item in fls)
            {
                try
                {
                    DBAccess.RunSQL("DELETE FROM ND" + int.Parse(item.No) + "Track");
                }
                catch
                {
                }
            }

            Nodes nds = new Nodes();

            foreach (Node nd in nds)
            {
                try
                {
                    Work wk = nd.HisWork;
                    DBAccess.RunSQL("DELETE FROM " + wk.EnMap.PhysicsTable);
                }
                catch
                {
                }
            }

            MapDatas mds = new MapDatas();

            mds.RetrieveAll();
            foreach (MapData nd in mds)
            {
                try
                {
                    DBAccess.RunSQL("DELETE FROM " + nd.PTable);
                }
                catch
                {
                }
            }

            MapDtls dtls = new MapDtls();

            dtls.RetrieveAll();
            foreach (MapDtl dtl in dtls)
            {
                try
                {
                    DBAccess.RunSQL("DELETE FROM " + dtl.PTable);
                }
                catch
                {
                }
            }
            return("执行成功...");
        }
Exemple #15
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());
        }
Exemple #16
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string path = "C:\\CCFlowTemplete" + DateTime.Now.ToString("yy年MM月dd日HH时mm分ss秒");

            if (System.IO.Directory.Exists(path) == false)
            {
                System.IO.Directory.CreateDirectory(path);
            }

            #region 1.备份流程类别信息
            DataSet dsFlows = new DataSet();
            //WF_FlowSort
            DataTable dt = DBAccess.RunSQLReturnTable("SELECT * FROM WF_FlowSort");
            dt.TableName = "WF_FlowSort";
            dsFlows.Tables.Add(dt);
            dsFlows.WriteXml(path + "\\FlowTables.xml");
            #endregion 备份流程类别信息.

            #region 2.备份组织结构.
            DataSet dsPort = new DataSet();
            //emps
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Port_Emp");
            dt.TableName = "Port_Emp";
            dsPort.Tables.Add(dt);

            //Port_Dept
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Port_Dept");
            dt.TableName = "Port_Dept";
            dsPort.Tables.Add(dt);

            //Port_Station
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Port_Station");
            dt.TableName = "Port_Station";
            dsPort.Tables.Add(dt);

            //Port_EmpStation
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Port_DeptEmpStation");
            dt.TableName = "Port_DeptEmpStation";
            dsPort.Tables.Add(dt);


            dsPort.WriteXml(path + "\\PortTables.xml");
            #endregion 备份表单相关数据.

            #region 3.备份系统数据
            DataSet dsSysTables = new DataSet();

            //Sys_EnumMain
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Sys_EnumMain");
            dt.TableName = "Sys_EnumMain";
            dsSysTables.Tables.Add(dt);

            //Sys_Enum
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Sys_Enum");
            dt.TableName = "Sys_Enum";
            dsSysTables.Tables.Add(dt);

            //Sys_FormTree
            dt           = DBAccess.RunSQLReturnTable("SELECT * FROM Sys_FormTree");
            dt.TableName = "Sys_FormTree";
            dsSysTables.Tables.Add(dt);
            dsSysTables.WriteXml(path + "\\SysTables.xml");
            #endregion 备份系统数据.

            #region 4.备份表单相关数据.
            string pathOfTables = path + "\\SFTables";
            System.IO.Directory.CreateDirectory(pathOfTables);
            SFTables tabs = new SFTables();
            tabs.RetrieveAll();
            foreach (SFTable item in tabs)
            {
                if (item.No.Contains("."))
                {
                    continue;
                }

                if (item.SrcType != SrcType.CreateTable)
                {
                    continue;
                }

                try
                {
                    string  sql = "SELECT * FROM " + item.No + " ";
                    DataSet ds  = new DataSet();
                    ds.Tables.Add(BP.DA.DBAccess.RunSQLReturnTable(sql));
                    ds.WriteXml(pathOfTables + "\\" + item.No + ".xml");
                }
                catch
                {
                }
            }
            #endregion 备份表单相关数据.

            #region 5.备份流程.
            Flows fls = new Flows();
            fls.RetrieveAllFromDBSource();
            foreach (Flow fl in fls)
            {
                FlowSort fs = new FlowSort();
                fs.No = fl.FK_FlowSort;
                fs.RetrieveFromDBSources();

                string pathDir = path + "\\Flow\\" + fs.No + "." + fs.Name + "\\";
                if (System.IO.Directory.Exists(pathDir) == false)
                {
                    System.IO.Directory.CreateDirectory(pathDir);
                }

                fl.DoExpFlowXmlTemplete(pathDir);
            }
            #endregion 备份流程.

            #region 6.备份表单.
            MapDatas mds = new MapDatas();
            mds.RetrieveAllFromDBSource();
            foreach (MapData md in mds)
            {
                if (md.FK_FrmSort.Length < 2)
                {
                    continue;
                }

                SysFormTree fs = new SysFormTree();
                fs.No = md.FK_FormTree;
                fs.RetrieveFromDBSources();

                string pathDir = path + "\\Form\\" + fs.No + "." + fs.Name;
                if (System.IO.Directory.Exists(pathDir) == false)
                {
                    System.IO.Directory.CreateDirectory(pathDir);
                }
                DataSet ds = BP.Sys.CCFormAPI.GenerHisDataSet(md.No);
                ds.WriteXml(pathDir + "\\" + md.Name + ".xml");
            }
            #endregion 备份表单.

            return("执行成功,存放路径:" + path);
        }
Exemple #17
0
        public override object Do()
        {
            string msg = "";

            #region 检查数据文件是否完整.
            string path = "C:\\CCFlowTemplete";
            if (System.IO.Directory.Exists(path) == false)
            {
                msg += "@错误:约定的目录不存在服务器" + path + ",请把从ccflow备份的文件放入" + path;
            }

            //PortTables.
            string file = path + "\\PortTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }

            //SysTables.
            file = path + "\\SysTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }

            //FlowTables.
            file = path + "\\FlowTables.xml";
            if (System.IO.File.Exists(file) == false)
            {
                msg += "@错误:约定的文件不存在," + file;
            }
            #endregion 检查数据文件是否完整.

            #region 1 装载流程基础表数据.
            DataSet ds = new DataSet();
            ds.ReadXml(path + "\\FlowTables.xml");

            //流程类别.
            FlowSorts sorts = new FlowSorts();
            sorts.ClearTable();
            DataTable dt = ds.Tables["WF_FlowSort"];
            // sorts = QueryObject.InitEntitiesByDataTable(sorts, dt, null) as FlowSorts;
            foreach (FlowSort item in sorts)
            {
                item.DirectInsert(); //插入数据.
            }
            #endregion 1 装载流程基础表数据.

            #region 2 组织结构.
            ds = new DataSet();
            ds.ReadXml(path + "\\PortTables.xml");

            //Port_Emp.
            Emps emps = new Emps();
            emps.ClearTable();
            dt   = ds.Tables["Port_Emp"];
            emps = QueryObject.InitEntitiesByDataTable(emps, dt, null) as Emps;
            foreach (Emp item in emps)
            {
                item.DirectInsert(); //插入数据.
            }

            //Depts.
            Depts depts = new Depts();
            depts.ClearTable();
            dt    = ds.Tables["Port_Dept"];
            depts = QueryObject.InitEntitiesByDataTable(depts, dt, null) as Depts;
            foreach (Dept item in depts)
            {
                item.DirectInsert(); //插入数据.
            }

            //Stations.
            Stations stas = new Stations();
            stas.ClearTable();
            dt   = ds.Tables["Port_Station"];
            stas = QueryObject.InitEntitiesByDataTable(stas, dt, null) as Stations;
            foreach (Station item in stas)
            {
                item.DirectInsert(); //插入数据.
            }


            //EmpDepts.
            EmpDepts eds = new EmpDepts();
            eds.ClearTable();
            dt  = ds.Tables["Port_EmpDept"];
            eds = QueryObject.InitEntitiesByDataTable(eds, dt, null) as EmpDepts;
            foreach (EmpDept item in eds)
            {
                item.DirectInsert(); //插入数据.
            }

            //EmpStations.
            EmpStations ess = new EmpStations();
            ess.ClearTable();
            dt  = ds.Tables["Port_EmpStation"];
            ess = QueryObject.InitEntitiesByDataTable(ess, dt, null) as EmpStations;
            foreach (EmpStation item in ess)
            {
                item.DirectInsert(); //插入数据.
            }
            #endregion 2 组织结构.

            #region 3 恢复系统数据.
            ds = new DataSet();
            ds.ReadXml(path + "\\SysTables.xml");

            //枚举Main.
            SysEnumMains sems = new SysEnumMains();
            sems.ClearTable();
            dt   = ds.Tables["Sys_EnumMain"];
            sems = QueryObject.InitEntitiesByDataTable(sems, dt, null) as SysEnumMains;
            foreach (SysEnumMain item in sems)
            {
                item.DirectInsert(); //插入数据.
            }

            //枚举.
            SysEnums ses = new SysEnums();
            ses.ClearTable();
            dt  = ds.Tables["Sys_Enum"];
            ses = QueryObject.InitEntitiesByDataTable(ses, dt, null) as SysEnums;
            foreach (SysEnum item in ses)
            {
                item.DirectInsert(); //插入数据.
            }

            ////Sys_FormTree.
            //BP.Sys.SysFormTrees sfts = new SysFormTrees();
            //sfts.ClearTable();
            //dt = ds.Tables["Sys_FormTree"];
            //sfts = QueryObject.InitEntitiesByDataTable(sfts, dt, null) as SysFormTrees;
            //foreach (SysFormTree item in sfts)
            //{
            //    try
            //    {
            //       item.DirectInsert(); //插入数据.
            //    }
            //    catch
            //    {
            //    }
            //}
            #endregion 3 恢复系统数据.

            #region 4.备份表单相关数据.
            if (1 == 2)
            {
                string pathOfTables = path + "\\SFTables";
                System.IO.Directory.CreateDirectory(pathOfTables);
                SFTables tabs = new SFTables();
                tabs.RetrieveAll();
                foreach (SFTable item in tabs)
                {
                    if (item.No.Contains("."))
                    {
                        continue;
                    }

                    string sql = "SELECT * FROM " + item.No;
                    ds = new DataSet();
                    ds.Tables.Add(BP.DA.DBAccess.RunSQLReturnTable(sql));
                    ds.WriteXml(pathOfTables + "\\" + item.No + ".xml");
                }
            }
            #endregion 4 备份表单相关数据.

            #region 5.恢复表单数据.
            //删除所有的流程数据.
            MapDatas mds = new MapDatas();
            mds.RetrieveAll();
            foreach (MapData fl in mds)
            {
                //if (fl.FK_FormTree.Length > 1 || fl.FK_FrmSort.Length > 1)
                //    continue;
                fl.Delete(); //删除流程.
            }

            //清除数据.
            SysFormTrees fss = new SysFormTrees();
            fss.ClearTable();

            // 调度表单文件。
            string          frmPath = path + "\\Form";
            DirectoryInfo   dirInfo = new DirectoryInfo(frmPath);
            DirectoryInfo[] dirs    = dirInfo.GetDirectories();
            foreach (DirectoryInfo item in dirs)
            {
                if (item.FullName.Contains(".svn"))
                {
                    continue;
                }

                string[] fls = System.IO.Directory.GetFiles(item.FullName);
                if (fls.Length == 0)
                {
                    continue;
                }

                SysFormTree fs = new SysFormTree();
                fs.No       = item.Name.Substring(0, item.Name.IndexOf('.'));
                fs.Name     = item.Name.Substring(item.Name.IndexOf('.'));
                fs.ParentNo = "0";
                fs.Insert();

                foreach (string f in fls)
                {
                    try
                    {
                        msg += "@开始调度表单模板文件:" + f;
                        System.IO.FileInfo info = new System.IO.FileInfo(f);
                        if (info.Extension != ".xml")
                        {
                            continue;
                        }

                        ds = new DataSet();
                        ds.ReadXml(f);

                        MapData md = MapData.ImpMapData(ds, false);
                        md.FK_FrmSort = fs.No;
                        md.Update();
                    }
                    catch (Exception ex)
                    {
                        msg += "@调度失败,文件:" + f + ",异常信息:" + ex.Message;
                    }
                }
            }
            #endregion 5.恢复表单数据.

            #region 6.恢复流程数据.
            //删除所有的流程数据.
            Flows flsEns = new Flows();
            flsEns.RetrieveAll();
            foreach (Flow fl in flsEns)
            {
                fl.DoDelete(); //删除流程.
            }

            dirInfo = new DirectoryInfo(path + "\\Flow\\");
            dirs    = dirInfo.GetDirectories();

            //删除数据.
            FlowSorts fsRoots = new FlowSorts();
            fsRoots.ClearTable();

            //生成流程树.
            FlowSort fsRoot = new FlowSort();
            fsRoot.No       = "99";
            fsRoot.Name     = "流程树";
            fsRoot.ParentNo = "0";
            fsRoot.DirectInsert();

            foreach (DirectoryInfo dir in dirs)
            {
                if (dir.FullName.Contains(".svn"))
                {
                    continue;
                }

                string[] fls = System.IO.Directory.GetFiles(dir.FullName);
                if (fls.Length == 0)
                {
                    continue;
                }

                FlowSort fs = new FlowSort();
                fs.No       = dir.Name.Substring(0, dir.Name.IndexOf('.'));
                fs.Name     = dir.Name.Substring(3);
                fs.ParentNo = fsRoot.No;
                fs.Insert();

                foreach (string filePath in fls)
                {
                    msg += "@开始调度流程模板文件:" + filePath;
                    Flow myflow = BP.WF.Flow.DoLoadFlowTemplate(fs.No, filePath, ImpFlowTempleteModel.AsTempleteFlowNo);
                    msg += "@流程:" + myflow.Name + "装载成功。";

                    System.IO.FileInfo info = new System.IO.FileInfo(filePath);
                    myflow.Name = info.Name.Replace(".xml", "");
                    if (myflow.Name.Substring(2, 1) == ".")
                    {
                        myflow.Name = myflow.Name.Substring(3);
                    }

                    myflow.DirectUpdate();
                }
            }
            #endregion 6.恢复流程数据.

            BP.DA.Log.DefaultLogWriteLineInfo(msg);

            //删除多余的空格.
            BP.WF.DTS.DeleteBlankGroupField dts = new DeleteBlankGroupField();
            dts.Do();

            //执行生成签名.
            GenerSiganture gs = new GenerSiganture();
            gs.Do();

            return(msg);
        }
        /// <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");
        }
Exemple #19
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());
        }
Exemple #20
0
        public void BindFlowFrms()
        {
            FrmNodes fns = new FrmNodes(this.FK_Node);

            this.Pub1.AddH2("流程表单绑定 - 请打钩要绑定的表单,然后点保存按钮。");
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("物理表");
            this.Pub1.AddTREnd();

            BP.WF.Node nd  = new BP.WF.Node(this.FK_Node);
            MapDatas   mds = new MapDatas();

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

            FrmSorts fss = new FrmSorts();

            fss.RetrieveAll();
            int idx = 0;

            foreach (FrmSort fs in fss)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTDB("colspan=3", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FrmSort != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(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();
                }
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=5", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemple #21
0
        public void BindFlowFrms()
        {
            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            this.Pub1.AddH2("流程表单绑定");
            this.Pub1.AddTable("align=left");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("物理表");
            this.Pub1.AddTDTitle("权限");
            this.Pub1.AddTREnd();

            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            MapDatas    mds     = new MapDatas();
            QueryObject obj_mds = new QueryObject(mds);

            obj_mds.AddWhere(MapDataAttr.AppType, (int)AppType.Application);
            obj_mds.addOrderBy(MapDataAttr.Name);
            obj_mds.DoQuery();
            //FrmSorts fss = new FrmSorts();
            //fss.RetrieveAll();
            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, "0");
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTDB("colspan=4", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD("<a href='../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "'  target=_blank>" + md.Name + "</a>");
                    this.Pub1.AddTD(md.PTable);

                    if (cb.Checked)
                    {
                        this.Pub1.AddTD("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\">字段</a>|<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\">附件</a>");
                    }
                    else
                    {
                        this.Pub1.AddTD();
                    }
                    //this.Pub1.AddTD(md.Designer);
                    //this.Pub1.AddTD(md.DesignerUnit);
                    //this.Pub1.AddTD(md.DesignerContact);
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=5", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
    // 参照渡しで受け取ったフィールデータを更新
    public void GetMapData(int mapId)
    {
        Struct.FieldBase fieldBase = new Struct.FieldBase();
        MapDatas         mapDatas  = new MapDatas();

        switch (mapId)
        {
        case 10:
            fieldBase = mapDatas.GetData10();
            break;

        case 9:
            fieldBase = mapDatas.GetData9();
            break;

        case 8:
            fieldBase = mapDatas.GetData8();
            break;

        case 7:
            fieldBase = mapDatas.GetData7();
            break;

        case 6:
            fieldBase = mapDatas.GetData6();
            break;

        case 5:
            fieldBase = mapDatas.GetData5();
            break;

        case 4:
            fieldBase = mapDatas.GetData4();
            break;

        case 3:
            fieldBase = mapDatas.GetData3();
            break;

        case 2:
            fieldBase = mapDatas.GetData2();
            break;

        case 1:
            fieldBase = mapDatas.GetData1();
            break;

        default:
            Debug.Log("マップデータが読み込まれてません");
            break;
        }

        // フィールドデータの読み込み
        field        = new Struct.Field();
        field.name   = fieldBase.name;
        field.width  = fieldBase.width;
        field.height = fieldBase.height;
        field.cells  = new Struct.CellInfo[field.height, field.width];

        // 各セルデータの追加
        for (int y = 0; y < field.height; y++)
        {
            for (int x = 0; x < field.width; x++)
            {
                switch (fieldBase.cells[y, x])
                {
                // name, category, moveCost, avoidanceBonus, defenseBonus, magicalDefenseBonus, hpBonus,      hpOnus;
                // 名前, 種類,     コスト,   回避率,         防御ボーナス, 魔防ボーナス,        回復値,       地形ダメージ
                case 0:
                default:
                    field.cells[y, x] = new Struct.CellInfo("平地", 0, 1, 0, 0, 0, 0, 0);
                    break;

                case 1:
                    field.cells[y, x] = new Struct.CellInfo("草むら", 0, 2, 10, 0, 0, 0, 0);
                    break;

                case 2:
                    field.cells[y, x] = new Struct.CellInfo("壁", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 3:
                    field.cells[y, x] = new Struct.CellInfo("城門", 0, 1, 20, 2, 0, 5, 0);
                    break;

                case 4:
                    field.cells[y, x] = new Struct.CellInfo("沼", 0, 2, -5, 0, 0, 0, 0);
                    break;

                case 5:
                    field.cells[y, x] = new Struct.CellInfo("熱い床", 0, 2, -15, 0, 0, 0, 5);
                    break;

                case 6:
                    field.cells[y, x] = new Struct.CellInfo("川", 1, 2, -15, 0, 0, 0, 5);
                    break;

                case 7:
                    field.cells[y, x] = new Struct.CellInfo("水晶", 1, 2, -15, 0, 0, 0, 5);
                    break;

                case 8:
                    field.cells[y, x] = new Struct.CellInfo("森", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 9:
                    field.cells[y, x] = new Struct.CellInfo("村", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 10:
                    field.cells[y, x] = new Struct.CellInfo("城", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 11:
                    field.cells[y, x] = new Struct.CellInfo("木", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 12:
                    field.cells[y, x] = new Struct.CellInfo("山", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 13:
                    field.cells[y, x] = new Struct.CellInfo("切り株", 0, 2, 10, 0, 0, 0, 0);
                    break;

                case 14:
                    field.cells[y, x] = new Struct.CellInfo("岩", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 15:
                    field.cells[y, x] = new Struct.CellInfo("穴", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 16:
                    field.cells[y, x] = new Struct.CellInfo("看板", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 17:
                    field.cells[y, x] = new Struct.CellInfo("池", 1, 2, -15, 0, 0, 0, 5);
                    break;

                case 18:
                    field.cells[y, x] = new Struct.CellInfo("苔", 0, 2, -5, 0, 0, 0, 0);
                    break;

                case 19:
                    field.cells[y, x] = new Struct.CellInfo("枯れ木", 0, 2, 10, 0, 0, 0, 0);
                    break;

                case 20:
                    field.cells[y, x] = new Struct.CellInfo("石像", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 21:
                    field.cells[y, x] = new Struct.CellInfo("溶岩", 1, 1, 5, 1, 0, 0, 0);
                    break;

                case 22:
                    field.cells[y, x] = new Struct.CellInfo("橋", 0, 1, 0, 0, 0, 0, 0);
                    break;

                case 23:
                    field.cells[y, x] = new Struct.CellInfo("出入口", 0, 1, 0, 0, 0, 0, 0);
                    break;
                }
            }
        }
    }
Exemple #23
0
        public void SelectedFrm()
        {
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node);

            this.Pub1.AddTable("align=left");
            this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定的表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("表/视图");
            this.Pub1.AddTREnd();

            MapDatas    mds     = new MapDatas();
            QueryObject obj_mds = new QueryObject(mds);

            obj_mds.AddWhere(MapDataAttr.AppType, (int)AppType.Application);
            obj_mds.addOrderBy(MapDataAttr.Name);
            obj_mds.DoQuery();

            SysFormTrees formTrees = new SysFormTrees();
            QueryObject  objInfo   = new QueryObject(formTrees);

            objInfo.AddWhere(SysFormTreeAttr.ParentNo, "0");
            objInfo.addOrderBy(SysFormTreeAttr.Name);
            objInfo.DoQuery();

            int idx = 0;

            foreach (SysFormTree fs in formTrees)
            {
                idx++;
                this.Pub1.AddTRSum();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD("colspan=4", fs.Name);
                this.Pub1.AddTREnd();
                foreach (MapData md in mds)
                {
                    if (md.FK_FormTree != fs.No)
                    {
                        continue;
                    }
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);

                    CheckBox cb = new CheckBox();
                    cb.ID      = "CB_" + md.No;
                    cb.Text    = md.No;
                    cb.Checked = fns.Contains(FrmNodeAttr.FK_Frm, md.No);

                    this.Pub1.AddTD(cb);
                    if (cb.Checked)
                    {
                        this.Pub1.AddTDB("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" ><b>" + md.Name + "</b></a>");
                        this.Pub1.AddTDB(md.PTable);
                    }
                    else
                    {
                        this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>");
                        this.Pub1.AddTD(md.PTable);
                    }
                    this.Pub1.AddTREnd();
                }
                AddChildNode(fs.No, mds, fns);
            }
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.Text     = "保存并设置绑定方案属性";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_SaveFlowFrms_Click);
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=4", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemple #24
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());
        }
Exemple #25
0
 public T Get(string id, int mapKey)
 {
     if (!MapDatas.ContainsKey(id))
     {
         return(default);
        /// <summary>
        ///
        /// </summary>
        public void MapAttr()
        {
            MapDatas mds = this.GetMDs;

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeftTX("批量:" + this.Label);

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("表单ID");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            foreach (MapData md in mds)
            {
                switch (this.DoType)
                {
                case "Copy":
                    if (md.MapAttrs.Contains(MapAttrAttr.KeyOfEn, this.KeyOfEn) == true)
                    {
                        continue;
                    }
                    break;

                case "Update":
                    if (md.MapAttrs.Contains(MapAttrAttr.KeyOfEn, this.KeyOfEn) == false)
                    {
                        continue;
                    }
                    if (md.No == this.FK_MapData)
                    {
                        continue;
                    }

                    break;

                case "Delete":
                    if (md.MapAttrs.Contains(MapAttrAttr.KeyOfEn, this.KeyOfEn) == false)
                    {
                        continue;
                    }
                    break;

                default:
                    break;
                }


                this.Pub1.AddTR();
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + md.No;
                cb.Text = md.Name;
                this.Pub1.AddTD(cb);
                this.Pub1.AddTD(md.Name);
                this.Pub1.AddTD("<a href=''>预览自由表单</a> - <a href=''>设计自由表单</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();

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

            btn.ID     = "Btn";
            btn.Text   = "执行批量[" + this.Label + "]操作";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
        }