private void createpostTypeListHTML() { string str = ""; XYECOM.Business.Post p = new XYECOM.Business.Post(); DataTable dt = p.GetDataTable(0); DataTable dt1 = p.GetDataTable(-1); for (int i = 0; i < dt.Rows.Count; i++) { str += " <li class=\""; dt1.DefaultView.RowFilter = "P_ParentID=" + dt.Rows[i]["P_ID"].ToString(); DataView dv1 = dt1.DefaultView; if (dv1.Count > 0) str += "shrink"; else str += "sublast"; str += "\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["P_ID"].ToString() + ",this);\">" + dt.Rows[i]["P_Name"].ToString() + "</a></li>"; } Response.Write(str); }
private void CreatepostTypeHTML(int P_ID) { try { string str = ""; string strlist = ""; XYECOM.Model.PostInfo ep = new XYECOM.Model.PostInfo(); XYECOM.Business.Post p = new XYECOM.Business.Post(); if (P_ID == 0) { str += "请选择岗位名称"; strlist += "<a href=\"#\" onclick=\"selecttypelist(0,this);\">请选择岗位名称</a>"; } else { ep = p.GetItem(P_ID); str += ep.P_Name.ToString(); strlist += "<a href=\"#\" onclick=\"selecttypelist(" + ep.P_ID.ToString() + ",this);\">" + ep.P_Name.ToString() + "</a>"; } str += "$"; DataTable dt; dt = p.GetDataTable(P_ID); DataTable dt1 = p.GetDataTable(-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]["P_ID"].ToString() + ",'" + dt.Rows[i]["P_Name"].ToString() + "');\">" + dt.Rows[i]["P_Name"].ToString() + "</a>"; strlist += "<li class=\""; dt1.DefaultView.RowFilter = "P_ParentID=" + dt.Rows[i]["P_ID"].ToString(); DataView dv1 = dt1.DefaultView; if (dv1.Count > 0) strlist += "shrink\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["P_ID"].ToString() + ",this);\">" + dt.Rows[i]["P_Name"].ToString() + "</a></li>"; else strlist += "sublast\" >" + dt.Rows[i]["P_Name"].ToString() + "</li>"; } strlist += "</ul>"; } else { str += " "; } str += "$"; str += strlist; Response.Write(str); } catch (Exception ex) { Response.Write(ex.Message.Replace("\n", "")); } }