/// <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()); }
/// <summary> /// 复制表单到节点 /// </summary> /// <returns></returns> public string BindFrmsDtl_DoCopyFrmToNodes() { string nodeStr = this.GetRequestVal("NodeStr"); //节点string, string frmStr = this.GetRequestVal("frmStr"); //表单string, string[] nodeList = nodeStr.Split(','); string[] frmList = frmStr.Split(','); foreach (string node in nodeList) { if (string.IsNullOrWhiteSpace(node)) { continue; } int nodeid = int.Parse(node); //删除节点绑定的表单 DBAccess.RunSQL("DELETE FROM WF_FrmNode WHERE FK_Node=" + nodeid); foreach (string frm in frmList) { if (string.IsNullOrWhiteSpace(frm)) { continue; } FrmNode fn = new FrmNode(); FrmNode frmNode = new FrmNode(); if (fn.IsExit("mypk", frm + "_" + this.FK_Node + "_" + this.FK_Flow)) { frmNode.Copy(fn); frmNode.MyPK = frm + "_" + nodeid + "_" + this.FK_Flow; frmNode.FK_Flow = this.FK_Flow; frmNode.FK_Node = nodeid; frmNode.FK_Frm = frm; } else { frmNode.MyPK = frm + "_" + nodeid + "_" + this.FK_Flow; frmNode.FK_Flow = this.FK_Flow; frmNode.FK_Node = nodeid; frmNode.FK_Frm = frm; } frmNode.Insert(); } } return("操作成功!"); }
void btn_SavePowerOrders_Click(object sender, EventArgs e) { //删除以前绑定的值. FrmNodes fnds = new FrmNodes(); fnds.Delete(FrmNodeAttr.FK_Flow, this.FK_Flow, FrmNodeAttr.FK_Frm, this.FK_MapData); FrmNode fn = null; foreach (Node nd in nds) { //节点没有选中,后面的明细项目选中也不执行保存 bool isCheckCurNd = this.Pub1.GetCBByID("CB_NodeName_" + nd.NodeID.ToString()).Checked; if (!isCheckCurNd) { continue; } fn = new FrmNode(); // fn.IsEdit = this.Pub1.GetCBByID("CB_IsEdit_" + nd.NodeID.ToString()).Checked; fn.IsPrint = this.Pub1.GetCBByID("CB_IsPrint_" + nd.NodeID.ToString()).Checked; //是否启 fn.IsEnableLoadData = this.Pub1.GetCBByID("CB_IsEnableLoadData_" + nd.NodeID.ToString()).Checked; //权限控制方案. fn.FrmSln = this.Pub1.GetDDLByID("DDL_Sln_" + nd.NodeID.ToString()).SelectedItemIntVal; fn.WhoIsPK = (WhoIsPK)this.Pub1.GetDDLByID("DDL_WhoIsPK_" + nd.NodeID.ToString()).SelectedItemIntVal; fn.FK_Flow = this.FK_Flow; fn.FK_Node = nd.NodeID; fn.FK_Frm = this.FK_MapData; fn.MyPK = fn.FK_Frm + "_" + fn.FK_Node + "_" + fn.FK_Flow; fn.Insert(); } this.Response.Redirect("BindingForms.aspx?FK_MapData=" + this.FK_MapData + "&FK_Flow=" + this.FK_Flow); }
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); }
public string DoType(string dotype, string v1, string v2, string v3, string v4, string v5) { string sql = ""; try { switch (dotype) { case "CreateCheckGroup": string gKey = v1; string gName = v2; string enName1 = v3; MapAttr attrN = new MapAttr(); int i = attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_Note"); i += attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_Checker"); i += attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_RDT"); if (i > 0) { return("前缀已经使用:" + gKey + " , 请确认您是否增加了这个审核分组或者,请您更换其他的前缀。"); } GroupField gf = new GroupField(); gf.Lab = gName; gf.EnName = enName1; gf.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_Note"; attrN.Name = "审核意见"; attrN.MyDataType = DataType.AppString; attrN.UIContralType = UIContralType.TB; attrN.UIIsEnable = true; attrN.UIIsLine = true; attrN.MaxLen = 4000; attrN.GroupID = gf.OID; attrN.UIHeight = 23 * 3; attrN.IDX = 1; attrN.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_Checker"; attrN.Name = "审核人";// "审核人"; attrN.MyDataType = DataType.AppString; attrN.UIContralType = UIContralType.TB; attrN.MaxLen = 50; attrN.MinLen = 0; attrN.UIIsEnable = true; attrN.UIIsLine = false; attrN.DefVal = "@WebUser.Name"; attrN.UIIsEnable = false; attrN.GroupID = gf.OID; attrN.IsSigan = true; attrN.IDX = 2; attrN.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_RDT"; attrN.Name = "审核日期"; // "审核日期"; attrN.MyDataType = DataType.AppDateTime; attrN.UIContralType = UIContralType.TB; attrN.UIIsEnable = true; attrN.UIIsLine = false; attrN.DefVal = "@RDT"; attrN.UIIsEnable = false; attrN.GroupID = gf.OID; attrN.IDX = 3; attrN.Insert(); return(null); case "NewDtl": MapDtl dtlN = new MapDtl(); dtlN.No = v1; if (dtlN.RetrieveFromDBSources() != 0) { return("从表已存在"); } dtlN.Name = v1; dtlN.FK_MapData = v2; dtlN.PTable = v1; dtlN.Insert(); dtlN.IntMapAttrs(); return(null); case "DelM2M": MapM2M m2mDel = new MapM2M(); m2mDel.MyPK = v1; m2mDel.Delete(); //M2M m2mData = new M2M(); //m2mData.Delete(M2MAttr.FK_MapData, v1); return(null); case "NewAthM": // 新建 NewAthM. string fk_mapdataAth = v1; string athName = v2; BP.Sys.FrmAttachment athM = new FrmAttachment(); athM.MyPK = athName; if (athM.IsExits) { return("多选名称:" + athName + ",已经存在。"); } athM.X = float.Parse(v3); athM.Y = float.Parse(v4); athM.Name = "多文件上传"; athM.FK_MapData = fk_mapdataAth; athM.Insert(); return(null); case "NewM2M": string fk_mapdataM2M = v1; string m2mName = v2; MapM2M m2m = new MapM2M(); m2m.FK_MapData = v1; m2m.NoOfObj = v2; if (v3 == "0") { m2m.HisM2MType = M2MType.M2M; m2m.Name = "新建一对多"; } else { m2m.HisM2MType = M2MType.M2MM; m2m.Name = "新建一对多多"; } m2m.X = float.Parse(v4); m2m.Y = float.Parse(v5); m2m.MyPK = m2m.FK_MapData + "_" + m2m.NoOfObj; if (m2m.IsExits) { return("多选名称:" + m2mName + ",已经存在。"); } m2m.Insert(); return(null); case "DelEnum": // 检查这个物理表是否被使用。 sql = "SELECT * FROM Sys_MapAttr WHERE UIBindKey='" + v1 + "'"; DataTable dtEnum = DBAccess.RunSQLReturnTable(sql); string msgDelEnum = ""; foreach (DataRow dr in dtEnum.Rows) { msgDelEnum += "\n 表单编号:" + dr["FK_MapData"] + " , 字段:" + dr["KeyOfEn"] + ", 名称:" + dr["Name"]; } if (msgDelEnum != "") { return("该枚举已经被如下字段所引用,您不能删除它。" + msgDelEnum); } sql = "DELETE FROM Sys_EnumMain WHERE No='" + v1 + "'"; sql += "@DELETE FROM Sys_Enum WHERE EnumKey='" + v1 + "' "; DBAccess.RunSQLs(sql); return(null); case "DelSFTable": /* 删除自定义的物理表. */ // 检查这个物理表是否被使用。 sql = "SELECT * FROM Sys_MapAttr WHERE UIBindKey='" + v1 + "'"; DataTable dt = DBAccess.RunSQLReturnTable(sql); string msgDel = ""; foreach (DataRow dr in dt.Rows) { msgDel += "\n 表单编号:" + dr["FK_MapData"] + " , 字段:" + dr["KeyOfEn"] + ", 名称:" + dr["Name"]; } if (msgDel != "") { return("该数据表已经被如下字段所引用,您不能删除它。" + msgDel); } SFTable sfDel = new SFTable(); sfDel.No = v1; sfDel.DirectDelete(); return(null); case "SaveSFTable": string enName = v2; string chName = v1; if (string.IsNullOrEmpty(v1) || string.IsNullOrEmpty(v2)) { return("视图中的中英文名称不能为空。"); } SFTable sf = new SFTable(); sf.No = enName; sf.Name = chName; sf.No = enName; sf.Name = chName; sf.FK_Val = enName; sf.Save(); if (DBAccess.IsExitsObject(enName) == true) { /*已经存在此对象,检查一下是否有No,Name列。*/ sql = "SELECT No,Name FROM " + enName; try { DBAccess.RunSQLReturnTable(sql); } catch (Exception ex) { return("您指定的表或视图(" + enName + "),不包含No,Name两列,不符合ccflow约定的规则。技术信息:" + ex.Message); } return(null); } else { /*创建这个表,并且插入基础数据。*/ try { // 如果没有该表或者视图,就要创建它。 sql = "CREATE TABLE " + enName + "(No varchar(30) NOT NULL,Name varchar(50) NULL)"; DBAccess.RunSQL(sql); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('001','Item1')"); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('002','Item2')"); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('003','Item3')"); } catch (Exception ex) { sf.DirectDelete(); return("创建物理表期间出现错误,可能是非法的物理表名.技术信息:" + ex.Message); } } return(null); /*创建成功后返回空值*/ case "FrmTempleteExp": //导出表单. MapData mdfrmtem = new MapData(); mdfrmtem.No = v1; if (mdfrmtem.RetrieveFromDBSources() == 0) { if (v1.Contains("ND")) { int nodeId = int.Parse(v1.Replace("ND", "")); Node nd = new Node(nodeId); mdfrmtem.Name = nd.Name; mdfrmtem.PTable = v1; mdfrmtem.EnPK = "OID"; mdfrmtem.Insert(); } } DataSet ds = mdfrmtem.GenerHisDataSet(); string file = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Temp\\" + v1 + ".xml"; if (System.IO.File.Exists(file)) { System.IO.File.Delete(file); } ds.WriteXml(file); // BP.PubClass.DownloadFile(file, mdfrmtem.Name + ".xml"); //this.DownLoadFile(System.Web.HttpContext.Current, file, mdfrmtem.Name); return(null); case "FrmTempleteImp": //导入表单. DataSet dsImp = new DataSet(); string fileImp = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Temp\\" + v1 + ".xml"; dsImp.ReadXml(fileImp); //读取文件. MapData.ImpMapData(v1, dsImp, true); return(null); case "NewHidF": string fk_mapdataHid = v1; string key = v2; string name = v3; int dataType = int.Parse(v4); MapAttr mdHid = new MapAttr(); mdHid.MyPK = fk_mapdataHid + "_" + key; mdHid.FK_MapData = fk_mapdataHid; mdHid.KeyOfEn = key; mdHid.Name = name; mdHid.MyDataType = dataType; mdHid.HisEditType = EditType.Edit; mdHid.MaxLen = 100; mdHid.MinLen = 0; mdHid.LGType = FieldTypeS.Normal; mdHid.UIVisible = false; mdHid.UIIsEnable = false; mdHid.Insert(); return(null); case "DelDtl": MapDtl dtl = new MapDtl(v1); dtl.Delete(); return(null); case "DeleteFrm": string delFK_Frm = v1; MapData mdDel = new MapData(delFK_Frm); mdDel.Delete(); sql = "@DELETE FROM Sys_MapData WHERE No='" + delFK_Frm + "'"; sql = "@DELETE FROM WF_FrmNode WHERE FK_Frm='" + delFK_Frm + "'"; DBAccess.RunSQLs(sql); return(null); case "FrmUp": case "FrmDown": FrmNode myfn = new FrmNode(); myfn.Retrieve(FrmNodeAttr.FK_Node, v1, FrmNodeAttr.FK_Frm, v2); if (dotype == "FrmUp") { myfn.DoUp(); } else { myfn.DoDown(); } return(null); case "SaveFlowFrm": // 转化参数意义. string vals = v1; string fk_Node = v2; string fk_flow = v3; bool isPrint = false; if (v5 == "1") { isPrint = true; } bool isReadonly = false; if (v4 == "1") { isReadonly = true; } string msg = this.SaveEn(vals); if (msg.Contains("Error")) { return(msg); } string fk_frm = msg; Frm fm = new Frm(); fm.No = fk_frm; fm.Retrieve(); FrmNode fn = new FrmNode(); if (fn.Retrieve(FrmNodeAttr.FK_Frm, fk_frm, FrmNodeAttr.FK_Node, fk_Node) == 1) { fn.IsEdit = !isReadonly; fn.IsPrint = isPrint; fn.FK_Flow = fk_flow; fn.Update(); BP.DA.DBAccess.RunSQL("UPDATE Sys_MapData SET FK_FrmSort='01',AppType=1 WHERE No='" + fk_frm + "'"); return(fk_frm); } fn.FK_Frm = fk_frm; fn.FK_Flow = fk_flow; fn.FK_Node = int.Parse(fk_Node); fn.IsEdit = !isReadonly; fn.IsPrint = isPrint; fn.Idx = 100; fn.FK_Flow = fk_flow; fn.Insert(); MapData md = new MapData(); md.No = fm.No; if (md.RetrieveFromDBSources() == 0) { md.Name = fm.Name; md.EnPK = "OID"; md.Insert(); } MapAttr attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "OID"; attr.Name = "WorkID"; attr.MyDataType = BP.DA.DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "0"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "FID"; attr.Name = "FID"; attr.MyDataType = BP.DA.DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "0"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "RDT"; attr.Name = "记录日期"; attr.MyDataType = BP.DA.DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "@RDT"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); return(fk_frm); default: return("Error:" + dotype + " , 未设置此标记."); } } catch (Exception ex) { return("Error:" + ex.Message); } }