<%@ Page Language="C#" AutoEventWireup="true" Inherits="WebApp.Admin.ServerList" CodeBehind="ServerList.aspx.cs" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head runat="server">
    <title>服务器维护</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCssEdit.htm" -->
    <script language="javascript" type="text/javascript">
		    function selectServer(val)
		    {
		        showModalDialog("selectServer.aspx?type=" + val,window, "dialogWidth:302px;dialogHeight:378px;help:no;scroll:no;status:no");		        
		    }
		    function BindSelect(type, txt, val)
		    {
		        if(type=="1")
		        {
		            document.all.txtServerName1.value = txt;
		            document.all.hiddenWebServer.value = val;
		        }
		        else
		        {
		            document.all.txtServerName2.value = txt;
		            document.all.hiddenSqlServer.value = val;
		        }
		    }
    </script>

</head>
<body>
    <div class="edit-func-box func-box">
        <form id="form1" runat="server">
        <div class="hd">
            WEB服务器维护</div>
        <div class="bd">
           <%-- <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    
                </div>
                <!--/action-field-->
            </div>--%>
            <asp:DataGrid ID="dgServer" runat="server" class="list-table" AutoGenerateColumns="False"
                DataKeyField="pkID" OnItemCommand="dgServer_ItemCommand" OnItemDataBound="dgServer_ItemDataBound">
                <Columns>
                    <asp:BoundColumn DataField="pkID" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="serverName" HeaderText="服务器标识" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="nickName" HeaderText="服务器简称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="连接状态" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlServerOnUsing" runat="server" SelectedValue='<%# DataBinder.Eval(Container, "DataItem.OnUsing") %>'
                                Enabled="False">
                                <asp:ListItem Value="0">已断开</asp:ListItem>
                                <asp:ListItem Value="1">已连接</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="remark" HeaderText="说明" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:LinkButton ID="ediServer" runat="server" CausesValidation="false" CommandName="edit">编辑</asp:LinkButton>
                            &nbsp;
                            <asp:LinkButton ID="delServer" runat="server" CommandName="delete" CausesValidation="false"
                                CommandArgument='<%# DataBinder.Eval(Container, "DataItem.serverName") %>'>删除</asp:LinkButton>
                            &nbsp;
                            <asp:LinkButton ID="editService" runat="server" CausesValidation="false" CommandName="service">服务管理</asp:LinkButton>
                            &nbsp;
                            <asp:HyperLink ID="hplViewWebSite" runat="server" NavigateUrl='<%# "WebSiteList.aspx?serverId="+Eval("pkId")+"&name=" + Eval("serverName") %>'>查看子站列表</asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
        </div>
        <div class="ft">
            <div class="pagination">
                <asp:Label ID="lblServerPage" runat="server"></asp:Label>
            </div>
            <!--/action-field-->
        </div>
        <div id="trInput" runat="server">
            <table class="edit-table">
                <tr>
                    <th width="25%">
                        服务器标识：
                    </th>
                    <td width="75%">
                        <asp:TextBox ID="txtServerName" runat="server" CssClass="input-txt input-txt3" Enabled="False"
                            ReadOnly="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        服务器简称：
                    </th>
                    <td>
                        <asp:TextBox ID="txtNickname" runat="server" CssClass="input-txt input-txt3"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        说明：
                    </th>
                    <td>
                        <asp:TextBox ID="txtRemark" runat="server" CssClass="input-txt input-txt3"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <input id="serverPkId" runat="server" name="serverPkId" type="hidden" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtServerName"
                Display="None" ErrorMessage="请输入服务器的计算机名称。"></asp:RequiredFieldValidator>
        </div>
        <div id="trButton" runat="server" class="ft">
            <div class="action-field txt-c">
                <asp:Button ID="btnAddServer" runat="server" CssClass="btn" Text="添加" OnClick="btnAddServer_Click" />
                &nbsp;
                <asp:Button ID="btnCancelServer" runat="server" CssClass="btn" Text="取消" CausesValidation="false"
                    OnClick="btnCancelServer_Click" />&nbsp;
                <asp:Button ID="btnSaveServer" runat="server" CssClass="btn" Text="保存表格" Visible="false"
                    CausesValidation="false" />
            </div>
        </div>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" />
        </form>
    </div>
</body>
</html>
