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,设置退回的节点如果是当前节点下一步骤的节点,设置无意义,系统不做检查,退回时才做检查。"); }
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 + "”, 设置可退回的节点。"); NodeReturns rnds = new NodeReturns(); rnds.Retrieve(NodeReturnAttr.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(NodeReturnAttr.ReturnTo, 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.AddTableEndWithHR(); this.Pub1.AddFieldSet("特别说明:", "1,只有节点属性的退回规则被设置成退回制订的节点,此功能才有效。<br> 2,设置退回的节点如果是当前节点下一步骤的节点,设置无意义,系统不做检查,退回时才做检查。"); }
void btn_Click(object sender, EventArgs e) { NodeReturns rnds = new NodeReturns(); rnds.Delete(NodeReturnAttr.FK_Node, this.FK_Node); BP.WF.Nodes nds = new Nodes(); nds.Retrieve(BP.WF.Template.NodeAttr.FK_Flow, this.FK_Flow); int i = 0; foreach (BP.WF.Node nd in nds) { CheckBox cb = this.Pub1.GetCBByID("CB_" + nd.NodeID); if (cb == null) { continue; } if (cb.Checked == false) { continue; } NodeReturn nr = new NodeReturn(); nr.FK_Node = this.FK_Node; nr.ReturnTo = nd.NodeID; nr.Insert(); i++; } if (i == 0) { this.Alert("请您选择要退回的节点。"); return; } this.WinCloseWithMsg("设置成功"); }