最終效果圖:(用於學習類的效果 醜了點,看官莫怪)
新建窗體 然後在前端適當位置插入如下**:
"後端**:departmenttree
" height="
500" width="
500">
"">
"center
" fontsize="
14" text="
" margin="
2,0,0,0
">
publicclass
departmentmodel
public
departmentmodel()
public
int id //
idpublic
string deptname //
部門名稱
public
int parentid //
父類id
}
public上述主要**為【遞迴生成樹形資料】方法partial
class
testwin : window
//////
獲取部門列表--測試
/// ///
public listgetdepts() ,
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel(),
new departmentmodel()
};return
dplst;
}//////
遞迴生成樹形資料
/// ///
///public listgettrees(int parentid, listnodes)
return
mainnodes;}}
本人第一次寫技術部落格
望各位高手不吝賜教
樹形資料生成XML
樹形資料生成xml if exists select from dbo.sysobjects where id object id n dbo f xml lr and xtype in n fn n if n tf drop function dbo f xml lr goif exists se...
sql樹形資料生成xml
樹形資料生成xml if exists select from dbo.sysobjects where id object id n dbo f xml lr and xtype in n fn n if n tf drop function dbo f xml lr goif exists se...
sql樹形資料生成xml
樹形資料生成xml if exists select from dbo.sysobjects where id object id n dbo f xml lr and xtype in n fn n if n tf drop function dbo f xml lr goif exists se...