<%@ Page Language="c#" Inherits="WebApp.Wpdcc.Web12Control" CodeBehind="WebControl.aspx.cs" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>网站运行控制</title>
    <meta name="description" content="网站运行控制" />
    <!--#include file = "../assets/head.htm" -->

</head>
<body class="no-skin">
    <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    主页
                </li>
                <li>站点管理</li>
                <li class="active">站点运行控制</li>
            </ul>
            <!-- /.breadcrumb -->

            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->

        <div class="page-content">
            <!-- PAGE CONTENT BEGINS -->

            <form id="frmWebControl" method="post" runat="server">
                <div class="page-header">
                    <asp:DropDownList ID="ddlServerList" runat="server" CssClass=""></asp:DropDownList>
                    &nbsp;
                    <asp:Button ID="btnQuery" CssClass="btn btn-sm btn-primary" runat="server" OnClick="btnQuery_Click" Text="查看" />
                </div>

                <div class="row">
                    <div class="col-xs-12">
                        <asp:DataGrid ID="webList" runat="server" AutoGenerateColumns="False" class="table table-striped table-bordered"
                            DataKeyField="pkID" OnItemCommand="webList_ItemCommand" OnItemDataBound="webList_ItemDataBound">
                            <Columns>
                                <asp:BoundColumn DataField="pkID" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:BoundColumn Visible="False" DataField="applyID" HeaderText="网站ID" 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())) %>'
                                            Text='<%# DataBinder.Eval(Container, "DataItem.domainName") %>' Target="_blank">
                                        </asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="web信息" HeaderStyle-CssClass="title">
                                    <ItemTemplate>
                                        <asp:Label ID="lblWebInfo" runat="server" Style="cursor: default" Text='<%# DataBinder.Eval(Container, "DataItem.IP") + ":" + DataBinder.Eval(Container, "DataItem.port") %>'
                                            ToolTip='<%# "IP：" + DataBinder.Eval(Container, "DataItem.IP") + "\r\n端口：" + DataBinder.Eval(Container, "DataItem.port") %>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="数据库信息" HeaderStyle-CssClass="title">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDBInfo" runat="server" Style="cursor: default" Text='<%# DataBinder.Eval(Container, "DataItem.dbIP") %>'
                                            ToolTip='<%# "数据库IP：" + DataBinder.Eval(Container, "DataItem.dbIP") + "\r\n数据库名称：" + DataBinder.Eval(Container, "DataItem.dbName") %>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:BoundColumn Visible="False" DataField="webState" HeaderText="网站状态" HeaderStyle-CssClass="title"></asp:BoundColumn>
                                <asp:TemplateColumn HeaderText="执行" HeaderStyle-CssClass="title">
                                    <ItemTemplate>
                                        
                                        <asp:LinkButton ID="btnRun" runat="server" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.schoolName") %>' CommandName="operate">运行</asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" CssClass="FBox" href='<%# Eval("applyID","editregister.aspx?applyID={0}")%>' >编辑</asp:LinkButton>                                      
                                        &nbsp;
                                        <asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.schoolName") %>' CommandName="Delete">删除</asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="btnDetail" runat="server" CommandName="Detail" CssClass="FBox" href='<%# Eval("applyID","webdetail.aspx?applyID={0}")%>'>详细信息</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 class="clearfix">
                            <div class="col-xs-12">
                                <asp:Label ID="lblPage" runat="server"></asp:Label>
                            </div>
                        </div>
                    </div>
                    </div>
            </form>
        </div>
    <input id="Hidden1" runat="server" type="hidden" value="-1" />
    </div>
    <!--#include file = "../assets/foot.htm" -->
    <script lang="javascript" type="text/javascript">
        jQuery(function ($) {
            //编辑：打开弹出层
            $(".FBox").click().fancybox({
                autoSize:false,
                'width': 1000,
                'height': 630,
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0'
            });

        });
    </script>
</body>
</html>
