public string Fields_Init() { FrmFields fss = new FrmFields(this.FK_MapData, this.FK_Node); MapAttrs attrs = new MapAttrs(); QueryObject obj = new QueryObject(attrs); obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData); obj.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X); obj.DoQuery(); List <FieldsAttrs> fieldsAttrsList = new List <FieldsAttrs>(); int idx = 0; foreach (MapAttr attr in attrs) { switch (attr.KeyOfEn) { case BP.WF.WorkAttr.RDT: case BP.WF.WorkAttr.FID: case BP.WF.WorkAttr.OID: case BP.WF.WorkAttr.Rec: case BP.WF.WorkAttr.MyNum: case BP.WF.WorkAttr.MD5: case BP.WF.WorkAttr.Emps: case BP.WF.WorkAttr.CDT: continue; default: break; } fieldsAttrsList.Add(new FieldsAttrs { }); fieldsAttrsList[idx].idx = idx; fieldsAttrsList[idx].KeyOfEn = attr.KeyOfEn; fieldsAttrsList[idx].Name = attr.Name; fieldsAttrsList[idx].LGTypeT = attr.LGTypeT; FrmField sln = fss.GetEntityByKey(FrmFieldAttr.KeyOfEn, attr.KeyOfEn) as FrmField; if (sln == null) { fieldsAttrsList[idx].UIVisible = false; fieldsAttrsList[idx].UIIsEnable = false; fieldsAttrsList[idx].IsSigan = false; fieldsAttrsList[idx].DefVal = ""; fieldsAttrsList[idx].IsNotNull = false; fieldsAttrsList[idx].IsSigan = false; fieldsAttrsList[idx].RegularExp = ""; fieldsAttrsList[idx].IsWriteToFlowTable = false; fieldsAttrsList[idx].IsWriteToGenerWorkFlow = false; } else { fieldsAttrsList[idx].UIVisible = sln.UIVisible; fieldsAttrsList[idx].UIIsEnable = sln.UIIsEnable; fieldsAttrsList[idx].IsSigan = sln.IsSigan; fieldsAttrsList[idx].DefVal = sln.DefVal; fieldsAttrsList[idx].IsNotNull = sln.IsNotNull; fieldsAttrsList[idx].IsSigan = sln.IsSigan; fieldsAttrsList[idx].RegularExp = sln.RegularExp; fieldsAttrsList[idx].IsWriteToFlowTable = sln.IsWriteToFlowTable; //fieldsAttrsList[idx].IsWriteToGenerWorkFlow = sln.IsWriteToGenerWorkFlow; } idx++; } return(LitJson.JsonMapper.ToJson(fieldsAttrsList)); }
/// <summary> /// 绑定方案 /// </summary> public void BindSln() { // 查询出来解决方案. FrmFields fss = new FrmFields(this.FK_MapData, int.Parse(this.FK_Node)); // 处理好. MapAttrs attrs = new MapAttrs(); //增加排序 QueryObject obj = new QueryObject(attrs); obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData); obj.addOrderBy(MapAttrAttr.Y, MapAttrAttr.X); obj.DoQuery(); this.Pub2.AddTable("80%"); this.Pub2.AddTR(); this.Pub2.AddTDTitle("Idx"); this.Pub2.AddTDTitle("字段"); this.Pub2.AddTDTitle("名称"); this.Pub2.AddTDTitle("类型"); this.Pub2.AddTDTitle("width='90px'", "可见?"); this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('UIIsEnable')\" />可用?"); this.Pub2.AddTDTitle("是否是签名?"); this.Pub2.AddTDTitle("默认值"); this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('IsNotNull')\" />检查必填?"); this.Pub2.AddTDTitle("正则表达式"); this.Pub2.AddTDTitle("<input type='checkbox' id='s' onclick=\"CheckAll('IsWriteToFlowTable')\" />写入流程数据表?"); this.Pub2.AddTDTitle(""); this.Pub2.AddTREnd(); CheckBox cb = new CheckBox(); TextBox tb = new TextBox(); int idx = 0; foreach (MapAttr attr in attrs) { switch (attr.KeyOfEn) { case BP.WF.WorkAttr.RDT: case BP.WF.WorkAttr.FID: case BP.WF.WorkAttr.OID: case BP.WF.WorkAttr.Rec: case BP.WF.WorkAttr.MyNum: case BP.WF.WorkAttr.MD5: case BP.WF.WorkAttr.Emps: case BP.WF.WorkAttr.CDT: continue; default: break; } idx++; this.Pub2.AddTR(); this.Pub2.AddTDIdx(idx); this.Pub2.AddTD(attr.KeyOfEn); this.Pub2.AddTD(attr.Name); this.Pub2.AddTD(attr.LGTypeT); FrmField sln = fss.GetEntityByKey(FrmFieldAttr.KeyOfEn, attr.KeyOfEn) as FrmField; if (sln == null) { cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_UIVisible"; cb.Checked = attr.UIVisible; cb.Text = "可见?"; this.Pub2.AddTD("width=90px", cb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_UIIsEnable"; cb.Checked = attr.UIIsEnable; cb.Text = "可用?"; this.Pub2.AddTD("width=90px", cb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_IsSigan"; cb.Checked = attr.IsSigan; cb.Text = "是否数字签名?"; this.Pub2.AddTD("width=150px", cb); tb = new TextBox(); tb.ID = "TB_" + attr.KeyOfEn + "_DefVal"; tb.Text = attr.DefValReal; this.Pub2.AddTD(tb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsNotNull; // cb.Checked = attr.IsNotNull; cb.Checked = false; cb.Text = "检查必填?"; this.Pub2.AddTD(cb); tb = new TextBox(); tb.ID = "TB_" + attr.KeyOfEn + "_" + FrmFieldAttr.RegularExp; //tb.Text = attr.RegularExp; // tb.Columns = 150; this.Pub2.AddTD(tb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsWriteToFlowTable; cb.Checked = false; cb.Text = "是否写入流程表?"; this.Pub2.AddTD(cb); this.Pub2.AddTD(); //this.Pub2.AddTD("<a href=\"javascript:EditSln('" + this.FK_MapData + "','" + this.SlnString + "','" + attr.KeyOfEn + "')\" >Edit</a>"); } else { cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_UIVisible"; cb.Checked = sln.UIVisible; cb.Text = "可见?"; this.Pub2.AddTD("width=90px", cb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_UIIsEnable"; cb.Checked = sln.UIIsEnable; cb.Text = "可用?"; this.Pub2.AddTD("width=90px", cb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_IsSigan"; cb.Checked = sln.IsSigan; cb.Text = "是否数字签名?"; this.Pub2.AddTD("width=150px", cb); tb = new TextBox(); tb.ID = "TB_" + attr.KeyOfEn + "_DefVal"; tb.Text = sln.DefVal; this.Pub2.AddTD(tb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsNotNull; cb.Checked = sln.IsNotNull; cb.Text = "必填?"; this.Pub2.AddTD(cb); tb = new TextBox(); tb.ID = "TB_" + attr.KeyOfEn + "_RegularExp"; tb.Text = sln.RegularExp; this.Pub2.AddTD(tb); cb = new CheckBox(); cb.ID = "CB_" + attr.KeyOfEn + "_" + FrmFieldAttr.IsWriteToFlowTable; cb.Checked = sln.IsWriteToFlowTable; cb.Text = "写入流程数据表?"; this.Pub2.AddTD(cb); this.Pub2.AddTD("<a href=\"javascript:DelSln('" + this.FK_MapData + "','" + this.FK_Flow + "','" + this.FK_Node + "','" + this.FK_Node + "','" + attr.KeyOfEn + "')\" ><img src='../Img/Btn/Delete.gif' border=0/>Delete</a>"); } this.Pub2.AddTREnd(); } this.Pub2.AddTableEnd(); Button btn = new Button(); btn.ID = "Btn_Save"; btn.Click += new EventHandler(btn_Field_Click); btn.Text = "保存"; this.Pub2.Add(btn); //保存. if (fss.Count != 0) { btn = new Button(); btn.ID = "Btn_Del"; btn.Click += new EventHandler(btn_Field_Click); btn.Text = " Delete All "; btn.Attributes["onclick"] = "return confirm('Are you sure?');"; this.Pub2.Add(btn); //删除定义.. } if (dtNodes.Rows.Count >= 1) { //btn = new Button(); //btn.ID = "Btn_Copy"; ////btn.Click += new EventHandler(btn_Field_Click); //btn.Text = " Copy From Node "; //btn.Attributes["onclick"] = ""; this.Pub2.Add("<input type=button value='从其他节点上赋值权限' onclick=\"javascript:CopyIt('" + this.FK_MapData + "','" + this.FK_Flow + "','" + this.FK_Node + "')\">"); //删除定义.. } }