private void addTemplate() { int tableId = Convert.ToInt32(HttpUtil.GetReqStrValue("tableid")); string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.TYPE = 0; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TABLE_ID = tableId; TF_CUSTOM_TEMPLATE valObj = BLLTable <TF_CUSTOM_TEMPLATE> .GetRowData(conf); if (valObj == null) { int i = BLLTable <TF_CUSTOM_TEMPLATE> .Insert(conf, TF_CUSTOM_TEMPLATE.Attribute.ID); if (i > 0) { Response.Write("{\"msg\":\"添加成功\",\"template_id\":\"" + conf.ID + "\"}"); } else { Response.Write("{\"msg\":\"添加失败\",\"template_id\":\"" + 0 + "\"}"); } } else { Response.Write("{\"msg\":\"该模板已经存在\",\"template_id\":\"" + -1 + "\"}"); } }
public void saveTemplate() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); //先把全部status =0 然后 status=1 TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TABLE_NAME = tableName; conf.TYPE = 0; TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); val.STATUS = 0; BLLTable <TF_CUSTOM_TEMPLATE> .Update(val, conf); TF_CUSTOM_TEMPLATE conf2 = new TF_CUSTOM_TEMPLATE(); conf2.TABLE_NAME = tableName; conf2.TEMPLATE_NAME = templateName; conf2.TYPE = 0; TF_CUSTOM_TEMPLATE val2 = new TF_CUSTOM_TEMPLATE(); val2.STATUS = 1; BLLTable <TF_CUSTOM_TEMPLATE> .Update(val2, conf2); Response.Write("{}"); }
public void getTemplateHtml() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); if (templateName.Equals("默认")) { //默认,根据tableName取获取模板 ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(tableName); int i = 0; string html = ""; string tr = "<tr>"; foreach (AttributeItem attr in itable.af_AttributeItemList) { if (i % 2 == 0) { html += tr + "</tr>"; tr = "<tr>"; } TF_TB_FIELD conf2 = new TF_TB_FIELD(); conf2.FIELD_NAME = attr.FieldName; TF_TB_FIELD val = BLLTable <TF_TB_FIELD> .GetRowData(conf2); if (val != null) { tr += "<td>" + val.NOTE + "</td><td>[" + tableName + "." + attr.FieldName + "]</td>"; } else { tr += "<td>" + (string.IsNullOrEmpty(attr.ZhName) ? attr.FieldName : attr.ZhName) + "</td><td>[" + tableName + "." + attr.FieldName + "]</td>"; } i++; } Response.Write(DEFAULT_TEMPLATE_START + html + DEFAULT_TEMPLATE_END); return; } TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; TF_CUSTOM_TEMPLATE valObj = BLLTable <TF_CUSTOM_TEMPLATE> .GetRowData(conf); if (valObj == null) { Response.Write(""); } else { Response.Write(valObj.TEMPLATE_HTML); } }
public void getTemplateHtml() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); if (templateName.Equals("默认")) { //默认,根据tableName取获取模板 ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(tableName); int i = 0; string html = ""; string tr = "<tr>"; foreach(AttributeItem attr in itable.af_AttributeItemList){ if (i % 2 == 0) { html += tr+"</tr>"; tr = "<tr>"; } TF_TB_FIELD conf2 = new TF_TB_FIELD(); conf2.FIELD_NAME = attr.FieldName; TF_TB_FIELD val = BLLTable<TF_TB_FIELD>.GetRowData(conf2); if (val != null) { tr += "<td>" + val.NOTE + "</td><td>[" + tableName + "." + attr.FieldName + "]</td>"; } else { tr += "<td>" + (string.IsNullOrEmpty(attr.ZhName) ? attr.FieldName : attr.ZhName )+ "</td><td>[" + tableName + "." + attr.FieldName + "]</td>"; } i++; } Response.Write(DEFAULT_TEMPLATE_START + html + DEFAULT_TEMPLATE_END); return; } TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; TF_CUSTOM_TEMPLATE valObj=BLLTable<TF_CUSTOM_TEMPLATE>.GetRowData(conf); if (valObj == null) { Response.Write(""); } else { Response.Write(valObj.TEMPLATE_HTML); } }
//private void recoveryDefault() //{ // string tableName = HttpUtil.GetReqStrValue("tableName"); // TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); // conf.TABLE_NAME = tableName; // conf.USER_ID = -1 // TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); // val.HASDEFAULT = 1; // int i= BLLTable<TF_CUSTOM_TEMPLATE>.Update(val,conf); // if (i > 0) // { // Response.Write("{\"msg\":\"恢复成功\"}"); // } // else // { // Response.Write("{\"msg\":\"恢复失败\"}"); // } //} private void saveTemplateHtml() { int tableId = Convert.ToInt32(HttpUtil.GetReqStrValue("tableid")); string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); string templateHtml = HttpUtil.GetReqStrValue("templateHtml"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; conf.TABLE_ID = tableId; TF_CUSTOM_TEMPLATE valObj = BLLTable <TF_CUSTOM_TEMPLATE> .GetRowData(conf); int i = 0; if (valObj == null) { conf.TEMPLATE_HTML = templateHtml; i = BLLTable <TF_CUSTOM_TEMPLATE> .Insert(conf, TF_CUSTOM_TEMPLATE.Attribute.ID); if (i > 0) { Response.Write("{\"msg\":\"保存成功\",\"template_id\":\"" + (valObj == null ? conf.ID : valObj.ID) + "\",\"type\":\"add\"}"); } else { Response.Write("{\"msg\":\"保存失败\",\"type\":\"add\"}"); } } else { TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); val.TEMPLATE_HTML = templateHtml; i = BLLTable <TF_CUSTOM_TEMPLATE> .Update(val, conf); if (i > 0) { Response.Write("{\"msg\":\"保存成功\",\"template_id\":\"" + (valObj == null ? conf.ID : valObj.ID) + "\",\"type\":\"update\"}"); } else { Response.Write("{\"msg\":\"保存失败\",\"type\":\"update\"}"); } } }
private void getTemplateOptionsAndField() { string tableName = HttpUtil.GetReqStrValue("tableName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; List <TF_CUSTOM_TEMPLATE> templateList = BLLTable <TF_CUSTOM_TEMPLATE> .Select(new TF_CUSTOM_TEMPLATE(), conf); string html = "<option value='-1'>--无--</option>"; if (tableName.Equals("-1")) { Response.Write("{\"html\":\"" + html + "\"}"); return; } foreach (TF_CUSTOM_TEMPLATE template in templateList) { html += "<option value='" + template.ID + "'>" + template.TEMPLATE_NAME + "</option>"; } ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(tableName); DataBaseField[] dataBaseFields = itable.af_GetAvailableDataBaseField(); string fieldHtml = "<ul>"; foreach (DataBaseField dataBaseField in dataBaseFields) { TF_TB_FIELD conf2 = new TF_TB_FIELD(); conf2.FIELD_NAME = dataBaseField.FieldName; TF_TB_FIELD val2 = BLLTable <TF_TB_FIELD> .GetRowData(conf2); if (val2 != null) { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + (string.IsNullOrEmpty(val2.NOTE)? dataBaseField.FieldName : val2.NOTE) + "</div></li>"; } else { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + dataBaseField.FieldName + "</div></li>"; } } fieldHtml += "</ul>"; Response.Write("{\"html\":\"" + html + "\",\"fieldHtml\":\"" + fieldHtml + "\"}"); }
private void delTemplate() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; int i = BLLTable <TF_CUSTOM_TEMPLATE> .Delete(conf); if (i > 0) { Response.Write("{\"msg\":\"删除成功\"}"); } else { Response.Write("{\"msg\":\"删除失败\"}"); } }
public void saveTemplate() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); //先把全部status =0 然后 status=1 TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TABLE_NAME = tableName; conf.TYPE = 0; TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); val.STATUS = 0; BLLTable<TF_CUSTOM_TEMPLATE>.Update(val, conf); TF_CUSTOM_TEMPLATE conf2 = new TF_CUSTOM_TEMPLATE(); conf2.TABLE_NAME = tableName; conf2.TEMPLATE_NAME = templateName; conf2.TYPE = 0; TF_CUSTOM_TEMPLATE val2 = new TF_CUSTOM_TEMPLATE(); val2.STATUS = 1; BLLTable<TF_CUSTOM_TEMPLATE>.Update(val2, conf2); Response.Write("{}"); }
//private void recoveryDefault() //{ // string tableName = HttpUtil.GetReqStrValue("tableName"); // TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); // conf.TABLE_NAME = tableName; // conf.USER_ID = -1 // TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); // val.HASDEFAULT = 1; // int i= BLLTable<TF_CUSTOM_TEMPLATE>.Update(val,conf); // if (i > 0) // { // Response.Write("{\"msg\":\"恢复成功\"}"); // } // else // { // Response.Write("{\"msg\":\"恢复失败\"}"); // } //} private void saveTemplateHtml() { int tableId = Convert.ToInt32(HttpUtil.GetReqStrValue("tableid")); string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); string templateHtml = HttpUtil.GetReqStrValue("templateHtml"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; conf.TABLE_ID = tableId; TF_CUSTOM_TEMPLATE valObj = BLLTable<TF_CUSTOM_TEMPLATE>.GetRowData(conf); int i = 0; if (valObj == null) { conf.TEMPLATE_HTML = templateHtml; i = BLLTable<TF_CUSTOM_TEMPLATE>.Insert(conf, TF_CUSTOM_TEMPLATE.Attribute.ID); if (i > 0) { Response.Write("{\"msg\":\"保存成功\",\"template_id\":\"" + (valObj == null ? conf.ID : valObj.ID) + "\",\"type\":\"add\"}"); } else { Response.Write("{\"msg\":\"保存失败\",\"type\":\"add\"}"); } } else { TF_CUSTOM_TEMPLATE val = new TF_CUSTOM_TEMPLATE(); val.TEMPLATE_HTML = templateHtml; i = BLLTable<TF_CUSTOM_TEMPLATE>.Update(val, conf); if (i > 0) { Response.Write("{\"msg\":\"保存成功\",\"template_id\":\"" + (valObj == null ? conf.ID : valObj.ID) + "\",\"type\":\"update\"}"); } else { Response.Write("{\"msg\":\"保存失败\",\"type\":\"update\"}"); } } }
private void getTemplateOptionsAndField() { string tableName = HttpUtil.GetReqStrValue("tableName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TABLE_NAME = tableName; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; List<TF_CUSTOM_TEMPLATE> templateList = BLLTable<TF_CUSTOM_TEMPLATE>.Select(new TF_CUSTOM_TEMPLATE(), conf); string html = "<option value='-1'>--无--</option>"; if (tableName.Equals("-1")) { Response.Write("{\"html\":\"" + html + "\"}"); return; } foreach(TF_CUSTOM_TEMPLATE template in templateList){ html += "<option value='"+template.ID+"'>"+template.TEMPLATE_NAME+"</option>"; } ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(tableName); DataBaseField[] dataBaseFields = itable.af_GetAvailableDataBaseField(); string fieldHtml = "<ul>"; foreach (DataBaseField dataBaseField in dataBaseFields) { TF_TB_FIELD conf2 = new TF_TB_FIELD(); conf2.FIELD_NAME = dataBaseField.FieldName; TF_TB_FIELD val2 = BLLTable<TF_TB_FIELD>.GetRowData(conf2); if (val2 != null) { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + (string.IsNullOrEmpty(val2.NOTE)? dataBaseField.FieldName : val2.NOTE) + "</div></li>"; } else { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + dataBaseField.FieldName + "</div></li>"; } } fieldHtml += "</ul>"; Response.Write("{\"html\":\"" + html + "\",\"fieldHtml\":\"" + fieldHtml + "\"}"); }
private void delTemplate() { string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.USER_ID =Convert.ToInt32(userBase.StaffID); conf.TYPE = 0; int i=BLLTable<TF_CUSTOM_TEMPLATE>.Delete(conf); if (i > 0) { Response.Write("{\"msg\":\"删除成功\"}"); } else { Response.Write("{\"msg\":\"删除失败\"}"); } }
private void addTemplate() { int tableId = Convert.ToInt32(HttpUtil.GetReqStrValue("tableid")); string tableName = HttpUtil.GetReqStrValue("tableName"); string templateName = HttpUtil.GetReqStrValue("templateName"); TF_CUSTOM_TEMPLATE conf = new TF_CUSTOM_TEMPLATE(); conf.TEMPLATE_NAME = templateName; conf.TABLE_NAME = tableName; conf.TYPE = 0; conf.USER_ID = Convert.ToInt32(userBase.StaffID); conf.TABLE_ID = tableId; TF_CUSTOM_TEMPLATE valObj=BLLTable<TF_CUSTOM_TEMPLATE>.GetRowData(conf); if (valObj == null) { int i=BLLTable<TF_CUSTOM_TEMPLATE>.Insert(conf, TF_CUSTOM_TEMPLATE.Attribute.ID); if (i > 0) { Response.Write("{\"msg\":\"添加成功\",\"template_id\":\"" + conf.ID+ "\"}"); } else { Response.Write("{\"msg\":\"添加失败\",\"template_id\":\"" + 0 + "\"}"); } } else { Response.Write("{\"msg\":\"该模板已经存在\",\"template_id\":\"" + -1 + "\"}"); } }
protected void Page_Load(object sender, EventArgs e) { ////id=1612&pid=161&no=1&name=%u8BE6%u7EC6%u5E03%u5C40&sc=0&ntype=TF_DESIGN_DETAIL&level=0111& // string id = HttpUtil.GetReqStrValue("id"); string pid = HttpUtil.GetReqStrValue("pid"); // string no = HttpUtil.GetReqStrValue("no"); // string name = HttpUtil.GetReqStrValue("name"); // string sc = HttpUtil.GetReqStrValue("sc"); // string ntype = HttpUtil.GetReqStrValue("ntype"); //DataBase db = DataBase.Factory(conn); //foreach (DataBaseTable dt1 in db.DataTables_USER) //{ // tableMap.Add(dt1.TableName,dt1.ZhName); //} TF_FORM conf1 = new TF_FORM(); conf1.FORM_ID = Convert.ToInt32(pid); TF_FORM val1 = new TF_FORM(); val1.TB_ID = 1; TF_FORM valObj1 = BLLTable <TF_FORM> .GetRowData(val1, conf1); TF_TABLE conf2 = new TF_TABLE(); conf2.TB_ID = valObj1.TB_ID; TF_TABLE val2 = new TF_TABLE(); val2.TB_NAME = ""; val2.CH_NAME = ""; val2.TB_ID = 0; TF_TABLE valObj2 = BLLTable <TF_TABLE> .GetRowData(val2, conf2); currTable = valObj2.TB_NAME; currZhTable = valObj2.CH_NAME; currTableId = valObj2.TB_ID; V_TF_TEMPLATE_TABLENAME conf = new V_TF_TEMPLATE_TABLENAME(); conf.Distinct = true; conf.USER_ID = Convert.ToInt32(userBase.StaffID); List <V_TF_TEMPLATE_TABLENAME> templateList = BLLTable <V_TF_TEMPLATE_TABLENAME> .Select(new V_TF_TEMPLATE_TABLENAME(), conf); foreach (V_TF_TEMPLATE_TABLENAME temp in templateList) { ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(temp.TABLE_NAME); if (!tableMap.ContainsKey(temp.TABLE_NAME)) { tableMap.Add(temp.TABLE_NAME, temp.CH_NAME); } } TF_CUSTOM_TEMPLATE conf3 = new TF_CUSTOM_TEMPLATE(); conf3.TABLE_NAME = valObj2.TB_NAME; conf3.USER_ID = Convert.ToInt32(userBase.StaffID); conf3.TYPE = 0; List <TF_CUSTOM_TEMPLATE> templateList2 = BLLTable <TF_CUSTOM_TEMPLATE> .Select(new TF_CUSTOM_TEMPLATE(), conf3); html = "<option value='-1'>--无--</option>"; foreach (TF_CUSTOM_TEMPLATE template in templateList2) { if (template.STATUS == 1)//被选中 { selectedTempName = template.TEMPLATE_NAME; html += "<option value='" + template.ID + "' selected='selected'>" + template.TEMPLATE_NAME + "</option>"; } else { html += "<option value='" + template.ID + "'>" + template.TEMPLATE_NAME + "</option>"; } } ITableImplement itable2 = new ITableImplement(); itable2.setConn(conn).setModule(valObj2.TB_NAME); DataBaseField[] dataBaseFields = itable2.af_GetAvailableDataBaseField(); fieldHtml = "<ul>"; foreach (DataBaseField dataBaseField in dataBaseFields) { TF_TB_FIELD conf4 = new TF_TB_FIELD(); conf4.FIELD_NAME = dataBaseField.FieldName; TF_TB_FIELD val4 = BLLTable <TF_TB_FIELD> .GetRowData(conf4); if (val4 != null) { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + (string.IsNullOrEmpty(val4.NOTE)? dataBaseField.FieldName : val4.NOTE) + "</div></li>"; } else { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + dataBaseField.FieldName + "</div></li>"; } } fieldHtml += "</ul>"; // Response.Write("{\"html\":\"" + html + "\",\"fieldHtml\":\"" + fieldHtml + "\"}"); }
protected void Page_Load(object sender, EventArgs e) { ////id=1612&pid=161&no=1&name=%u8BE6%u7EC6%u5E03%u5C40&sc=0&ntype=TF_DESIGN_DETAIL&level=0111& // string id = HttpUtil.GetReqStrValue("id"); string pid = HttpUtil.GetReqStrValue("pid"); // string no = HttpUtil.GetReqStrValue("no"); // string name = HttpUtil.GetReqStrValue("name"); // string sc = HttpUtil.GetReqStrValue("sc"); // string ntype = HttpUtil.GetReqStrValue("ntype"); //DataBase db = DataBase.Factory(conn); //foreach (DataBaseTable dt1 in db.DataTables_USER) //{ // tableMap.Add(dt1.TableName,dt1.ZhName); //} TF_FORM conf1 = new TF_FORM(); conf1.FORM_ID = Convert.ToInt32(pid); TF_FORM val1 = new TF_FORM(); val1.TB_ID = 1; TF_FORM valObj1 = BLLTable<TF_FORM>.GetRowData(val1, conf1); TF_TABLE conf2 = new TF_TABLE(); conf2.TB_ID = valObj1.TB_ID; TF_TABLE val2 = new TF_TABLE(); val2.TB_NAME = ""; val2.CH_NAME = ""; val2.TB_ID = 0; TF_TABLE valObj2 = BLLTable<TF_TABLE>.GetRowData(val2, conf2); currTable = valObj2.TB_NAME; currZhTable = valObj2.CH_NAME; currTableId = valObj2.TB_ID; V_TF_TEMPLATE_TABLENAME conf = new V_TF_TEMPLATE_TABLENAME(); conf.Distinct = true; conf.USER_ID = Convert.ToInt32(userBase.StaffID); List<V_TF_TEMPLATE_TABLENAME> templateList = BLLTable<V_TF_TEMPLATE_TABLENAME>.Select(new V_TF_TEMPLATE_TABLENAME(), conf); foreach (V_TF_TEMPLATE_TABLENAME temp in templateList) { ITableImplement itable = new ITableImplement(); itable.setConn(conn).setModule(temp.TABLE_NAME); if (!tableMap.ContainsKey(temp.TABLE_NAME)) { tableMap.Add(temp.TABLE_NAME, temp.CH_NAME); } } TF_CUSTOM_TEMPLATE conf3 = new TF_CUSTOM_TEMPLATE(); conf3.TABLE_NAME = valObj2.TB_NAME; conf3.USER_ID = Convert.ToInt32(userBase.StaffID); conf3.TYPE = 0; List<TF_CUSTOM_TEMPLATE> templateList2 = BLLTable<TF_CUSTOM_TEMPLATE>.Select(new TF_CUSTOM_TEMPLATE(), conf3); html = "<option value='-1'>--无--</option>"; foreach (TF_CUSTOM_TEMPLATE template in templateList2) { if (template.STATUS == 1)//被选中 { selectedTempName = template.TEMPLATE_NAME; html += "<option value='" + template.ID + "' selected='selected'>" + template.TEMPLATE_NAME + "</option>"; } else { html += "<option value='" + template.ID + "'>" + template.TEMPLATE_NAME + "</option>"; } } ITableImplement itable2 = new ITableImplement(); itable2.setConn(conn).setModule(valObj2.TB_NAME); DataBaseField[] dataBaseFields = itable2.af_GetAvailableDataBaseField(); fieldHtml = "<ul>"; foreach (DataBaseField dataBaseField in dataBaseFields) { TF_TB_FIELD conf4 = new TF_TB_FIELD(); conf4.FIELD_NAME = dataBaseField.FieldName; TF_TB_FIELD val4 = BLLTable<TF_TB_FIELD>.GetRowData(conf4); if (val4 != null) { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + (string.IsNullOrEmpty(val4.NOTE)? dataBaseField.FieldName : val4.NOTE) + "</div></li>"; } else { fieldHtml += "<li><div fieldname='" + dataBaseField.FieldName + "'>" + dataBaseField.FieldName + "</div></li>"; } } fieldHtml += "</ul>"; // Response.Write("{\"html\":\"" + html + "\",\"fieldHtml\":\"" + fieldHtml + "\"}"); }