public void InitToolbar(bool isAskFor, string appPath)
        {
            toolbar     = this.ToolBar1;
            this.currND = new BP.WF.Node(this.FK_Node);
            BtnLab btnLab = new BtnLab(currND.NodeID);

            if (btnLab.PrintDocEnable && isAskFor == false)
            {
                /*如果不是加签 */
                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintRTF)
                {
                    string urlr = appPath + "WF/WorkOpt/PrintDoc.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow;
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"WinOpen('" + urlr + "','dsdd'); \" />");
                }

                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintWord)
                {
                    string urlr = appPath + "WF/Rpt/RptDoc.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&IsPrint=1";
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"WinOpen('" + urlr + "','dsdd'); \" />");
                }

                if (this.currND.HisPrintDocEnable == PrintDocEnable.PrintHtml)
                {
                    toolbar.Add("<input type=button class=Btn value='" + btnLab.PrintDocLab + "' enable=true onclick=\"printFrom(); \" />");
                }
            }
        }
Example #2
0
        /// <summary>
        /// 修改节点运行模式
        /// </summary>
        /// <returns></returns>
        public string Node_ChangeRunModel()
        {
            string runModel = GetValFromFrmByKey("RunModel");

            BP.WF.Node node = new BP.WF.Node(this.FK_Node);
            //节点运行模式
            switch (runModel)
            {
            case "NodeOrdinary":
                node.HisRunModel = BP.WF.RunModel.Ordinary;
                break;

            case "NodeFL":
                node.HisRunModel = BP.WF.RunModel.FL;
                break;

            case "NodeHL":
                node.HisRunModel = BP.WF.RunModel.HL;
                break;

            case "NodeFHL":
                node.HisRunModel = BP.WF.RunModel.FHL;
                break;

            case "NodeSubThread":
                node.HisRunModel = BP.WF.RunModel.SubThread;
                break;
            }
            node.Update();

            return("设置成功.");
        }
Example #3
0
        public void BindList()
        {
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            Listens ens = new Listens();

            ens.Retrieve(ListenAttr.FK_Node, this.FK_Node);

            if (ens.Count == 0)
            {
                this.Response.Redirect("Listen.aspx?FK_Node=" + this.FK_Node + "&DoType=New", true);
                return;
            }

            this.Pub1.AddTable("width=80%");
            this.Pub1.AddCaptionLeft("设置收听:" + nd.Name + "- <a href='Listen.aspx?FK_Node=" + this.FK_Node + "&DoType=New' >新建</a>");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("当前节点");
            this.Pub1.AddTDTitle("收听节点");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();
            foreach (Listen en in ens)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD(nd.Name);
                this.Pub1.AddTD(en.Nodes);
                // this.Pub1.AddTD(en.Title);
                //this.Pub1.AddTD(en.Doc);
                this.Pub1.AddTD("<a href='Listen.aspx?FK_Node=" + this.FK_Node + "&DoType=New&RefOID=" + en.OID + "'>删除-编辑</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
        void btn_Click(object sender, EventArgs e)
        {
            Nodes nds = new Nodes(this.FK_Flow);

            BP.WF.Node mynd = new BP.WF.Node(this.FK_Node);
            string     strs = "@";

            foreach (BP.WF.Node nd in nds)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + nd.NodeID);
                if (cb.Checked == false)
                {
                    continue;
                }

                strs += nd.NodeID + "@";
            }


            if (mynd.ShowSheets == strs)
            {
                return;
            }

            mynd.ShowSheets = strs;
            mynd.Update();
            //   Alert(strs);
            // Alert("保存成功。");
        }
Example #5
0
        public int DoNewNode(bool isLogin, params string[] param)
        {
            LetAdminLogin("CH", isLogin);

            string fk_flow = param[0];

            if (string.IsNullOrEmpty(fk_flow))
            {
                return(0);
            }

            string nodeName = param[1];
            string icon     = param[2];

            int x           = (int)double.Parse(param[3]),
                y           = (int)double.Parse(param[4]),
                HisRunModel = int.Parse(param[5]);

            Flow fl = new Flow(fk_flow);

            BP.WF.Node nf = fl.DoNewNode(x, y);
            nf.ICON        = icon;
            nf.Name        = nodeName;
            nf.HisRunModel = (RunModel)HisRunModel;
            nf.Update();
            return(nf.NodeID);
        }
