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); }
/// <summary> /// 保存流程表单 /// </summary> /// <returns></returns> public string BindFrmsDtl_Save() { try { string formNos = this.context.Request["formNos"]; FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node); //删除已经删除的。 foreach (FrmNode fn in fns) { if (formNos.Contains("," + fn.FK_Frm + ",") == false) { fn.Delete(); continue; } } // 增加集合中没有的。 string[] strs = formNos.Split(','); foreach (string s in strs) { if (DataType.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.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow; fn.Save(); } return("保存成功."); } catch (Exception ex) { return("err:保存失败." + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { #region 执行功能. if (this.IsPostBack == false) { switch (this.DoType) { case "Up": FrmNode fnU = new FrmNode(this.MyPK); fnU.DoUp(); break; case "Down": FrmNode fnD = new FrmNode(this.MyPK); fnD.DoDown(); break; case "DelFrm": FrmNodes fnsR = new FrmNodes(); if (fnsR.Retrieve(FrmNodeAttr.FK_Frm, this.FK_MapData) != 0) { this.Alert("此表单已经被多个流程节点(" + fnsR.Count + ")绑定,所以您不能删除它。"); } else { MapData md = new MapData(); md.No = this.FK_MapData; md.Delete(); } break; case "Del": FrmNodes fns = new FrmNodes(this.FK_Flow, this.FK_Node); foreach (FrmNode fn in fns) { if (fn.FK_Frm == this.FK_MapData) { fn.Delete(); break; } } break; case "Add": FrmNode fnN = new FrmNode(); fnN.FK_Frm = this.FK_MapData; fnN.FK_Node = this.FK_Node; fnN.FK_Flow = this.FK_Flow; fnN.Save(); break; default: break; } } #endregion 执行功能. switch (this.ShowType) { case "Frm": this.BindFrm(); this.Title = "表单"; break; case "FrmLib": case "FrmLab": this.BindFrmLib(); this.Title = "表单库"; break; case "FlowFrms": this.BindFlowFrms(); this.Title = "流程表单"; break; case "FrmSorts": this.BindFrmSorts(); this.Title = "流程类别"; break; case "EditPowerOrder": //编辑权限与顺序. this.BindEditPowerOrder(); break; default: break; } this.BindLeft(); }