Drop-down menu for current location of the simulated dynamic network
The Code is as follows:
Public string GetBoardDropDownList (int paraParentID)
{
String BoardText = "<script language = \" javascript \ "type = \" text/javascript \ "> ";
BoardText + = "var boardxml = '<? Xml version = \ "1.0 \" encoding = \ "gb2312 \"?> ";
BoardText + = "<BoardList> ";
BoardText + = BoardRec (0 );
BoardText + = "</BoardList> '; </script> ";
Return BoardText;
}
Public string BoardRec (int paraParentID)
{
String BoardText = "";
DataSet ds1 = myCData. GetDataSet ("select * from DV_Board where ParentID =" + paraParentID + "order by orders Asc", 0, "TableName ");
For (int j = 0; j <ds1.Tables [0]. Rows. Count; j ++)
{
Int BoardID = Convert. ToInt32 (ds1.Tables [0]. Rows [j] ["BoardID"]);
String BoardType = ds1.Tables [0]. Rows [j] ["BoardType"]. ToString ();
Int Parentid = Convert. ToInt32 (ds1.Tables [0]. Rows [j] ["parentid"]);
Int Depth = Convert. ToInt32 (ds1.Tables [0]. Rows [j] ["depth"]);
Int Rootid = Convert. ToInt32 (ds1.Tables [0]. Rows [j] ["rootid"]);
Int Child = Convert. ToInt32 (ds1.Tables [0]. Rows [j] ["child"]);
Int Hidden = 0;
Int Nopost = 0;
If (Child = 0)
{
Nopost = 0;
BoardText + = "<board boardid = \" "+ BoardID +" \ "boardtype = \" "+ BoardType +" \ "parentid = \" "+ Parentid +" \ "depth = \ "" + Depth + "\" rootid = \ "" + Rootid + "\" child = \ "" + Child + "\" hidden = \ "" + Hidden + "\" nopost = \ "" + Nopost + "\"> </board> ";
}
Else
{
Nopost = 1;
BoardText + = "<board boardid = \" "+ BoardID +" \ "boardtype = \" "+ BoardType +" \ "parentid = \" "+ Parentid +" \ "depth = \ "" + Depth + "\" rootid = \ "" + Rootid + "\" child = \ "" + Child + "\" hidden = \ "" + Hidden + "\" nopost = \ "" + Nopost + "\"> ";
BoardText + = BoardRec (BoardID );
BoardText + = "</board> ";
}
}
Ds1.Clear ();
Return BoardText;
}
Public string GetBoardPostioin (string paraBBSName, int parabardid)
{
String BoardText = "";
BoardText = "<a href = 'index. aspx 'onmouseover = \ "showmenu (event, BoardJumpList (0),'', 0); \ ">" + paraBBSName + "</a> ";
BoardText + = GetBoardPostioinRec (paraBoardID );
Return BoardText;
}
Public string GetBoardPostioinRec (int paraParentID)
{
String BoardText = "";
If (paraParentID! = 0)
{
DataSet ds1 = myCData. GetDataSet ("select * from DV_Board where BoardID =" + paraParentID + "order by orders Asc", 0, "TableName ");
If (ds1.Tables [0]. Rows. Count> 0)
{
If (Convert. ToInt32 (ds1.Tables [0]. Rows [0] ["Child"])> 0)
{
BoardText = "→ <a href = 'index. aspx? BoardID = "+ ds1.Tables [0]. rows [0] ["BoardID"]. toString () + "'onmouseover = \" showmenu (event, BoardJumpList ("+ ds1.Tables [0]. rows [0] ["BoardID"]. toString () + "),'', 0); \ ">" + ds1.Tables [0]. rows [0] ["BoardType"]. toString () + "</a> ";
}
Else
{
BoardText = "→ <a href = 'index. aspx? BoardID = "+ ds1.Tables [0]. rows [0] ["BoardID"]. toString () + "'>" + ds1.Tables [0]. rows [0] ["BoardType"]. toString () + "</a> ";
}
BoardText = GetBoardPostioinRec (Convert. ToInt32 (ds1.Tables [0]. Rows [0] ["ParentID"]) + BoardText;
}
Ds1.Clear ();
}
Return BoardText;
}