Example #6
0
        public void DealWithPanelFlow(ArrayList al, GenerWorkerLists wlSeles)
        {
            // 删除当前非配的工作。
            // 已经非配或者自动分配的任务。
            GenerWorkFlow gwf    = new GenerWorkFlow(this.WorkID);
            int           NodeID = gwf.FK_Node;
            Int64         workId = this.WorkID;

            //GenerWorkerLists wls = new GenerWorkerLists(this.WorkID,NodeID);
            DBAccess.RunSQL("UPDATE  WF_GenerWorkerlist SET IsEnable=0  WHERE WorkID=" + this.WorkID + " AND FK_Node=" + NodeID);
            //  string vals = "";
            string emps  = "";
            string myemp = "";

            foreach (Object obj in al)
            {
                emps += obj.ToString() + ",";
                myemp = obj.ToString();
                DBAccess.RunSQL("UPDATE  WF_GenerWorkerlist SET IsEnable=1  WHERE WorkID=" + this.WorkID + " AND FK_Node=" + NodeID + " AND fk_emp='" + obj + "'");
            }

            BP.WF.Node nd = new BP.WF.Node(NodeID);
            Work       wk = nd.HisWork;

            wk.OID = this.WorkID;
            wk.Retrieve();

            wk.Emps = emps;
            wk.Update();
        }
        /// <summary>
        /// 获取文件路径
        /// </summary>
        public string FileFullPath(string fileName, BillTemplate bt)
        {
            string fileType = "";

            if (bt.HisBillFileType == BillFileType.RuiLang)
            {
                fileType = ".grf";
            }
            else
            {
                fileType = ".rtf";
            }

            string filePath = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\" + bt.No + fileType;

            BP.WF.Node curNode = new BP.WF.Node(this.NodeID);
            //表单树时对存放路径进行修改
            if (curNode.FormType == NodeFormType.SheetTree)
            {
                bt.Url   = "FlowFrm\\" + this.FK_Flow + "\\" + this.NodeID + "\\" + fileName.Replace(fileType, "");
                filePath = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\FlowFrm\\" + this.FK_Flow + "\\" + this.NodeID;
                if (!System.IO.Directory.Exists(filePath))
                {
                    System.IO.Directory.CreateDirectory(filePath);
                }
                filePath = BP.Sys.SystemConfig.PathOfCyclostyleFile + "\\FlowFrm\\" + this.FK_Flow + "\\" + this.NodeID + "\\" + fileName;
            }
            return(filePath);
        }
Example #8
0
        /// <summary>
        /// 表单方案
        /// </summary>
        /// <returns></returns>
        public string BindFrms_Init()
        {
            //注册这个枚举,防止第一次运行出错.
            BP.Sys.SysEnums ses = new SysEnums("FrmEnableRole");

            string text = "";

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

            //FrmNodeExt fns = new FrmNodeExt(this.FK_Flow, this.FK_Node);

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

            #region 如果没有ndFrm 就增加上.
            bool isHaveNDFrm = false;
            foreach (FrmNode fn in fns)
            {
                if (fn.FK_Frm == "ND" + this.FK_Node)
                {
                    isHaveNDFrm = true;
                    break;
                }
            }

            if (isHaveNDFrm == false)
            {
                FrmNode fn = new FrmNode();
                fn.FK_Flow = this.FK_Flow;
                fn.FK_Frm  = "ND" + this.FK_Node;
                fn.FK_Node = this.FK_Node;

                fn.FrmEnableRole = FrmEnableRole.Disable; //就是默认不启用.
                fn.FrmSln        = 0;
                //  fn.IsEdit = true;
                fn.IsEnableLoadData = true;
                fn.Insert();
                fns.AddEntity(fn);
            }
            #endregion 如果没有ndFrm 就增加上.

            //组合这个实体才有外键信息.
            FrmNodeExts fnes = new FrmNodeExts();
            foreach (FrmNode fn in fns)
            {
                MapData md = new MapData();
                md.No = fn.FK_Frm;
                if (md.IsExits == false)
                {
                    fn.Delete();  //说明该表单不存在了,就需要把这个删除掉.
                    continue;
                }

                FrmNodeExt myen = new FrmNodeExt(fn.MyPK);
                fnes.AddEntity(myen);
            }

            //把json数据返回过去.
            return(fnes.ToJson());
        }
