Example #1
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 #2
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 #3
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 #4
0
        /// <summary>
        /// 根据节点编号删除流程节点
        /// </summary>
        /// <returns>执行结果</returns>
        public string DeleteNode()
        {
            try
            {
                BP.WF.Node node = new BP.WF.Node();
                node.NodeID = this.FK_Node;
                if (node.RetrieveFromDBSources() == 0)
                {
                    return("err@删除失败,没有删除到数据,估计该节点已经别删除了.");
                }

                if (node.IsStartNode == true)
                {
                    return("err@开始节点不允许被删除。");
                }

                node.Delete();
                return("删除成功.");
            }
            catch (Exception ex)
            {
                return("err@" + ex.Message);
            }
        }
Example #5
0
        private void InitOffice(bool isMenu)
        {
            bool isCompleate = false;

            BP.WF.Node node = new BP.WF.Node();
            node.NodeID = int.Parse(this.FK_Node);
            node.RetrieveFromDBSources();
            try
            {
                WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal));
                isCompleate = workFlow.IsComplete;
            }
            catch (Exception)
            {
                try
                {
                    Flow  fl  = new Flow(node.FK_Flow);
                    GERpt rpt = fl.HisGERpt;
                    rpt.OID = Int64.Parse(PKVal);
                    rpt.Retrieve();

                    if (rpt != null)
                    {
                        if (rpt.WFState == WFState.Complete)
                        {
                            isCompleate = true;
                        }
                    }
                }
                catch
                {
                }
            }
            if (!isCompleate)
            {
                try
                {
                    isCompleate = !BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(node.FK_Flow, node.NodeID, Int64.Parse(PKVal), WebUser.No);
                    //WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal));
                    //isCompleate = !workFlow.IsCanDoCurrentWork(WebUser.No);
                }
                catch
                {
                }
            }

            FrmAttachment attachment = new FrmAttachment();
            int           result     = 0;

            //表单编号与节点不为空
            if (this.FK_MapData != null && this.FK_Node != null)
            {
                BP.En.QueryObject objInfo = new BP.En.QueryObject(attachment);
                objInfo.AddWhere(FrmAttachmentAttr.FK_MapData, this.FK_MapData);
                objInfo.addAnd();
                objInfo.AddWhere(FrmAttachmentAttr.FK_Node, this.FK_Node);
                objInfo.addAnd();
                objInfo.AddWhere(FrmAttachmentAttr.NoOfObj, this.NoOfObj);
                result = objInfo.DoQuery();
                //result = attachment.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData,
                //                            FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.DelPKVal);
            }
            if (result == 0) /*如果没有定义,就获取默认的.*/
            {
                attachment.MyPK = this.FK_FrmAttachment;
                attachment.Retrieve();
            }
            if (!isCompleate)
            {
                if (attachment.IsWoEnableReadonly)
                {
                    ReadOnly = true;
                }
                if (attachment.IsWoEnableCheck)
                {
                    IsCheck = true;
                }
                IsMarks = attachment.IsWoEnableMarks;
            }
            else
            {
                if (attachment.IsWoEnableReadonly)
                {
                    ReadOnly = true;
                }
            }
            if (isMenu && !isCompleate)
            {
                #region 初始化按钮
                if (attachment.IsWoEnableViewKeepMark)
                {
                    divMenu.InnerHtml = "<select id='marks' onchange='ShowUserName()'  style='width: 100px'><option value='1'>显示留痕</option><option value='2'>隐藏留痕</option><select>";
                }

                if (attachment.IsWoEnableTemplete)
                {
                    AddBtn("openTempLate", "打开模板", "OpenTempLate");
                }
                if (attachment.IsWoEnableSave)
                {
                    AddBtn("saveFile", "保存", "saveOffice");
                }
                if (attachment.IsWoEnableRevise)
                {
                    AddBtn("accept", "接受修订", "acceptOffice");
                    AddBtn("refuse", "拒绝修订", "refuseOffice");
                }

                if (attachment.IsWoEnableOver)
                {
                    AddBtn("over", "套红文件", "overOffice");
                }


                if (attachment.IsWoEnableSeal)
                {
                    AddBtn("seal", "签章", "sealOffice");
                }
                if (attachment.IsWoEnableInsertFlow)
                {
                    AddBtn("flow", "插入流程图", "InsertFlow");
                }
                if (attachment.IsWoEnableInsertFlow)
                {
                    AddBtn("fegnxian", "插入风险点", "InsertFengXian");
                }

                #endregion
            }

            #region   初始化文件

            FrmAttachmentDB downDB = new FrmAttachmentDB();

            downDB.MyPK = this.DelPKVal;
            downDB.Retrieve();
            fileName.Text = downDB.FileName;
            fileType.Text = downDB.FileExts;
            RealFileName  = downDB.FileName;
            FileFullName  = downDB.FileFullName;
            FileSavePath  = attachment.SaveTo;

            #endregion
        }