protected override void BindData() { this.btnok.Attributes.Add("onclick", "javascript:return AddLabel();"); XYECOM.Business.LabelType lt = new XYECOM.Business.LabelType(); XYECOM.Model.LabelTypeInfo elt = new XYECOM.Model.LabelTypeInfo(); string ltId = Request.QueryString["LT_ID"]; this.title.InnerHtml = "标签分类添加"; if (!string.IsNullOrEmpty(ltId)) { int infoId = XYECOM.Core.MyConvert.GetInt32(ltId); elt = lt.GetItem(infoId); if (elt != null) { LT_ID = elt.LT_ID; this.tbName.Text = elt.LT_Name; this.tbRemark.Text = elt.LT_Remark; this.title.InnerHtml = "标签分类编辑"; } } }
void CreateLabelTypeHTML(int LT_ID) { try { string str = ""; string strlist = ""; XYECOM.Model.LabelTypeInfo el = new XYECOM.Model.LabelTypeInfo(); XYECOM.Business.LabelType lt = new XYECOM.Business.LabelType(); if (LT_ID == 0) { str += "请选择标签分类"; strlist += "<a href=\"#\" onclick=\"selecttypelist(0,this);\">请选择标签分类</a>"; } else { el = lt.GetItem(LT_ID); str += el.LT_Name; strlist += "<a href=\"#\" onclick=\"selecttypelist(" + el.LT_ID + ",this);\">" + el.LT_Name + "</a>"; } str += "$"; DataTable dt = lt.GetDataTable("where LT_ParentID=" + LT_ID); DataTable dt1 = lt.GetDataTable(" where 1=1 "); if (dt.Rows.Count > 0) { strlist += " <ul class=\"subset\">"; for (int i = 0; i < dt.Rows.Count; i++) { str += " <a href=\"#\" title=\"点击选择此项\" onclick=\"selecttypeinfo(" + dt.Rows[i]["LT_ID"].ToString() + ",'" + dt.Rows[i]["LT_Name"].ToString() + "');\">" + dt.Rows[i]["LT_Name"].ToString() + "</a>"; strlist += "<li class=\""; dt1.DefaultView.RowFilter = "LT_ParentID=" + dt.Rows[i]["LT_ID"].ToString(); DataView dv1 = dt1.DefaultView; if (dv1.Count > 0) strlist += "shrink\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["LT_ID"].ToString() + ",this);\">" + dt.Rows[i]["LT_Name"].ToString() + "</a></li>"; else strlist += "sublast\" >" + dt.Rows[i]["LT_Name"].ToString() + "</li>"; } strlist += "</ul>"; } else { str += " "; } str += "$"; str += strlist; Response.Write(str); } catch (Exception ex) { Response.Write(ex.Message.Replace("\n", "")); } }