public string StandAloneFrm_InitField() { //字段属性. MapAttr attr = new MapAttr(); attr.MyPK = this.FrmID + "_" + this.KeyOfEn; attr.Retrieve(); return(AttrCond(attr)); }
public string CondByFrm_InitField() { //字段属性. MapAttr attr = new MapAttr(); attr.MyPK = "ND" + int.Parse(this.FK_Flow) + "Rpt_" + this.KeyOfEn; attr.Retrieve(); return(AttrCond(attr)); }
/// <summary> /// 返回信息。 /// </summary> /// <returns></returns> public string RadioBtns_Init() { DataSet ds = new DataSet(); //放入表单字段. MapAttrs attrs = new MapAttrs(this.FK_MapData); ds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr")); //属性. MapAttr attr = new MapAttr(); attr.MyPK = this.FK_MapData + "_" + this.KeyOfEn; attr.Retrieve(); //把分组加入里面. GroupFields gfs = new GroupFields(this.FK_MapData); ds.Tables.Add(gfs.ToDataTableField("Sys_GroupFields")); //字段值. FrmRBs rbs = new FrmRBs(); rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn); if (rbs.Count == 0) { /*初始枚举值变化. */ SysEnums ses = new SysEnums(attr.UIBindKey); foreach (SysEnum se in ses) { FrmRB rb = new FrmRB(); rb.FK_MapData = this.FK_MapData; rb.KeyOfEn = this.KeyOfEn; rb.IntKey = se.IntKey; rb.Lab = se.Lab; rb.EnumKey = attr.UIBindKey; rb.Insert(); //插入数据. } rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn); } //加入单选按钮. ds.Tables.Add(rbs.ToDataTableField("Sys_FrmRB")); return(BP.Tools.Json.ToJson(ds)); }
/// <summary> /// 保存列的顺序名称. /// </summary> /// <returns></returns> public string S3ColsLabel_Save() { string orders = this.GetRequestVal("Orders"); //格式为 @KeyOfEn,Lable,idx 比如: @DianHua,电话,1@Addr,地址,2 string rptNo = this.GetRequestVal("RptNo"); string[] strs = orders.Split('@'); foreach (string item in strs) { if (DataType.IsNullOrEmpty(item) == true) { continue; } string[] vals = item.Split(','); string mypk = rptNo + "_" + vals[0]; MapAttr attr = new MapAttr(); attr.MyPK = mypk; attr.Retrieve(); attr.Name = vals[1]; attr.Idx = int.Parse(vals[2]); attr.Update(); //执行更新. } MapAttr myattr = new MapAttr(); myattr.MyPK = rptNo + "_OID"; myattr.RetrieveFromDBSources(); myattr.Idx = 200; myattr.Name = "工作ID"; myattr.Update(); myattr = new MapAttr(); myattr.MyPK = rptNo + "_Title"; myattr.RetrieveFromDBSources(); myattr.Idx = -100; myattr.Name = "标题"; myattr.Update(); return("保存成功.."); }
public void btn_Save_Click(object sender, EventArgs e) { try { Button btn = sender as Button; switch (btn.ID) { case "Btn_Del": MapAttr attrDel = new MapAttr(); attrDel.MyPK = this.RefNo; attrDel.Delete(); this.WinClose(); return; default: break; } MapAttr attr = new MapAttr(); if (this.RefNo != null) { attr.MyPK = this.RefNo; try { attr.Retrieve(); } catch { attr.CheckPhysicsTable(); attr.Retrieve(); } attr = (MapAttr)this.Pub1.Copy(attr); attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; attr.ColSpan = this.Pub1.GetDDLByID("DDL_ColSpan").SelectedItemIntVal; if (attr.UIIsEnable == false && attr.MyDataType == DataType.AppString) { try { attr.IsSigan = this.Pub1.GetCBByID("CB_IsSigan").Checked; } catch { } } switch (this.FType) { case DataType.AppBoolean: attr.MyDataType = BP.DA.DataType.AppBoolean; attr.DefValOfBool = this.Pub1.GetCBByID("CB_DefVal").Checked; break; case DataType.AppDateTime: case DataType.AppDate: attr.DefValReal = this.Pub1.GetTBByID("TB_DefVal").Text; //if (this.Pub1.GetCBByID("CB_DefVal").Checked) // attr.DefValReal = "1"; //else // attr.DefValReal = "0"; break; case DataType.AppString: attr.UIBindKey = this.Pub1.GetDDLByID("DDL_TBModel").SelectedItemStringVal; if (attr.TBModel == 2) { attr.MaxLen = 4000; } break; default: break; } } else { attr = (MapAttr)this.Pub1.Copy(attr); attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; attr.ColSpan = this.Pub1.GetDDLByID("DDL_ColSpan").SelectedItemIntVal; MapAttrs attrS = new MapAttrs(this.MyPK); int idx = 0; foreach (MapAttr en in attrS) { idx++; en.Idx = idx; en.Update(); if (en.KeyOfEn == attr.KeyOfEn) { throw new Exception("字段已经存在 Key=" + attr.KeyOfEn); } } if (this.IDX == null || this.IDX == "") { attr.Idx = 0; } else { attr.Idx = int.Parse(this.IDX) - 1; } attr.MyDataType = this.FType; switch (this.FType) { case DataType.AppBoolean: attr.MyDataType = BP.DA.DataType.AppBoolean; attr.UIContralType = UIContralType.CheckBok; attr.DefValOfBool = this.Pub1.GetCBByID("CB_DefVal").Checked; break; case DataType.AppString: attr.UIBindKey = this.Pub1.GetDDLByID("DDL_TBModel").SelectedItemStringVal; break; default: break; } } // 增加是否为空, 对数字类型的字段有效. try { attr.MinLen = this.Pub1.GetDDLByID("DDL_IsNull").SelectedItemIntVal; } catch { } //数字签名. try { //签名类型. attr.SignType = (SignType)this.Pub1.GetDDLByID("DDL_SignType").SelectedItemIntVal; if (attr.SignType == SignType.Pic) { attr.PicType = (PicType)this.Pub1.GetDDLByID("DDL_PicType").SelectedItemIntVal;//是否为自动签名 } else if (attr.SignType == SignType.CA) { attr.Para_SiganField = this.Pub1.GetTBByID("TB_SiganField").Text;//数字签名字段. } } catch { } attr.Para_FontSize = this.Pub1.GetDDLByID("DDL_FontSize").SelectedItemIntVal; //保存数字签名. Response.Buffer = true; attr.FK_MapData = this.MyPK; attr.MyPK = this.RefNo; //执行一次update 处理mapdata的计算的业务逻辑. MapData md = new MapData(); md.No = attr.FK_MapData; if (md.RetrieveFromDBSources() == 1) { md.Update(); } attr.Save(); switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); return; case "Btn_SaveAndNew": this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "&GroupField=" + attr.GroupID, true); return; default: break; } this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + this.MyPK + "&RefNo=" + attr.MyPK + "&FType=" + this.FType + "&GroupField=" + attr.GroupID, true); } catch (Exception ex) { this.Alert(ex.Message); } }
void btn_Save_Click(object sender, EventArgs e) { try { Button btn = sender as Button; switch (btn.ID) { case "Btn_Del": MapAttr attrDel = new MapAttr(); attrDel.MyPK = this.RefNo; attrDel.Delete(); this.WinClose(); return; default: break; } MapAttr attr = new MapAttr(); if (this.RefNo == null || this.RefNo == "") { attr.MyPK = this.MyPK + "_" + this.Pub1.GetTBByID("TB_KeyOfEn").Text; attr.UIContralType = UIContralType.DDL; attr.MyDataType = BP.DA.DataType.AppString; attr.LGType = FieldTypeS.FK; attr.DefVal = ""; attr.UIBindKey = this.Request.QueryString["SFKey"]; attr.UIIsEnable = true; } else { attr.MyPK = this.RefNo; attr.Retrieve(); } attr = (MapAttr)this.Pub1.Copy(attr); attr.FK_MapData = this.MyPK; attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; attr.DefVal = this.Pub1.GetTBByID("TB_DefVal").Text; attr.UIBindKey = this.Pub1.GetTBByID("TB_UIBindKey").Text; //if (this.Pub1.IsExit("CB_IsDefValNull")) //{ // if (this.Pub1.GetCBByID("CB_IsDefValNull").Checked == false) // attr.DefVal = this.Pub1.GetDDLByID("DDL").SelectedItemStringVal; // else // attr.DefVal = ""; //} //else //{ // string s = this.Pub1.GetDDLByID("DDL_DefVal").SelectedItemStringVal; // if (s == "@Select") // { // attr.DefVal = this.Pub1.GetDDLByID("DDL").SelectedItemStringVal; // } // else // { // attr.DefVal = s; // } //} if (this.RefNo == null || this.RefNo == "") { attr.Insert(); } else { attr.Update(); } switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); return; case "Btn_SaveAndNew": this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + attr.Idx + "&GroupField=" + this.GroupField, true); return; default: break; } this.Response.Redirect("EditTable.aspx?DoType=Edit&MyPK=" + this.MyPK + "&RefNo=" + attr.MyPK + "&GroupField=" + this.GroupField, true); } catch (Exception ex) { this.Alert(ex.Message); } }
void btn_Check_Click(object sender, EventArgs e) { string sta = this.Pub1.GetTBByID("TB_Sta").Text.Trim(); if (sta.Length == 0) { this.Alert("审核岗位不能为空"); return; } string Prx = this.Pub1.GetTBByID("TB_Prx").Text.Trim(); if (Prx.Length == 0) { Prx = chs2py.convert(sta); } MapAttr attr = new MapAttr(); int i = attr.Retrieve(MapAttrAttr.FK_MapData, this.RefNo, MapAttrAttr.KeyOfEn, Prx + "_Note"); i += attr.Retrieve(MapAttrAttr.FK_MapData, this.RefNo, MapAttrAttr.KeyOfEn, Prx + "_Checker"); i += attr.Retrieve(MapAttrAttr.FK_MapData, this.RefNo, MapAttrAttr.KeyOfEn, Prx + "_RDT"); if (i > 0) { this.Alert("前缀已经使用:" + Prx + " , 请确认您是否增加了这个审核分组或者,请您更换其他的前缀。"); return; } GroupField gf = new GroupField(); gf.Lab = sta; gf.EnName = this.RefNo; gf.Insert(); attr = new MapAttr(); attr.FK_MapData = this.RefNo; attr.KeyOfEn = Prx + "_Note"; attr.Name = "审核意见"; // sta; // this.ToE("CheckNote", "审核意见"); attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.UIIsEnable = true; attr.UIIsLine = true; attr.MaxLen = 4000; attr.ColSpan = 4; attr.GroupID = gf.OID; attr.UIHeight = 23 * 3; attr.Idx = 1; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.RefNo; attr.KeyOfEn = Prx + "_Checker"; attr.Name = "审核人";// "审核人"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@WebUser.No"; attr.UIIsEnable = false; attr.GroupID = gf.OID; attr.IsSigan = true; attr.Idx = 2; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.RefNo; attr.KeyOfEn = Prx + "_RDT"; attr.Name = "审核日期"; // "审核日期"; attr.MyDataType = DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@RDT"; attr.UIIsEnable = false; attr.GroupID = gf.OID; attr.Idx = 3; attr.Insert(); this.WinCloseWithMsg("保存成功"); // "增加成功,您可以调整它的位置与修改字段的标签。" }
public void btn_Save_Click(object sender, EventArgs e) { try { Button btn = sender as Button; switch (btn.ID) { case "Btn_Del": this.Response.Redirect("Do.aspx?DoType=Del&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo + "&GroupField = " + this.GroupField, true); return; default: break; } MapAttr attr = new MapAttr(); if (this.RefNo != null) { attr.MyPK = this.RefNo; try { attr.Retrieve(); } catch { attr.CheckPhysicsTable(); attr.Retrieve(); } attr = (MapAttr)this.Pub1.Copy(attr); attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; if (attr.UIIsEnable == false && attr.MyDataType == DataType.AppString) { try { attr.IsSigan = this.Pub1.GetCBByID("CB_IsSigan").Checked; } catch { } } switch (this.FType) { case DataType.AppBoolean: attr.MyDataType = BP.DA.DataType.AppBoolean; attr.DefValOfBool = this.Pub1.GetCBByID("CB_DefVal").Checked; break; case DataType.AppDateTime: case DataType.AppDate: attr.DefValReal = this.Pub1.GetTBByID("TB_DefVal").Text; //if (this.Pub1.GetCBByID("CB_DefVal").Checked) // attr.DefValReal = "1"; //else // attr.DefValReal = "0"; break; case DataType.AppString: attr.UIBindKey = this.Pub1.GetDDLByID("DDL_TBModel").SelectedItemStringVal; break; default: break; } } else { attr = (MapAttr)this.Pub1.Copy(attr); attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; MapAttrs attrS = new MapAttrs(this.MyPK); int idx = 0; foreach (MapAttr en in attrS) { idx++; en.IDX = idx; en.Update(); if (en.KeyOfEn == attr.KeyOfEn) { throw new Exception("字段已经存在 Key=" + attr.KeyOfEn); } } if (this.IDX == null || this.IDX == "") { attr.IDX = 0; } else { attr.IDX = int.Parse(this.IDX) - 1; } attr.MyDataType = this.FType; switch (this.FType) { case DataType.AppBoolean: attr.MyDataType = BP.DA.DataType.AppBoolean; attr.UIContralType = UIContralType.CheckBok; attr.DefValOfBool = this.Pub1.GetCBByID("CB_DefVal").Checked; break; case DataType.AppString: attr.UIBindKey = this.Pub1.GetDDLByID("DDL_TBModel").SelectedItemStringVal; break; default: break; } } Response.Buffer = true; attr.FK_MapData = this.MyPK; attr.MyPK = this.RefNo; attr.Save(); switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); return; case "Btn_SaveAndNew": this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + this.IDX + "&GroupField=" + attr.GroupID, true); return; default: break; } this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + this.MyPK + "&RefNo=" + attr.MyPK + "&FType=" + this.FType + "&GroupField=" + attr.GroupID, true); } catch (Exception ex) { this.Alert(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { switch (this.DoType) { case "DownTempFrm": MapData md = new MapData(this.FK_MapData); DataSet ds = md.GenerHisDataSet(); string name = "ccflow表单模板." + md.Name + "." + md.No + ".xml"; string file = this.Request.PhysicalApplicationPath + "\\Temp\\" + this.FK_MapData + ".xml"; ds.WriteXml(file); this.Response.Redirect("../../Temp/" + this.FK_MapData + ".xml", true); this.WinClose(); break; case "CCForm": this.Application.Clear(); if (WebUser.NoOfRel != "admin") { BP.Port.Emp emp = new BP.Port.Emp("admin"); BP.Web.WebUser.SignInOfGener(emp); } MapAttr mattr = new MapAttr(); mattr.MyPK = this.Request.QueryString["MyPK"]; int i = mattr.RetrieveFromDBSources(); mattr.KeyOfEn = this.Request.QueryString["KeyOfEn"]; mattr.FK_MapData = this.Request.QueryString["FK_MapData"]; mattr.MyDataType = int.Parse(this.Request.QueryString["DataType"]); if (!string.IsNullOrEmpty(this.Request.QueryString["UIBindKey"] + "")) { mattr.UIBindKey = this.Request.QueryString["UIBindKey"]; } mattr.UIContralType = (UIContralType)int.Parse(this.Request.QueryString["UIContralType"]); mattr.LGType = (BP.En.FieldTypeS) int.Parse(this.Request.QueryString["LGType"]); if (i == 0) { mattr.Name = System.Web.HttpUtility.UrlDecode(this.Request.QueryString["KeyName"], System.Text.Encoding.GetEncoding("GB2312")); mattr.UIIsEnable = true; mattr.UIVisible = true; if (mattr.LGType == FieldTypeS.Enum) { mattr.DefVal = "0"; } mattr.Insert(); } else { mattr.Update(); } switch (mattr.LGType) { case BP.En.FieldTypeS.Enum: this.Response.Redirect("EditEnum.aspx?MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK, true); return; case BP.En.FieldTypeS.Normal: this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true); return; case BP.En.FieldTypeS.FK: this.Response.Redirect("EditTable.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true); return; default: break; } break; case "DobackToF": MapAttr ma = new MapAttr(this.RefNo); switch (ma.LGType) { case FieldTypeS.Normal: this.Response.Redirect("EditF.aspx?RefNo=" + this.RefNo, true); return; case FieldTypeS.FK: this.Response.Redirect("EditTable.aspx?RefNo=" + this.RefNo, true); return; case FieldTypeS.Enum: this.Response.Redirect("EditEnum.aspx?RefNo=" + this.RefNo, true); return; default: return; } break; case "AddEnum": SysEnumMain sem1 = new SysEnumMain(this.Request.QueryString["EnumKey"]); MapAttr attrAdd = new MapAttr(); attrAdd.KeyOfEn = sem1.No; if (attrAdd.IsExit(MapAttrAttr.FK_MapData, this.MyPK, MapAttrAttr.KeyOfEn, sem1.No)) { BP.Sys.PubClass.Alert("字段已经存在 [" + sem1.No + "]。"); BP.Sys.PubClass.WinClose(); return; } attrAdd.FK_MapData = this.MyPK; attrAdd.Name = sem1.Name; attrAdd.UIContralType = UIContralType.DDL; attrAdd.UIBindKey = sem1.No; attrAdd.MyDataType = BP.DA.DataType.AppInt; attrAdd.LGType = FieldTypeS.Enum; attrAdd.DefVal = "0"; attrAdd.UIIsEnable = true; if (this.Idx == null || this.Idx == "") { MapAttrs attrs1 = new MapAttrs(this.MyPK); attrAdd.Idx = 0; } else { attrAdd.Idx = int.Parse(this.Idx); } attrAdd.Insert(); this.Response.Redirect("EditEnum.aspx?MyPK=" + this.MyPK + "&RefNo=" + attrAdd.MyPK, true); this.WinClose(); return; case "DelEnum": string eKey = this.Request.QueryString["EnumKey"]; SysEnumMain sem = new SysEnumMain(); sem.No = eKey; sem.Delete(); this.WinClose(); return; case "AddSysEnum": this.AddFEnum(); break; case "AddSFTable": this.AddSFTable(); break; case "AddSFTableAttr": SFTable sf = new SFTable(this.Request.QueryString["RefNo"]); this.Response.Redirect("EditTable.aspx?MyPK=" + this.MyPK + "&SFKey=" + sf.No, true); this.WinClose(); return; case "AddFG": /*执行一个插入列组的命令.*/ switch (this.RefNo) { case "IsPass": MapDtl dtl = new MapDtl(this.FK_MapData); dtl.IsEnablePass = true; /*更新是否启动审核分组字段.*/ MapAttr attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Check_Note"; attr.Name = "审核意见"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.DefVal = "同意"; attr.UIIsEnable = true; attr.UIIsLine = true; attr.MaxLen = 4000; attr.ColSpan = 4; // 默认为4列。 attr.Idx = 1; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Checker"; attr.Name = "审核人";// "审核人"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@WebUser.Name"; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 2; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "IsPass"; attr.Name = "通过否?";// "审核人"; attr.MyDataType = DataType.AppBoolean; attr.UIContralType = UIContralType.CheckBok; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.DefVal = "1"; attr.Idx = 2; attr.DefVal = "0"; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Check_RDT"; attr.Name = "审核日期"; // "审核日期"; attr.MyDataType = DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@RDT"; attr.UIIsEnable = false; attr.Idx = 3; attr.Insert(); /* 处理批次ID*/ attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "BatchID"; attr.Name = "BatchID"; // this.ToE("IsPass", "是否通过");// "审核人"; attr.MyDataType = DataType.AppInt; attr.UIIsEnable = false; attr.UIIsLine = false; attr.UIIsEnable = false; attr.UIVisible = false; attr.Idx = 2; attr.DefVal = "0"; attr.Insert(); dtl.Update(); this.WinClose(); return; case "Eval": /* 质量评价 */ attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalEmpNo"; attr.Name = "被评价人员编号"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 1; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalEmpName"; attr.Name = "被评价人员名称"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 2; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalCent"; attr.Name = "工作得分"; attr.MyDataType = DataType.AppFloat; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = true; attr.Idx = 3; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalNote"; attr.Name = "评价信息"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsEnable = true; attr.Idx = 4; attr.Insert(); this.WinClose(); return; default: break; } break; case "AddFGroup": this.AddFGroup(); return; case "AddF": case "ChoseFType": this.AddF(); break; case "Up": MapAttr attrU = new MapAttr(this.RefNo); if (this.Request.QueryString["IsDtl"] != null) { attrU.DoDtlUp(); } else { attrU.DoUp(); } this.WinClose(); break; case "Down": //让一个字段下移动. MapAttr attrD = new MapAttr(this.RefNo); attrD.DoDown(); this.WinClose(); break; case "DownAttr": //让一个字段下移动. MapAttr attrAttr = new MapAttr(this.RefNo); attrAttr.DoDtlDown(); this.WinClose(); break; case "Jump": MapAttr attrFrom = new MapAttr(this.Request.QueryString["FromID"]); MapAttr attrTo = new MapAttr(this.Request.QueryString["ToID"]); attrFrom.DoJump(attrTo); this.WinClose(); break; case "MoveTo": string toID = this.Request.QueryString["ToID"]; int toGFID = int.Parse(this.Request.QueryString["ToGID"]); int fromGID = int.Parse(this.Request.QueryString["FromGID"]); string fromID = this.Request.QueryString["FromID"]; MapAttr fromAttr = new MapAttr(); fromAttr.MyPK = fromID; fromAttr.Retrieve(); if (toGFID == fromAttr.GroupID && fromAttr.MyPK == toID) { /* 如果没有移动. */ this.WinClose(); return; } if (toGFID != fromAttr.GroupID && fromAttr.MyPK == toID) { MapAttr toAttr = new MapAttr(toID); fromAttr.Update(MapAttrAttr.GroupID, toAttr.GroupID, MapAttrAttr.Idx, toAttr.Idx); this.WinClose(); return; } this.Response.Redirect(this.Request.RawUrl.Replace("MoveTo", "Jump"), true); return; case "Edit": Edit(); break; case "Del": MapAttr attrDel = new MapAttr(); attrDel.MyPK = this.RefNo; attrDel.Delete(); this.WinClose(); break; case "GFDoUp": GroupField gf = new GroupField(this.RefOID); gf.DoUp(); gf.Retrieve(); if (gf.Idx == 0) { this.WinClose(); return; } int oidIdx = gf.Idx; gf.Idx = gf.Idx - 1; GroupField gfUp = new GroupField(); if (gfUp.Retrieve(GroupFieldAttr.EnName, gf.EnName, GroupFieldAttr.Idx, gf.Idx) == 1) { gfUp.Idx = oidIdx; gfUp.Update(); } gf.Update(); this.WinClose(); break; case "GFDoDown": GroupField mygf = new GroupField(this.RefOID); mygf.DoDown(); mygf.Retrieve(); int oidIdx1 = mygf.Idx; mygf.Idx = mygf.Idx + 1; GroupField gfDown = new GroupField(); if (gfDown.Retrieve(GroupFieldAttr.EnName, mygf.EnName, GroupFieldAttr.Idx, mygf.Idx) == 1) { gfDown.Idx = oidIdx1; gfDown.Update(); } mygf.Update(); this.WinClose(); break; case "AthDoUp": FrmAttachment frmAth = new FrmAttachment(this.MyPK); if (frmAth.RowIdx > 0) { frmAth.RowIdx = frmAth.RowIdx - 1; frmAth.Update(); } this.WinClose(); break; case "AthDoDown": FrmAttachment frmAthD = new FrmAttachment(this.MyPK); if (frmAthD.RowIdx < 10) { frmAthD.RowIdx = frmAthD.RowIdx + 1; frmAthD.Update(); } this.WinClose(); break; case "DtlDoUp": MapDtl dtl1 = new MapDtl(this.MyPK); if (dtl1.RowIdx > 0) { dtl1.RowIdx = dtl1.RowIdx - 1; dtl1.Update(); } this.WinClose(); break; case "DtlDoDown": MapDtl dtl2 = new MapDtl(this.MyPK); if (dtl2.RowIdx < 10) { dtl2.RowIdx = dtl2.RowIdx + 1; dtl2.Update(); } this.WinClose(); break; case "M2MDoUp": MapM2M ddtl1 = new MapM2M(this.MyPK); if (ddtl1.RowIdx > 0) { ddtl1.RowIdx = ddtl1.RowIdx - 1; ddtl1.Update(); } this.WinClose(); break; case "M2MDoDown": MapM2M ddtl2 = new MapM2M(this.MyPK); if (ddtl2.RowIdx < 10) { ddtl2.RowIdx = ddtl2.RowIdx + 1; ddtl2.Update(); } this.WinClose(); break; case "FrameDoUp": MapFrame frame1 = new MapFrame(this.MyPK); if (frame1.RowIdx > 0) { frame1.RowIdx = frame1.RowIdx - 1; frame1.Update(); } this.WinClose(); break; case "FrameDoDown": MapFrame frame2 = new MapFrame(this.MyPK); if (frame2.RowIdx < 10) { frame2.RowIdx = frame2.RowIdx + 1; frame2.Update(); } this.WinClose(); break; default: break; } } catch (Exception ex) { this.Pub1.AddMsgOfWarning("错误:", ex.Message + " <br>" + this.Request.RawUrl); } }
void btn_Save_Click(object sender, EventArgs e) { try { Button btn = sender as Button; switch (btn.ID) { case "Btn_Del": this.Response.Redirect("Do.aspx?DoType=Del&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true); return; default: break; } MapAttr attr = new MapAttr(); attr.MyPK = this.RefNo; if (this.RefNo != null) { attr.Retrieve(); } attr = (MapAttr)this.Pub1.Copy(attr); attr.FK_MapData = this.MyPK; attr.DefVal = this.Pub1.GetDDLByID("DDL").SelectedItemStringVal; attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; if (this.Pub1.GetRadioButtonByID("RB_Ctrl_0").Checked) { attr.UIContralType = UIContralType.DDL; } else { attr.UIContralType = UIContralType.RadioBtn; } if (this.RefNo == null) { attr.MyPK = this.MyPK + "_" + this.Pub1.GetTBByID("TB_KeyOfEn").Text; string idx = this.Request.QueryString["IDX"]; if (idx == null || idx == "") { } else { attr.IDX = int.Parse(this.Request.QueryString["IDX"]); } string enumKey = this.Request.QueryString["EnumKey"]; attr.UIBindKey = enumKey; attr.MyDataType = BP.DA.DataType.AppInt; attr.HisEditType = EditType.Edit; attr.UIContralType = UIContralType.DDL; attr.LGType = FieldTypeS.Enum; attr.Insert(); } else { attr.Update(); } switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); return; case "Btn_SaveAndNew": this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + attr.IDX + "&GroupField=" + this.GroupField, true); return; default: break; } if (this.RefNo == null) { this.Response.Redirect("EditEnum.aspx?DoType=Edit&MyPK=" + this.MyPK + "&RefNo=" + attr.MyPK + "&GroupField=" + this.GroupField, true); } } catch (Exception ex) { this.Alert(ex.Message); } }
void btn_Save_Click(object sender, EventArgs e) { try { Button btn = sender as Button; switch (btn.ID) { case "Btn_Del": MapAttr attrDel = new MapAttr(); attrDel.MyPK = this.RefNo; attrDel.Delete(); this.WinClose(); return; default: break; } MapAttr attr = new MapAttr(); if (this.RefNo == null || this.RefNo == "") { attr.MyPK = this.MyPK + "_" + this.Pub1.GetTBByID("TB_KeyOfEn").Text; attr.KeyOfEn = this.Pub1.GetTBByID("TB_KeyOfEn").Text; attr.UIContralType = UIContralType.DDL; attr.MyDataType = BP.DA.DataType.AppString; attr.LGType = FieldTypeS.Normal; attr.DefVal = ""; attr.UIBindKey = this.Request.QueryString["SFKey"]; attr.UIIsEnable = true; if (attr.IsExits == true) { throw new Exception("@字段名[" + attr.KeyOfEn + "]已经存在,保存失败。"); } attr = (MapAttr)this.Pub1.Copy(attr); } else { attr.MyPK = this.RefNo; attr.Retrieve(); attr = (MapAttr)this.Pub1.Copy(attr); } attr.FK_MapData = this.MyPK; attr.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; attr.ColSpan = this.Pub1.GetDDLByID("DDL_ColSpan").SelectedItemIntVal; attr.DefVal = this.Pub1.GetTBByID("TB_DefVal").Text; attr.UIBindKey = this.Pub1.GetTBByID("TB_UIBindKey").Text; string field = attr.KeyOfEn; if (this.RefNo == null || this.RefNo == "") { attr.Insert(); //首先插入数据表现数据. //插入隐藏数据. attr.KeyOfEn = field + "T"; attr.UIVisible = false; attr.UIIsEnable = false; //让其不是隐藏字段. attr.Insert(); //还原以前的值. attr.KeyOfEn = field; attr.MyPK = this.MyPK + "_" + field; attr.UIVisible = true; } else { attr.Update(); } switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); return; case "Btn_SaveAndNew": this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.MyPK + "&IDX=" + attr.Idx + "&GroupField=" + this.GroupField, true); return; default: break; } this.Response.Redirect("EditSQL.aspx?DoType=Edit&MyPK=" + this.MyPK + "&RefNo=" + attr.MyPK + "&GroupField=" + this.GroupField, true); } catch (Exception ex) { this.Alert(ex.Message); } }
public void EditSln() { FrmField sln = new FrmField(); int num = sln.Retrieve(FrmFieldAttr.FK_MapData, this.FK_MapData, FrmFieldAttr.KeyOfEn, this.KeyOfEn, FrmFieldAttr.FK_Node, this.FK_Node); BP.Sys.MapAttr attr = new MapAttr(); attr.Retrieve(MapAttrAttr.FK_MapData, this.FK_MapData, MapAttrAttr.KeyOfEn, this.KeyOfEn); if (num == 0) { sln.UIIsEnable = attr.UIIsEnable; sln.UIVisible = attr.UIVisible; sln.IsSigan = attr.IsSigan; sln.DefVal = attr.DefValReal; } this.Pub1.AddTable(); this.Pub1.AddTR(); this.Pub1.AddTDTitle("项目"); this.Pub1.AddTDTitle("信息"); this.Pub1.AddTDTitle("备注"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("字段"); this.Pub1.AddTD(attr.KeyOfEn); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("中文名"); this.Pub1.AddTD(attr.Name); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(); CheckBox cb = new CheckBox(); cb.ID = "CB_Visable"; cb.Text = "是否可见?"; cb.Checked = sln.UIVisible; this.Pub1.AddTD(cb); this.Pub1.AddTD("在该方案中是否可见?"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(); cb = new CheckBox(); cb.ID = "CB_Readonly"; cb.Text = "是否只读?"; cb.Checked = sln.UIIsEnable; this.Pub1.AddTD(cb); this.Pub1.AddTD("在该方案中是否只读?"); this.Pub1.AddTREnd(); if (attr.MyDataType == DataType.AppString) { /*只读,并且是String. */ this.Pub1.AddTR(); this.Pub1.AddTD(); cb = new CheckBox(); cb.ID = "CB_IsSigan"; cb.Text = "是否是数字签名?"; cb.Checked = sln.IsSigan; this.Pub1.AddTD(cb); this.Pub1.AddTD("如果是,并且需要在当前方案显示当前人员的签名:<br>请在默认值里输入@WebUser.No"); this.Pub1.AddTREnd(); } this.Pub1.AddTR(); this.Pub1.AddTD("默认值"); TextBox tb = new TextBox(); tb.ID = "TB_DefVal"; tb.Text = sln.DefVal; this.Pub1.AddTD(tb); this.Pub1.AddTD("支持ccflow的全局变量."); this.Pub1.AddTREnd(); this.Pub1.AddTableEnd(); Button btn = new Button(); btn.ID = "Btn_Save"; btn.Text = "保存"; btn.Click += new EventHandler(btn_Click); this.Pub1.Add(btn); this.Pub1.AddFieldSet("独立表单中的数字签名设置方法"); this.Pub1.AddBR("应用概述:"); this.Pub1.AddBR("1, 一个独立表单上会有多出数字签名. "); this.Pub1.AddBR("2, 这些数字签名有时会读取以前的签名,有时需要当前的数字签名。"); this.Pub1.AddBR("3, 如果当前方案需要读取以前的数字签名,那就清除默认值信息,否则就设置@WebUser.No 获取当前操作员的数字签名。"); this.Pub1.AddFieldSetEnd(); }
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); } }