<%@ Page Language="C#" AutoEventWireup="true" Inherits="WebApp.Admin.WebSiteList"
    CodeBehind="WebSiteList.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" -->
</head>
<body>
    <div class="edit-func-box func-box">
        <form id="form1" runat="server">
        <div class="hd">
            <asp:Label ID="lblTitle" runat="server"></asp:Label>
        </div>
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnBack" runat="server" Text="返回" OnClick="btnBack_Click" />
                </div>
                <!--/action-field-->
            </div>
            <asp:DataGrid ID="dgWebSite" runat="server" class="list-table" AutoGenerateColumns="False"
                DataKeyField="pkID" OnItemCommand="dgWebSite_ItemCommand">
                <Columns>
                    <asp:TemplateColumn HeaderText="选择" HeaderStyle-CssClass="title" Visible="False">
                        <ItemTemplate>
                            <asp:CheckBox ID="cbxCheck" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="pkID" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="applyID" HeaderText="子站ID" Visible="False" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="SchoolName" HeaderText="子站名称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="域名" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:HyperLink ID="linkSchool" runat="server" NavigateUrl='<%# GetDomainName(Convert.ToInt32(DataBinder.Eval(Container, "DataItem.applyID").ToString())) %>'
                                Target="_blank" Text='<%# DataBinder.Eval(Container, "DataItem.domainName") %>'> 
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="IP" HeaderText="IP" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="Port" HeaderText="端口" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="dbIP" HeaderText="数据库IP" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="dbName" HeaderText="数据库名称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="webState" HeaderText="网站状态" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="执行" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:LinkButton ID="btnDetail" runat="server" CommandName="Detail">详细信息</asp:LinkButton>
                            <asp:LinkButton ID="btnDel" runat="server" CommandName="Del" Visible="False">删除</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="webId" HeaderText="webId" Visible="False" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="dbId" HeaderText="dbId" Visible="False" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
        </div>
        <div class="ft">
            <div class="pagination">
                <asp:Label ID="lblSqlPage" runat="server"></asp:Label>
            </div>
            <!--/action-field-->
        </div>
        </form>
    </div>

</body>
</html>

<script language="javascript">
			function showDetail(id)
			{
				showModalDialog("WebDetail.aspx?applyID="+id,window, "dialogWidth:760px;dialogHeight:500px;help:no;scroll:no;status:no");
			}
			
			
			function ShowOperate(type)
			{
			   
			    switch(type)
			    {
			        case 0:
			            document.getElementById("trDelIIS").style.display = "";
			            document.getElementById("trReCreateWeb").style.display = "none";
			            document.getElementById("trEditIIS").style.display = "none";
			            break;
			        case 1:
			            document.getElementById("trDelIIS").style.display = "none";
			            document.getElementById("trReCreateWeb").style.display = "";
			            document.getElementById("trEditIIS").style.display = "none";
			            break;
			        case 2:
			            document.getElementById("trDelIIS").style.display = "none";
			            document.getElementById("trReCreateWeb").style.display = "none";
			            document.getElementById("trEditIIS").style.display = "";
			            break;
			    }
			}
</script>

