void btn_New_Click(object sender, EventArgs e) { string no = this.UCSys1.GetTextBoxByID("TB_No").Text; string name = this.UCSys1.GetTextBoxByID("TB_Name").Text; SFTable m = new SFTable(); m.No = no; if (m.RetrieveFromDBSources() == 1) { this.Alert("编码表编号:" + m.No + " 已经被:" + m.Name + "占用"); return; } m.Name = name; if (string.IsNullOrEmpty(name)) { this.Alert("编码表名称不能为空"); return; } // m.HisSFTableType = SFTableType.SFTable; m.Insert(); this.Response.Redirect("SFTableList.aspx?RefNo=" + m.No, true); }
/// <summary> /// 检查enittyNoName类型的实体 /// </summary> public void CheckEnityTypeAttrsFor_EntityNoName() { //取出来全部的属性. MapAttrs attrs = new MapAttrs(this.No); #region 补充上流程字段到 NDxxxRpt. if (attrs.Contains(this.No + "_" + GERptAttr.OID) == false) { /* WorkID */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.KeyOfEn = "OID"; attr.Name = "主键ID"; 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(); } if (attrs.Contains(this.No + "_" + GERptAttr.BillNo) == false) { /* 单据编号 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = GERptAttr.BillNo; attr.Name = "编号"; // 单据编号 attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = true; attr.UIIsEnable = false; attr.UIIsLine = false; attr.MinLen = 0; attr.MaxLen = 100; attr.Idx = -100; attr.Insert(); } if (attrs.Contains(this.No + "_" + GERptAttr.Title) == false) { /* 名称 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = GERptAttr.Title; // "FlowEmps"; attr.Name = "名称"; // 单据模式, ccform的模式. attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = true; attr.UIIsEnable = true; attr.UIIsLine = true; attr.MinLen = 0; attr.MaxLen = 400; attr.Idx = -90; attr.Insert(); } if (attrs.Contains(this.No + "_BillState") == false) { /* 单据状态 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = "BillState"; // "FlowEmps"; attr.Name = "单据状态"; // attr.MyDataType = DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.UIIsLine = true; attr.MinLen = 0; attr.MaxLen = 10; attr.Idx = -98; attr.Insert(); } if (attrs.Contains(this.No + "_Starter") == false) { /* 发起人 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = "Starter"; attr.Name = "创建人"; // attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.MinLen = 0; attr.MaxLen = 32; attr.Idx = -1; attr.Insert(); } if (attrs.Contains(this.No + "_StarterName") == false) { /* 创建人名称 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = "StarterName"; attr.Name = "创建人名称"; // attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.MinLen = 0; attr.MaxLen = 32; attr.Idx = -1; attr.Insert(); } if (attrs.Contains(this.No + "_" + GERptAttr.AtPara) == false) { /* 参数 */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = GERptAttr.AtPara; attr.Name = "参数"; // 单据编号 attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.UIIsLine = false; attr.MinLen = 0; attr.MaxLen = 4000; attr.Idx = -99; attr.Insert(); } if (attrs.Contains(this.No + "_RDT") == false) { /* MyNum */ MapAttr attr = new BP.Sys.MapAttr(); attr.FK_MapData = this.No; attr.HisEditType = EditType.UnDel; attr.KeyOfEn = "RDT"; // "FlowStartRDT"; attr.Name = "创建时间"; attr.MyDataType = DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.UIIsLine = false; attr.Idx = -97; attr.Insert(); } #endregion 补充上流程字段。 #region 注册到外键表. SFTable sf = new SFTable(); sf.No = this.No; if (sf.RetrieveFromDBSources() == 0) { sf.Name = this.Name; sf.SrcType = SrcType.SQL; sf.SrcTable = this.PTable; sf.ColumnValue = "BillNo"; sf.ColumnText = "Title"; sf.SelectStatement = "SELECT BillNo AS No, Title as Name FROM " + this.PTable; sf.Insert(); } #endregion 注册到外键表 }