Example #9
0
        private void LoadAttachment()
        {
            string EnName = "ND" + this.FK_Node;

            BP.Sys.MapData mapdata = new BP.Sys.MapData(EnName);

            FrmAttachments attachments = new BP.Sys.FrmAttachments();

            attachments = mapdata.FrmAttachments;


            bool isCompleate = false;

            BP.WF.Node node = new BP.WF.Node(FK_Node);
            try
            {
                WorkFlow workFlow = new WorkFlow(node.FK_Flow, WorkID);
                isCompleate = workFlow.IsComplete;
            }
            catch (Exception)
            {
                try
                {
                    Flow  fl  = new Flow(node.FK_Flow);
                    GERpt rpt = fl.HisGERpt;
                    rpt.OID = WorkID;
                    rpt.Retrieve();

                    if (rpt != null)
                    {
                        if (rpt.WFState == WFState.Complete)
                        {
                            isCompleate = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }



            foreach (FrmAttachment ath in attachments)
            {
                string src = "";
                if (!isCompleate)
                {
                    src = CCFlowAppPath + "WF/CCForm/AttachmentUpload.aspx?PKVal=" + this.WorkID + "&Ath=" + ath.NoOfObj + "&FK_MapData=" + EnName + "&FK_FrmAttachment=" + ath.MyPK + "&FK_Node=" + this.FK_Node;
                }
                else
                {
                    src = CCFlowAppPath + "WF/CCForm/AttachmentUpload.aspx?PKVal=" + this.WorkID + "&Ath=" + ath.NoOfObj + "&FK_MapData=" + EnName + "&FK_FrmAttachment=" + ath.MyPK + "&FK_Node=" + this.FK_Node + "&IsReadonly=1";
                }

                this.Pub1.Add("<iframe ID='F" + ath.MyPK + "'    src='" + src + "' frameborder=0  style='position:absolute;width:" + ath.W + "px; height:" + ath.H + "px;text-align: left;'  leftMargin='0'  topMargin='0' scrolling=auto /></iframe>");
            }
        }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.currND     = new BP.WF.Node(this.FK_Node);
     this.Page.Title = "第" + this.currND.Step + "步:" + this.currND.Name;
     if (IsPostBack == false)
     {
         InitToolsBar();
     }
 }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "工作删除";
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);
            this.ToolBar1.Add("<b>删除方式:</b>");
            this.ToolBar1.AddDDL("DDL1");
            this.DDL1.Attributes["onchange"] = "OnChange(this);";
            this.ToolBar1.AddBtn("Btn_OK", "确定");
            this.ToolBar1.GetBtnByID("Btn_OK").Attributes["onclick"] = " return confirm('您确定要执行吗?');";
            this.ToolBar1.GetBtnByID("Btn_OK").Click += new EventHandler(ReturnWork_Click);
            this.ToolBar1.AddBtn("Btn_Cancel", "取消");
            this.ToolBar1.GetBtnByID("Btn_Cancel").Click += new EventHandler(ReturnWork_Click);
            string  appPath = this.Request.ApplicationPath;
            TextBox tb      = new TextBox();

            tb.TextMode = TextBoxMode.MultiLine;
            tb.ID       = "TB_Doc";
            tb.Rows     = 15;
            tb.Columns  = 50;
            this.Pub1.Add(tb);
            if (this.IsPostBack == false)
            {
                if (nd.HisDelWorkFlowRole == DelWorkFlowRole.DeleteAndWriteToLog)
                {
                    /*删除并记录日志 */
                    SysEnum se = new SysEnum(BtnAttr.DelEnable, (int)DelWorkFlowRole.DeleteAndWriteToLog);
                    this.DDL1.Items.Add(new ListItem(se.Lab, se.IntKey.ToString()));
                }

                if (nd.HisDelWorkFlowRole == DelWorkFlowRole.DeleteByFlag)
                {
                    /*逻辑删除 */
                    SysEnum se = new SysEnum(BtnAttr.DelEnable, (int)DelWorkFlowRole.DeleteByFlag);
                    this.DDL1.Items.Add(new ListItem(se.Lab, se.IntKey.ToString()));
                }

                if (nd.HisDelWorkFlowRole == DelWorkFlowRole.ByUser)
                {
                    /*让用户来决定.*/
                    SysEnums ses = new SysEnums(BtnAttr.DelEnable);
                    foreach (SysEnum se in ses)
                    {
                        DelWorkFlowRole role = (DelWorkFlowRole)se.IntKey;
                        if (role == DelWorkFlowRole.None)
                        {
                            continue;
                        }
                        if (role == DelWorkFlowRole.ByUser)
                        {
                            continue;
                        }
                        this.DDL1.Items.Add(new ListItem(se.Lab, se.IntKey.ToString()));
                    }
                }
            }
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ApplicationPath = this.Request.PhysicalApplicationPath;
            this.Title      = "单据打印";
            if (this.BillIdx != null)
            {
                this.PrintBill();
                return;
            }
            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("ID");
            this.Pub1.AddTDTitle("表单编号");
            this.Pub1.AddTDTitle("表单名");
            this.Pub1.AddTDTitle("下载");
            this.Pub1.AddTREnd();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_Node);
            string     path = ApplicationPath + @"DataUser\CyclostyleFile\FlowFrm\" + nd.FK_Flow + "\\" + nd.NodeID + "\\";

            string[] fls = null;
            try
            {
                fls = System.IO.Directory.GetFiles(path);
            }
            catch
            {
                this.Pub1.AddTableEnd();
                this.Pub1.AddMsgOfWarning("获取模版错误", "模版文件没有找到。" + path);
                return;
            }

            int idx     = 0;
            int fileIdx = -1;

            foreach (string f in fls)
            {
                fileIdx++;
                string myfile = f.Replace(path, "");
                if (myfile.ToLower().Contains(".rtf") == false)
                {
                    continue;
                }

                string[] strs = myfile.Split('.');
                idx++;

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(strs[0]);
                this.Pub1.AddTD(strs[1]);
                this.Pub1.AddTD("<a href='Print.aspx?FK_Node=" + this.FK_Node + "&FID=" + this.FID + "&WorkID=" + this.WorkID + "&BillIdx=" + fileIdx + "' target=_blank >打印</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Example #13
0
 protected void DDL_Frm1()
 {
     BP.WF.Node nd = new BP.WF.Node(this.NodeID);
     this.DDL_Frm.Items.Clear();
     BP.WF.Nodes nds = new BP.WF.Nodes(nd.HisFlow.No);
     foreach (BP.WF.Node item in nds)
     {
         this.DDL_Frm.Items.Add(new ListItem(item.NodeID + " " + item.Name, item.NodeID.ToString()));
     }
 }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Node mynd = new BP.WF.Node();
            mynd.NodeID = this.FK_Node;
            mynd.RetrieveFromDBSources();

            if (mynd.HisReturnRole != ReturnRole.ReturnSpecifiedNodes)
            {
                this.Pub1.AddFieldSet("操作错误:", "<br><br>当前节点的退回规则不是退回到指定的节点,所以您不能操作此功能。<br><br>请在节点属性=>退回规则属性里设置,退回指定的节点,此功能才有效。<br><br><br><br>");
                return;
            }

            this.Pub1.AddTable("width='80%'");
            this.Pub1.AddCaptionLeft("为“" + mynd.Name + "”, 设置可退回的节点。");
            //this.Pub1.AddTR();
            //this.Pub1.AddTDTitle("节点步骤");
            //this.Pub1.AddTDTitle("可退回的节点");
            //this.Pub1.AddTREnd();

            BP.WF.NodeReturns rnds = new NodeReturns();
            rnds.Retrieve(BP.WF.NodeReturnAttr.FK_Node, this.FK_Node);


            BP.WF.Nodes nds = new Nodes();
            nds.Retrieve(BP.WF.NodeAttr.FK_Flow, this.FK_Flow);
            foreach (BP.WF.Node nd in nds)
            {
                if (nd.NodeID == this.FK_Node)
                {
                    continue;
                }

                CheckBox cb = new CheckBox();
                cb.Text    = nd.Name;
                cb.ID      = "CB_" + nd.NodeID;
                cb.Checked = rnds.IsExits(NodeReturnAttr.ReturnTo, nd.NodeID);

                this.Pub1.AddTR();
                this.Pub1.AddTD("第" + nd.Step + "步");
                this.Pub1.AddTD(cb);
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD();
            Button btn = new Button();

            btn.Text     = "Save";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.AddTD(btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithHR();
            this.Pub1.AddFieldSet("特别说明:", "1,只有节点属性的退回规则被设置成退回制订的节点,此功能才有效。<br> 2,设置退回的节点如果是当前节点下一步骤的节点,设置无意义,系统不做检查,退回时才做检查。");
        }
Example #15
0
        public DataTable GetTable()
        {
            if (this.ToNode == 0)
            {
                throw new Exception("@流程设计错误,没有转向的节点。举例说明: 当前是A节点。如果您在A点的属性里启用了[接受人]按钮,那么他的转向节点集合中(就是A可以转到的节点集合比如:A到B,A到C, 那么B,C节点就是转向节点集合),必须有一个节点是的节点属性的[访问规则]设置为[由上一步发送人员选择]");
            }

            NodeStations stas = new NodeStations(this.ToNode);

            if (stas.Count == 0)
            {
                BP.WF.Node toNd = new BP.WF.Node(this.ToNode);
                throw new Exception("@流程设计错误:设计员没有设计节点[" + toNd.Name + "],接受人的岗位范围。");
            }

            string    BindByStationSql = "";
            string    DdlEmpSql        = "";
            string    ParSql           = "select No from Port_Dept where ParentNo='0'";
            DataTable ParDt            = DBAccess.RunSQLReturnTable(ParSql);

            BindByStationSql = string.Format("select No,Name,ParentNo,'1' IsParent from Port_Dept where ParentNo='0' union" +
                                             " select No,Name,b.FK_Station as ParentNo,'0' IsParent  from Port_Emp a inner" +
                                             " join " + BP.WF.Glo.EmpStation + " b on a.No=b.FK_Emp and b.FK_Station in" +
                                             " (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node='{0}')  WHERE No in" +
                                             "  (SELECT FK_EMP FROM " + BP.WF.Glo.EmpStation + " " +
                                             " WHERE FK_STATION IN (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node='{0}'))" +
                                             " AND No IN (SELECT FK_Emp FROM Port_EmpDept) " +
                                             " union select No,Name,'{2}' ParentNo,'1' IsParent  from Port_Station where no " +
                                             "in(SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node='{0}')", ToNode, WebUser.FK_Dept, ParDt.Rows[0][0].ToString());

            DdlEmpSql = string.Format("select No,Name,b.FK_Station as ParentNo,'0' IsParent  from Port_Emp a inner" +
                                      " join " + BP.WF.Glo.EmpStation + " b on a.No=b.FK_Emp and b.FK_Station in" +
                                      " (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node='{0}')  WHERE No in" +
                                      "  (SELECT FK_EMP FROM " + BP.WF.Glo.EmpStation + " " +
                                      " WHERE FK_STATION IN (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node='{0}'))" +
                                      " AND No IN (SELECT FK_Emp FROM Port_EmpDept) ", ToNode, WebUser.FK_Dept, ParDt.Rows[0][0].ToString());


            if (BP.WF.Glo.OSModel == BP.Sys.OSModel.OneMore)
            {
                BindByStationSql = BindByStationSql.Replace("Port_EmpDept", "Port_DeptEmp");
                DdlEmpSql        = DdlEmpSql.Replace("Port_EmpDept", "Port_DeptEmp");
            }
            else
            {
                BindByStationSql = BindByStationSql.Replace("Port_DeptEmp", "Port_EmpDept");
                DdlEmpSql        = DdlEmpSql.Replace("Port_DeptEmp", "Port_EmpDept");

                BindByStationSql = BindByStationSql.Replace("Port_DeptEmpStation", "Port_EmpSTATION");
                DdlEmpSql        = DdlEmpSql.Replace("Port_DeptEmpStation", "Port_EmpSTATION");
            }

            DdlEmpDt = DBAccess.RunSQLReturnTable(DdlEmpSql);
            return(DBAccess.RunSQLReturnTable(BindByStationSql));
        }
        void btn_Click(object sender, EventArgs e)
        {
            Listen li = new Listen();

            if (this.RefOID != 0)
            {
                li.OID = this.RefOID;
                li.Retrieve();
            }

            li     = this.Pub1.Copy(li) as Listen;
            li.OID = this.RefOID;

            BP.WF.Node  nd   = new BP.WF.Node(this.FK_Node);
            BP.WF.Nodes nds  = new BP.WF.Nodes(nd.FK_Flow);
            string      strs = "";

            foreach (BP.WF.Node en in nds)
            {
                if (en.NodeID == this.FK_Node)
                {
                    continue;
                }

                CheckBox cb = this.Pub1.GetCBByID("CB_" + en.NodeID);
                if (cb.Checked)
                {
                    strs += "@" + en.NodeID;
                }
            }

            li.Nodes   = strs;
            li.FK_Node = this.FK_Node;

            if (li.OID == 0)
            {
                li.Insert();
            }
            else
            {
                li.Update();
            }

            var btn = (LinkBtn)sender;

            if (btn.ID == NamesOfBtn.Save)
            {
                this.Response.Redirect("Listen.aspx?FK_Node=" + this.FK_Node + "&DoType=New&RefOID=" + li.OID, true);
            }
            else
            {
                this.Response.Redirect("Listen.aspx?FK_Node=" + this.FK_Node + "&DoType=New&RefOID=0", true);
            }
        }
Example #17
0
        /// <summary>
        /// 删除流程
        /// </summary>
        public string Delcase()
        {
            string flowId  = getUTF8ToString("flowId");
            int    fk_Node = Int32.Parse(getUTF8ToString("nodeId"));
            long   workID  = Int64.Parse(getUTF8ToString("workId"));
            long   fId     = Int64.Parse(getUTF8ToString("fId"));

            BP.WF.Node currND = new BP.WF.Node(fk_Node);

            return(BP.WF.Dev2Interface.Flow_DoDeleteFlowByReal(flowId, workID, false));
        }
Example #18
0
 /// <summary>
 /// 09.与指定节点处理人相同 取值
 /// 12.按指定节点的人员岗位计算
 /// </summary>
 public void bindCBL()
 {
     BP.WF.Node nd = new BP.WF.Node(this.NodeID);
     this.CBL_BySpecNodeEmp.Items.Clear();
     this.CBL_BySpecNodeEmpStation.Items.Clear();
     BP.WF.Nodes nds = new BP.WF.Nodes(nd.HisFlow.No);
     foreach (BP.WF.Node item in nds)
     {
         this.CBL_BySpecNodeEmp.Items.Add(new ListItem(item.NodeID + " " + item.Name, item.NodeID.ToString()));
         this.CBL_BySpecNodeEmpStation.Items.Add(new ListItem(item.NodeID + " " + item.Name, item.NodeID.ToString()));
     }
 }
Example #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 退回流程.
            this.ToolBar1.Add("<input class=Btn type=button onclick=\"javascript:window.location.href='ReturnWork.aspx?FromUrl=FHLFlow&WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&FID=" + this.FID + "'\" value='退回' >");

            // 关闭.
            this.ToolBar1.AddBtn("Btn_Close", "关闭");
            this.Btn_Close.OnClientClick = "window.close();";

            //this.Btn_Del.OnClientClick = "return confirm('are you sure?')";
            //this.Btn_Del.Click += new EventHandler(Btn_Del_Click);

            GenerWorkFlow gwf = new GenerWorkFlow(this.FID);
            WorkFlow      wf  = new WorkFlow(this.FK_Flow, this.FID);
            WorkNode      wn  = new WorkNode(this.FID, gwf.FK_Node);

            WorkNode wnPri = wn.GetPreviousWorkNode_FHL(this.WorkID); // 他的上一个节点.

            BP.WF.Node ndPri = wnPri.HisNode;
            try
            {
                //根据不同的表单类型展示不同的表单.
                if (ndPri.HisFormType == NodeFormType.FixForm)
                {
                    this.UCEn1.BindColumn4(wnPri.HisWork, "ND" + wnPri.HisNode.NodeID);
                    this.UCEn1.Add(wnPri.HisWork.WorkEndInfo);
                }
                else if (ndPri.HisFormType == NodeFormType.FreeForm)
                {
                    this.UCEn1.BindCCForm(wnPri.HisWork, "ND" + wnPri.HisNode.NodeID, true, 0, false);
                }
                else if (ndPri.HisFormType == NodeFormType.SDKForm)
                {
                    string url = "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + ndPri.NodeID + "&WorkID=" + this.WorkID + "&FID=" + this.FID;

                    string src = ndPri.FormUrl;
                    if (src.Contains("?"))
                    {
                        src = src + "&IsReadonly=1&FK" + url;
                    }
                    else
                    {
                        src = src + "?1=2&IsReadonly=1" + url;
                    }
                    this.Add("<iframe ID='Ff' src='" + src + "' frameborder=0  style='width:100%; height:900px;text-align: left;'  leftMargin='0'  topMargin='0' scrolling=auto />");
                    this.Add("</iframe>");
                }
            }
            catch
            {
                this.WinCloseWithMsg("此工作已经终止或者被删除。");
            }
        }
Example #20
0
        void btn_SaveFlowFrms_Click(object sender, EventArgs e)
        {
            FrmNodes fns = new FrmNodes(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 = nd.FK_Flow;
                fn.FK_Node = this.FK_Node;
                fn.Save();
            }
            this.Response.Redirect("FlowFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node, true);
        }
Example #21
0
        public DataTable GetTable()
        {
            if (this.MyToNode == 0)
            {
                throw new Exception("@流程设计错误,没有转向的节点。举例说明: 当前是A节点。如果您在A点的属性里启用了[接受人]按钮,那么他的转向节点集合中(就是A可以转到的节点集合比如:A到B,A到C, 那么B,C节点就是转向节点集合),必须有一个节点是的节点属性的[访问规则]设置为[由上一步发送人员选择]");
            }

            NodeStations stas = new NodeStations(this.MyToNode);

            if (stas.Count == 0)
            {
                BP.WF.Node toNd = new BP.WF.Node(this.MyToNode);
                throw new Exception("@流程设计错误:设计员没有设计节点[" + toNd.Name + "],接受人的岗位范围。");
            }

            string sql = "";

            if (this.Request.QueryString["IsNextDept"] != null)
            {
                int len = this.FK_Dept.Length + 2;

                string sqlDept = "SELECT No FROM Port_Dept WHERE " + BP.SystemConfig.AppCenterDBLengthStr + "(No)=" + len + " AND No LIKE '" + this.FK_Dept + "%'";
                sql  = "SELECT A.No,A.Name, A.FK_Dept, B.Name as DeptName FROM Port_Emp A,Port_Dept B WHERE A.FK_Dept=B.No AND a.NO IN ( ";
                sql += "SELECT FK_EMP FROM Port_EmpSTATION WHERE FK_STATION ";
                sql += "IN (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node=" + MyToNode + ") ";
                sql += ") AND A.No IN( SELECT No FROM Port_Emp WHERE  " + BP.SystemConfig.AppCenterDBLengthStr + "(FK_Dept)=" + len + " AND FK_Dept LIKE '" + this.FK_Dept + "%')";
                sql += " ORDER BY FK_DEPT ";
                return(BP.DA.DBAccess.RunSQLReturnTable(sql));
            }


            // 优先解决本部门的问题。
            if (this.FK_Dept == WebUser.FK_Dept)
            {
                sql  = "SELECT A.No,A.Name, A.FK_Dept, B.Name as DeptName FROM Port_Emp A,Port_Dept B WHERE A.FK_Dept=B.No AND a.NO IN ( ";
                sql += "SELECT FK_EMP FROM Port_EmpSTATION WHERE FK_STATION ";
                sql += "IN (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node=" + MyToNode + ") ";
                sql += ") AND a.No IN (SELECT FK_Emp FROM Port_EmpDept WHERE FK_Dept ='" + WebUser.FK_Dept + "')";
                sql += " ORDER BY FK_DEPT ";
                DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    return(dt);
                }
            }

            sql  = "SELECT A.No,A.Name, A.FK_Dept, B.Name as DeptName FROM Port_Emp A,Port_Dept B WHERE A.FK_Dept=B.No AND a.NO IN ( ";
            sql += "SELECT FK_EMP FROM Port_EmpSTATION WHERE FK_STATION ";
            sql += "IN (SELECT FK_STATION FROM WF_NodeStation WHERE FK_Node=" + MyToNode + ") ";
            sql += ") ORDER BY FK_DEPT ";
            return(BP.DA.DBAccess.RunSQLReturnTable(sql));
        }
Example #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Node mynd = new BP.WF.Node();
            mynd.NodeID = this.FK_Node;
            mynd.RetrieveFromDBSources();

            this.Pub1.AddTable("width='100%'");
            this.Pub1.AddCaptionLeft("为“" + mynd.Name + "”, 设置可撤销的节点。");

            NodeCancels rnds = new NodeCancels();

            rnds.Retrieve(NodeCancelAttr.FK_Node, this.FK_Node);

            BP.WF.Nodes nds = new Nodes();
            nds.Retrieve(BP.WF.Template.NodeAttr.FK_Flow, this.FK_Flow);
            int idx = 0;

            foreach (BP.WF.Node nd in nds)
            {
                if (nd.NodeID == this.FK_Node)
                {
                    continue;
                }

                CheckBox cb = new CheckBox();
                cb.Text    = nd.Name;
                cb.ID      = "CB_" + nd.NodeID;
                cb.Checked = rnds.IsExits(NodeCancelAttr.CancelTo, nd.NodeID);

                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx++);
                this.Pub1.AddTD("第" + nd.Step + "步");
                this.Pub1.AddTD(cb);
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTRSum();
            this.Pub1.AddTD();
            Button btn = new Button();

            btn.Text     = "保存";
            btn.CssClass = "Btn";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.AddTD(btn);
            this.Pub1.AddTD();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            this.Pub1.AddFieldSet("特别说明:", "1,只有节点属性的撤销规则被设置成撤销制订的节点,此功能才有效。<br> 2,设置撤销的节点如果是当前节点下一步骤的节点,设置无意义,系统不做检查,撤销时才做检查。");
        }
Example #23
0
        public void BindCopy()
        {
            FrmNodes fns = new FrmNodes();

            fns.Retrieve(FrmNodeAttr.FK_Flow, this.FK_Flow, FrmNodeAttr.FK_Frm, this.FK_MapData);

            bool isHave = false;

            this.Pub2.AddHR();
            this.Pub2.AddH3("点击选择要copy的节点.");
            this.Pub2.AddUL();
            foreach (FrmNode fn in fns)
            {
                if (fn.FK_Frm != this.FK_MapData)
                {
                    continue;
                }

                if (fn.FK_Node.ToString() == this.FK_Node)
                {
                    continue;
                }

                if (fn.FrmSln == 0)
                {
                    continue;
                }

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

                string lab = "第" + nd.Step + "步:" + nd.NodeID + " - " + nd.Name;
                this.Pub2.AddLi("<a href='Sln.aspx?FK_MapData=" + this.FK_MapData + "&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&DoType=DoCopy&FromNode=" + fn.FK_Node + "' >" + lab + "</a>");
                isHave = true;
            }
            this.Pub2.AddULEnd();

            this.Pub2.AddFieldSet("执行须知");
            this.Pub2.AddUL();
            this.Pub2.AddLi("1, 您将要执行权限方案的copy, 如果copy成功系统将会把您指定的该表单上的定义权限完全copy到当前节点上来.");
            this.Pub2.AddLi("2, copy到现在节点的权限包括:附件、字段、明细表.");
            this.Pub2.AddLi("3, copy到将执行覆盖操作,以前的设置将会被删除重新覆盖.");
            this.Pub2.AddLi("4, 其他表单的权限,之后同表单,并且权限方案为自定义,才能被列出来。");
            this.Pub2.AddULEnd();
            this.Pub2.AddFieldSetEnd();

            if (isHave == false)
            {
                this.Pub2.AddFieldSet("提示", " <font color=red>没有对应的表单绑定</font>.");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Node mynd = new BP.WF.Node(this.FK_Node);
            if (mynd.IsStartNode)
            {
                this.Pub1.AddMsgOfWarning("提示:", "在开始节点设置此属性没有意义。");
                return;
            }

            Nodes nds = new Nodes(this.FK_Flow);

            this.Title = "请选择节点(" + mynd.Name + ")底部显示的表单";

            this.Pub1.AddTable("width='100%'");
            this.Pub1.AddCaptionLeft("请设置显示在此表单下放的表单");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("步骤");
            this.Pub1.AddTDTitle("节点名称(注意选择此节点以后的节点无效)");
            this.Pub1.AddTREnd();

            foreach (BP.WF.Node nd in nds)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD(nd.Step);
                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + nd.NodeID;
                cb.Text = nd.Name;

                if (mynd.ShowSheets.Contains("@" + nd.NodeID) == true)
                {
                    cb.Checked = true;
                }

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

            this.Pub1.AddTRSum();
            this.Pub1.AddTD();
            Button btn = new Button();

            btn.CssClass = "Btn";
            btn.ID       = "Btn_Save";
            btn.Text     = "保存";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.AddTD(btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Example #25
0
        public void BindTimesND()
        {
            int nodeid = int.Parse(this.Request.QueryString["FK_Node"]);

            BP.WF.Node nd = new BP.WF.Node(nodeid);
            this.AddTable();
            this.AddCaptionLeft("<a href='" + this.PageID + ".aspx?DoType=Times&FK_Flow=" + nd.FK_Flow + "'>" + nd.FlowName + "</a> => " + nd.Name);
            this.AddTR();
            this.AddTDTitle("IDX");
            this.AddTDTitle("人员");
            this.AddTDTitle("Average time");
            this.AddTDTitle("Participation times");
            this.AddTREnd();
            this.AddTableEnd();
        }
        void btn_Save_Node_Click(object sender, EventArgs e)
        {
            TurnTo cond = new TurnTo();

            BP.WF.Node nd = new BP.WF.Node(this.FK_NodeInt);
            cond.FK_Flow        = nd.FK_Flow;
            cond.FK_Node        = this.FK_NodeInt;
            cond.FK_Attr        = this.DDL_Attr.SelectedItemStringVal;
            cond.FK_Operator    = this.DDL_Oper.SelectedItemStringVal;
            cond.OperatorValue  = this.GetOperVal;
            cond.OperatorValueT = this.GetOperValText;
            cond.TurnToURL      = this.Pub1.GetTextBoxByID("TB_TurnToURL").Text;
            cond.MyPK           = this.FK_Node + "_" + this.FK_Attr + "_" + cond.FK_OperatorExt + "_" + cond.OperatorValue;
            cond.Save();
            this.Response.Redirect("TurnTo.aspx?FK_Node=" + this.FK_Node + "&FK_Attr=" + cond.FK_Attr + "&MyPK=" + cond.MyPK, true);
            return;
        }
Example #27
0
        /// <summary>
        /// 修改节点名称
        /// </summary>
        /// <returns></returns>
        public string Node_EditNodeName()
        {
            string FK_Node  = this.GetValFromFrmByKey("NodeID");
            string NodeName = System.Web.HttpContext.Current.Server.UrlDecode(this.GetValFromFrmByKey("NodeName"));

            BP.WF.Node node = new BP.WF.Node();
            node.NodeID = int.Parse(FK_Node);
            int iResult = node.RetrieveFromDBSources();

            if (iResult > 0)
            {
                node.Name = NodeName;
                node.Update();
                return("@修改成功.");
            }

            return("err@修改节点失败,请确认该节点是否存在?");
        }
Example #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            this.Pub1.AddTable();
            this.Pub1.AddCaption("抄送规则");

            this.Pub1.AddTR();
            this.Pub1.AddTD("标题");
            TB tb = new TB();

            tb.Text = ""; // nd.HisCCRole;
            tb.ID   = "TB_Title";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTableEnd();
        }
Example #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);
            Work       wk = nd.HisWork;

            wk.OID = this.WorkID;
            wk.RetrieveFromDBSources();

            this.UCEn1.IsReadonly = true;
            if (nd.HisFormType == NodeFormType.FreeForm)
            {
                this.UCEn1.BindCCForm(wk, "ND" + wk.NodeID, true, 0, false);
            }
            else
            {
                this.UCEn1.IsReadonly = true;
                this.UCEn1.BindColumn4(wk, "ND" + wk.NodeID);
            }
        }
        /// <summary>
        /// 获取节点
        /// </summary>
        /// <returns></returns>
        private string GetDeliveryNodes()
        {
            BP.WF.Node       nd   = new BP.WF.Node(this.FK_Node);
            string           sql  = "SELECT NodeID,Name FROM WF_Node WHERE FK_Flow='" + nd.FK_Flow + "' AND DeliveryWay=" + (int)DeliveryWay.BySelected + " AND DeliveryParas LIKE '%" + nd.NodeID + "%' order by Step";
            DataTable        dt   = DBAccess.RunSQLReturnTable(sql);
            GenerWorkerLists gwls = new GenerWorkerLists(this.WorkID);

            //Flow fl = new Flow(nd.FK_Flow);
            //GERpt rpt = fl.HisGERpt;
            //rpt.OID = this.WorkID;
            //rpt.RetrieveFromDBSources();
            StringBuilder append = new StringBuilder();

            append.Append("[");
            foreach (DataRow dr in dt.Rows)
            {
                BP.WF.Node mynd = new BP.WF.Node(int.Parse(dr["NodeID"].ToString()));
                if (mynd.IsStartNode)
                {
                    continue;
                }

                if (gwls.IsExits(GenerWorkerListAttr.FK_Node, mynd.NodeID) == true)
                {
                    continue;
                }

                if (append.Length > 1)
                {
                    append.Append(",");
                }

                append.Append("{NodeID:'" + dr["NodeID"] + "',Name:'" + dr["Name"] + "'}");

                if (mynd.HisCCRole != CCRole.UnCC)
                {
                    /*是可以抄送的*/
                    append.Append(",{NodeID:'" + dr["NodeID"] + "_CC',Name:'阅办'}");
                }
            }
            append.Append("]");
            return(append.ToString());
        }