📄 test.aspx
字号:
<%@ Page Language="VB" Debug="true" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<%@ import Namespace="system.data" %>
<%@ import Namespace="system.data.sqlclient" %>
<script runat="server">
dim Cnn as sqlconnection
Shared DTable as new datatable
dim cmd as sqlcommand
Sub Page_Load(Sender As Object, E As EventArgs)
dim theNode as TreeNode
dim curNode as TreeNode
dim curNode1 as TreeNode
dim curNode2 as TreeNode
dim sql as string
dim datar as sqldatareader
dim datar1 as sqldatareader
dim datar2 as sqldatareader
dim datar3 as sqldatareader
dim theindex as integer
dim Cnn1 as sqlconnection
dim Cnn2 as sqlconnection
dim Cnn3 as sqlconnection
if dtable.columns.count=0 then
dtable.columns.add("code",System.Type.GetType("System.String"))
dtable.columns.add("name",system.type.gettype("System.String"))
dtable.columns.add("hzname",system.type.gettype("System.String"))
dim thekey() as datacolumn={dtable.columns("code")}
dtable.primarykey=thekey
bindgrid()
end if
cnn=new sqlconnection(configurationsettings.appsettings("connection"))
cnn1=new sqlconnection(configurationsettings.appsettings("connection"))
cnn2=new sqlconnection(configurationsettings.appsettings("connection"))
cnn3=new sqlconnection(configurationsettings.appsettings("connection"))
cnn.open()
cnn1.open()
cnn2.open()
cnn3.open()
sql="select * from fc_lp order by code"
cmd=new sqlcommand(sql,cnn)
datar=cmd.executereader()
do while datar.read()
thenode=new treenode()
thenode.text=datar("name")
thenode.checkbox="true"
treeview1.nodes.add(thenode)
curnode=treeview1.getnodefromindex(thenode.getnodeindex())
sql="select * from fc_lg where lpcode='" & datar("code") & "' order by code"
cmd=new sqlcommand(sql,cnn1)
datar1=cmd.executereader()
do while datar1.read()
thenode=new treenode()
thenode.text=datar1("name")
thenode.checkbox="true"
curnode.nodes.add(thenode)
curnode1=treeview1.getnodefromindex(thenode.getnodeindex())
sql="select code,name from fw_para where type='LT' and code in (select ltcode from fc_cell where lgcode='" & datar1("code") & "') order by code"
cmd=new sqlcommand(sql,cnn2)
datar2=cmd.executereader()
do while datar2.read()
thenode=new treenode()
thenode.text=datar2("name")
thenode.checkbox="true"
curnode1.nodes.add(thenode)
curnode2=treeview1.getnodefromindex(thenode.getnodeindex())
sql="select code,name from fc_cell where ltcode='" & datar2("code") & "' and lgcode='" & datar1("code") & "' order by code"
cmd=new sqlcommand(sql,cnn3)
datar3=cmd.executereader()
do while datar3.read()
thenode=new treenode()
thenode.text=datar3("name") & "(" & datar3("code") & ")"
thenode.checkbox="true"
curnode2.nodes.add(thenode)
loop
datar3.close()
loop
datar2.close()
loop
datar1.close()
loop
End Sub
Sub BindGrid()
datagrid1.datasource=dtable
datagrid1.databind()
End Sub
Sub Add_Click(Sender As Object, E As EventArgs)
end sub
Sub Del_Click(Sender As Object, E As EventArgs)
end sub
Sub Grid1_PageIndexChanged(Sender As Object, E As DataGridPageChangedEventArgs)
datagrid1.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub
</script>
<html>
<head>
<title>test</title>
<link href="../Main.css" type="text/css" rel="stylesheet" />
<script language="javascript">
</script>
</head>
<body leftmargin="0" background="images/1.jpg">
<form runat="server">
<asp:Panel id="Panel1" runat="server" BorderStyle="Solid" BorderWidth="1px" style="Z-INDEX: 101; LEFT: 0px; OVERFLOW: auto; POSITION: absolute; TOP: 0px " Width="308px" Height="366px">
<iewc:TreeView id="TreeView1" runat="server" SystemImagesPath="images/" style="Z-INDEX: 114; LEFT: 24px; POSITION: absolute; TOP: 8px" Width="280px" Height="350px">
</iewc:TreeView>
</asp:Panel>
<asp:button id="AddBtn" onclick="Add_Click" runat="server" text="==>" style="Z-INDEX: 101; LEFT: 335px; OVERFLOW: auto; POSITION: absolute; TOP: 150px "></asp:button>
<asp:button id="DelBtn" onclick="Del_Click" runat="server" text="<==" style="Z-INDEX: 101; LEFT: 335px; OVERFLOW: auto; POSITION: absolute; TOP: 250px "></asp:button>
<asp:Panel id="Panel3" runat="server" BorderStyle="Solid" BorderWidth="1px" style="Z-INDEX: 101; LEFT: 400px; OVERFLOW: auto; POSITION: absolute; TOP: 0px " Width="308px" Height="366px">
<asp:DataGrid id="DataGrid1" runat="server" width="100%" PageSize="6" AutoGenerateColumns="False" headerstyle-backcolor="#F8FAFC" font-size="8pt" font-name="verdana" cellpadding="2" bordercolor="Black" Font-Names="verdana" AllowPaging="True" AllowSorting="True" OnPageIndexChanged="Grid1_PageIndexChanged">
<HeaderStyle font-bold="True" horizontalalign="Center" verticalalign="Middle" backcolor="#F8FAFC"></HeaderStyle>
<PagerStyle nextpagetext="下一页" font-names="宋体" font-bold="True" prevpagetext="上一页" horizontalalign="Right" forecolor="Blue" position="Top" mode="NumericPages"></PagerStyle>
<EditItemStyle backcolor="#E9F0F8"></EditItemStyle>
<Columns>
<asp:BoundColumn visible="false" DataField="Code" HeaderText="单元编号"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" HeaderText="单元名称"></asp:BoundColumn>
<asp:BoundColumn DataField="hzname" HeaderText="户 主"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</asp:Panel>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -