62,046
社区成员
发帖
与我相关
我的任务
分享
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel4" runat="server"
Width="124px" Height="16px">*一级单位:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DP_Depart1" runat="server" Width="222px"
AutoPostBack="True" onselectedindexchanged="DP_Depart1_SelectedIndexChanged">
</asp:DropDownList>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel5" runat="server"
Width="124px" Height="16px">二级单位:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:DropDownList ID="DP_Depart2" runat="server" Width="222px" Enabled="False">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</TD>
<TD class="style10">
</TD>
</TR>
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager1.RegisterAsyncPostBackControl(DP_Depart1);
if (!IsPostBack)
{
Bind_DP();
}
}
void Bind_DP()//绑定部门信息列表
{
DataCollection<DepartInfo1SDO> depart1collection = getDepart1Service().FindByAll();
foreach (DepartInfo1SDO depart1 in depart1collection)
{
if (depart1 is DepartInfo1SDO)
{
DP_Depart1.Items.Add(depart1.DepartName);
}
}
}
protected void DP_Depart1_SelectedIndexChanged(object sender, EventArgs e)
{
string depart1 = DP_Depart1.SelectedValue.ToString();
DataCollection<DepartInfo1SDO> depart1collection = getDepart1Service().FindByDepartName(depart1);
Guid guid = Guid.Empty;
if (depart1collection != null)
{
foreach (DepartInfo1SDO depart in depart1collection)
{
if (depart is DepartInfo1SDO)
{
guid = depart.DepartID;
}
}
}
DataCollection<DepartInfo2SDO> depart2collection = getDepart2Service().FindByParentID(guid);
if (depart2collection != null && depart2collection.Count > 0)
{
DP_Depart2.Enabled = true;
foreach (DepartInfo2SDO depart2 in depart2collection)
{
DP_Depart2.Items.Add(depart2.DepartName);
}
}
else
{
setJS("该单位下没有子单位信息!");
DP_Depart2.Enabled = false;
DP_Depart2.Items.Clear();
}
UpdatePanel1.Update();
}
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table id="Table3" style="WIDTH: 373px; HEIGHT: 160px" cellspacing="1" bordercolorDark="steelblue"
cellpadding="1" align="center" border="1" runat="server">
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel4" runat="server"
Width="124px" Height="16px">*一级单位:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:DropDownList ID="DP_Depart1" runat="server" Width="222px"
AutoPostBack="True" onselectedindexchanged="DP_Depart1_SelectedIndexChanged">
</asp:DropDownList>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel5" runat="server"
Width="124px" Height="16px">二级单位:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:DropDownList ID="DP_Depart2" runat="server" Width="222px" Enabled="False"
AutoPostBack="True" onselectedindexchanged="DP_Depart2_SelectedIndexChanged">
</asp:DropDownList>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel6" runat="server"
Width="124px" Height="16px">三级单位:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:DropDownList ID="DP_Depart3" runat="server" Width="222px" Enabled="False">
</asp:DropDownList>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel7" runat="server"
Width="124px" Height="16px">录像机IP地址:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:TextBox ID="TB_IPAddress" runat="server" Width="222px" onblur="FormCheck()" ></asp:TextBox>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel8" runat="server"
Width="124px" Height="16px">通道号数量:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:TextBox ID="TB_DvrChanCount" runat="server" Width="89px" ></asp:TextBox>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel9" runat="server"
Width="124px" Height="16px">访问帐号:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:TextBox ID="TB_AccessName" runat="server" Width="222px"></asp:TextBox>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="right" class="style7">
<asp:label id="lblDepartLevel10" runat="server"
Width="124px" Height="16px">访问密码:</asp:label></TD>
<TD style="HEIGHT: 32px">
<asp:TextBox ID="TB_AccessPassword" runat="server" Width="222px"
Font-Bold="True" TextMode="Password"></asp:TextBox>
</TD>
<TD class="style10">
</TD>
</TR>
<TR>
<TD align="center" colSpan="2">
<asp:button id="btnAdd" runat="server" Height="24px"
Width="96px" Text="保存" onclick="btnAdd_Click"></asp:button>
<asp:button id="btnReturn" runat="server" Height="24px" Width="92px" Text="返回"
CausesValidation="False" onclick="btnReturn_Click"></asp:button></TD>
<TD align="center" class="style8"> </TD>
</TR>
</TABLE>
</ContentTemplate>
</asp:UpdatePanel>
protected void DP_Depart1_SelectedIndexChanged(object sender, EventArgs e)
{
string depart1 = DP_Depart1.SelectedValue.ToString();
DataCollection<DepartInfo1SDO> depart1collection = getDepart1Service().FindByAll();
DepartInfo1SDO getDepart1ID = depart1collection.Find(new Predicate<DepartInfo1SDO>(delegate(DepartInfo1SDO obj) { return obj.DepartName == depart1; }));
DataCollection<DepartInfo2SDO> depart2collection = getDepart2Service().FindByParentID(getDepart1ID.DepartID);
if (depart2collection != null && depart2collection.Count > 0)
{
DP_Depart2.Enabled = true;
foreach (DepartInfo2SDO depart2 in depart2collection)
{
DP_Depart2.Items.Add(depart2.DepartName);
}
}
else
{
setJS("该单位下没有子单位信息!");
DP_Depart2.Enabled = false;
DP_Depart2.Items.Clear();
}
}