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>."); } }
public void BindList() { string text = ""; BP.WF.Node nd = new BP.WF.Node(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 就增加上. string tfModel = SystemConfig.AppSettings["TreeFrmModel"]; this.Pub1.AddTable("width=100%"); this.Pub1.AddCaption("设置节点:(" + nd.Name + ")绑定表单"); this.Pub1.AddTR(); this.Pub1.AddTDTitle("Idx"); this.Pub1.AddTDTitle("表单编号"); this.Pub1.AddTDTitle("名称"); if (tfModel == "1") { this.Pub1.AddTDTitle("关键字段"); } this.Pub1.AddTDTitle("启用规则"); // this.Pub1.AddTDTitle("可编辑否?"); this.Pub1.AddTDTitle("可打印否?"); this.Pub1.AddTDTitle("是否启用<br>装载填充事件"); this.Pub1.AddTDTitle("权限控制<br>方案"); this.Pub1.AddTDTitle("表单元素<br>自定义设置"); this.Pub1.AddTDTitle("谁是主键?"); this.Pub1.AddTDTitle("文件模版"); if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL) { this.Pub1.AddTDTitle("是否1变N"); //add by zhoupeng 2016.03.25 for hainan. } if (nd.HisRunModel == RunModel.SubThread) { this.Pub1.AddTDTitle("数据汇总"); //add by zhoupeng 2016.03.25 for hainan. } this.Pub1.AddTDTitle("顺序"); this.Pub1.AddTDTitle(""); this.Pub1.AddTDTitle(""); this.Pub1.AddTREnd(); int idx = 1; foreach (FrmNode fn in fns) { MapData md = new MapData(); md.No = fn.FK_Frm; if (md.RetrieveFromDBSources() == 0) { fn.Delete(); //说明该表单不存在了,就需要把这个删除掉. continue; } this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD(fn.FK_Frm); if (fn.FK_Frm == "ND" + this.FK_Node) { this.Pub1.AddTDB("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>"); } else { this.Pub1.AddTD("<a href=\"javascript:WinOpen('../MapDef/CCForm/Frm.aspx?FK_MapData=" + md.No + "&FK_Flow=" + this.FK_Flow + "');\" >" + md.Name + "</a>"); } DDL ddl = new DDL(); //获取当前独立表单中的所有字段 add by 海南 zqp if (tfModel == "1") { //获取它的字段集合 MapAttrs attrs = new MapAttrs(); attrs.Retrieve(MapAttrAttr.FK_MapData, md.No); MapAttrs attrNs = new MapAttrs(); //去掉一些基础字段 foreach (MapAttr attr in attrs) { switch (attr.KeyOfEn) { case "Title": case "FK_Emp": case "MyNum": case "FK_NY": case WorkAttr.Emps: case WorkAttr.OID: case StartWorkAttr.Rec: case StartWorkAttr.FID: continue; default: break; } attrNs.AddEntity(attr); } //添加到页面中 DDL myddl = new DDL(); myddl.ID = "DDL_Attr_" + md.No; myddl.BindEntities(attrNs, MapAttrAttr.KeyOfEn, MapAttrAttr.Name); myddl.SetSelectItem(fn.GuanJianZiDuan); this.Pub1.AddTD(myddl); } //为了扩充的需要,把下拉框的模式去掉了. //ddl = new DDL(); //ddl.ID = "DDL_FrmEnableRole_" + md.No; //ddl.Items.Add(new ListItem("始终启用", "0")); //ddl.Items.Add(new ListItem("有数据时启用", "1")); //ddl.Items.Add(new ListItem("有参数时启用", "2")); //ddl.Items.Add(new ListItem("按表单字段条件", "3")); //ddl.Items.Add(new ListItem("按SQL表达式", "4")); //ddl.SetSelectItem(fn.FrmEnableRoleInt); //设置权限控制方案. //this.Pub1.AddTD(ddl); this.Pub1.AddTD("<a href=\"javascript:WinOpen('./FlowFrm/FrmEnableRole.aspx?FK_Node=" + fn.FK_Node + "&FK_MapData=" + fn.FK_Frm + "')\">设置(" + fn.FrmEnableRoleText + ")</a>"); CheckBox cb = new CheckBox(); //cb.ID = "CB_IsEdit_" + md.No; //cb.Text = "可编辑否?"; //cb.Checked = fn.IsEdit; //this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_IsPrint_" + md.No; cb.Text = "打印否?"; cb.Checked = fn.IsPrint; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_IsEnableLoadData_" + md.No; cb.Text = "启用否?"; cb.Checked = fn.IsEnableLoadData; this.Pub1.AddTD(cb); ddl = new DDL(); ddl.ID = "DDL_Sln_" + md.No; ddl.Items.Add(new ListItem("默认方案", "0")); ddl.Items.Add(new ListItem("自定义", this.FK_Node.ToString())); ddl.Items.Add(new ListItem("不可编辑", "1")); //让其不可编辑. ddl.SetSelectItem(fn.FrmSln); //设置权限控制方案. this.Pub1.AddTD(ddl); this.Pub1.AddTDBegin(); this.Pub1.Add("<a href=\"javascript:WinField('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >字段</a>"); this.Pub1.Add("-<a href=\"javascript:WinFJ('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >附件</a>"); this.Pub1.Add("-<a href=\"javascript:WinDtl('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >从表</a>"); if (md.HisFrmType == FrmType.ExcelFrm) { this.Pub1.Add("-<a href=\"javascript:ToolbarExcel('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarExcel</a>"); } if (md.HisFrmType == FrmType.WordFrm) { this.Pub1.Add("-<a href=\"javascript:ToolbarWord('" + md.No + "','" + this.FK_Node + "','" + this.FK_Flow + "')\" >ToolbarWord</a>"); } this.Pub1.AddTDEnd(); ddl = new DDL(); ddl.ID = "DDL_WhoIsPK_" + md.No; ddl.BindSysEnum("WhoIsPK"); ddl.SetSelectItem((int)fn.WhoIsPK); //谁是主键?. this.Pub1.AddTD(ddl); if (md.HisFrmType == FrmType.ExcelFrm || md.HisFrmType == FrmType.WordFrm) { ddl = new DDL(); ddl.ID = "DDL_File_" + md.No; string[] files = System.IO.Directory.GetFiles(BP.Sys.SystemConfig.PathOfDataUser + "\\FrmOfficeTemplate\\", md.No + "*.xls"); foreach (string str in files) { //System.IO.FileInfo info=new System.IO.FileInfo( ddl.Items.Add(new ListItem(str.Substring(str.LastIndexOf(md.No)), str)); } this.Pub1.AddTD(ddl); } else { this.Pub1.AddTD("无效"); } if (nd.HisRunModel == RunModel.FL || nd.HisRunModel == RunModel.FHL) { cb = new CheckBox(); cb.ID = "CB_Is1ToN_" + md.No; cb.Text = "是否1变N?"; cb.Checked = fn.Is1ToN; this.Pub1.AddTD(cb);//add by zhoupeng 2016.03.25 for hainan. } if (nd.HisRunModel == RunModel.SubThread) { ddl = new DDL(); ddl.ID = "DDL_HuiZong_" + md.No; ddl.Items.Add(new ListItem("不汇总数据", "0")); BP.WF.Template.FrmNodes myfns = new FrmNodes(); myfns.Retrieve(FrmNodeAttr.FK_Flow, nd.FK_Flow); //组合这个字符串. string strs = ";" + fn.FK_Frm + ";"; foreach (BP.WF.Template.FrmNode myfrn in myfns) { if (strs.Contains(";" + myfrn.FK_Frm + ";") == true) { continue; } strs += ";" + myfrn.FK_Frm + ";"; //检查该frm 是否有dtl. MapDtls dtls = new MapDtls(myfrn.FK_Frm); if (dtls.Count == 0) { continue; } foreach (MapDtl dtl in dtls) { ddl.Items.Add(new ListItem("汇总到:" + myfrn.HisFrm.Name + "-" + dtl.Name, myfrn.HisFrm.No + "@" + dtl.No)); } } ddl.SetSelectItem(fn.HuiZong); //设置汇总.. this.Pub1.AddTD(ddl); } TextBox tb = new TextBox(); tb.ID = "TB_Idx_" + md.No; tb.Text = fn.Idx.ToString(); tb.Columns = 5; this.Pub1.AddTD(tb); this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Up", "上移"); this.Pub1.AddTDA("BindFrms.aspx?ShowType=EditPowerOrder&FK_Node=" + this.FK_Node + "&FK_Flow=" + this.FK_Flow + "&MyPK=" + fn.MyPK + "&DoType=Down", "下移"); this.Pub1.AddTREnd(); } this.Pub1.AddTableEnd(); text = "<input type=button onclick=\"javascript:BindFrms('" + this.FK_Node + "','" + this.FK_Flow + "');\" value='修改表单绑定' class=Btn />"; this.Pub1.Add(text); Button btn = new Button(); btn.ID = "Save"; btn.Text = "保存"; btn.CssClass = "Btn"; btn.Click += new EventHandler(btn_SavePowerOrders_Click); this.Pub1.Add(btn); text = "<input type=button onclick=\"javascript:window.close();\" value='关闭' class=Btn />"; this.Pub1.Add(text); }
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(); }