<%@ Page Language="C#" AutoEventWireup="true" CodeFile="db_manager.aspx.cs" Inherits="wormadmin_db_manager" validateRequest="false" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>数据库备份与还原</title>
    <link rel="stylesheet" href="css/content.css" type="text/css" />
       <style type="text/css">
		BODY { FONT-SIZE: 12px; COLOR: #000000 }
		TABLE { FONT-SIZE: 12px; COLOR: #000000 }
		TD { FONT-SIZE: 12px; COLOR: #000000 }
		FORM { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px }
		TD TD { PADDING-LEFT: 12px }
		A { COLOR: #000090 }
		A:hover { COLOR: #ff3333 }
		.InputTxt { BORDER-RIGHT: #333333 1px solid; BORDER-TOP: #333333 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #333333 1px solid; WIDTH: 120px; BORDER-BOTTOM: #333333 1px solid; HEIGHT: 18px }
		.Button { BORDER-RIGHT: #333333 1px solid; BORDER-TOP: #333333 1px solid; FONT-SIZE: 12px; BACKGROUND: #ffffff; BORDER-LEFT: #333333 1px solid; WIDTH: 32px; BORDER-BOTTOM: #333333 1px solid; HEIGHT: 16px }
		.TrHead { FONT-WEIGHT: 600; FONT-SIZE: 12px; BACKGROUND: #507cd1; COLOR: #ffffff; HEIGHT: 28px; TEXT-ALIGN: left }
		</style>
</head>
<body>
    <form id="form1" runat="server">
        &nbsp;<table border="0" cellpadding="0" cellspacing="0" width="90%">
            <tr>
                <td height="25">
                    <strong>数据库备份与还原:</strong></td>
            </tr>
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="90%">
            <tr>
                <td colspan="3">
                  <asp:GridView ID="myGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
                   SkinID="blueGrid" Width="800px"  OnRowCommand="btres_Click">
                  <Columns>
                      <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                      <asp:TemplateField HeaderText="备份数据" SortExpression="bkname">
                          <ItemTemplate>
                              <asp:Label ID="bkname" runat="server" Text='<%# Eval("bkname")%>'></asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                              <%# Eval("bkname")%>
                          </EditItemTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="备份路径" SortExpression="bkpath">
                          <ItemTemplate>
                              <asp:Label ID="bkpath" runat="server" Text='<%# Eval("bkpath")%>'></asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                              <asp:Label ID="bkpath" runat="server" Text='<%# Eval("bkpath")%>'></asp:Label>
                          </EditItemTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="备份时间" SortExpression="bktime">
                          <ItemTemplate>
                              <asp:Label ID="bktime" runat="server" Text='<%# Eval("bktime")%>'></asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                              <%# Eval("bktime")%>
                          </EditItemTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="还原时间" SortExpression="rstime">
                          <ItemTemplate>
                              <asp:Label ID="rstime" runat="server" Text='<%# Eval("rstime")%>'></asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                              <%# Eval("rstime")%>
                          </EditItemTemplate>
                      </asp:TemplateField>
                      
                      <asp:ButtonField Text="还原" ButtonType="Button" CommandName='res' HeaderText="还原数据库"/>
                      
                      <asp:TemplateField HeaderText="删除">
                          <HeaderTemplate>
                              <asp:CheckBox ID="delall" runat="server" AutoPostBack="True" OnCheckedChanged="delall_CheckedChanged" Text="删除" />                          </HeaderTemplate>
                          <ItemTemplate>
                              <asp:CheckBox ID="del" runat="server" Text="" /></ItemTemplate>
                          <EditItemTemplate>
                              <asp:CheckBox ID="del" runat="server" />                          </EditItemTemplate>
                          <FooterTemplate>
                              <asp:TextBox ID="del" runat="server" Text=''></asp:TextBox>
                          </FooterTemplate>
                      </asp:TemplateField>
                  </Columns>
              </asp:GridView>                </td>
            </tr>
			<tr>
                <td colspan="3" style="padding-top: 10px">
                    数据库名称：<asp:TextBox ID="btbkname" runat="server"></asp:TextBox>
                    <asp:Button ID="btbk" runat="server" Text="备份" OnClick="btbk_Click1" /></td>
            </tr>
            <tr>
                <td style="padding-top: 10px" width="190">
                    &nbsp;<webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CustomInfoHTML="当前  <font color='red'><b>%CurrentPageIndex%</b></font>/%PageCount%页&nbsp;&nbsp;记录位置:%StartRecordIndex%-%EndRecordIndex%"
                        CustomInfoTextAlign="Center" FirstPageText="首页" HorizontalAlign="Center" InputBoxStyle="width:19px"
                        LastPageText="尾页" meta:resourcekey="AspNetPager1" NextPageText="下页" OnPageChanged="pagego"
                        PageSize="12" PrevPageText="前页" ShowCustomInfoSection="Left" ShowInputBox="Always"
                        ShowNavigationToolTip="True" Style="font-size: 14px" Width="400px">
                    </webdiyer:AspNetPager>                </td>
                <td style="padding-left: 10px; width: 34px; padding-top: 10px" valign="bottom">
                    <asp:Button ID="Button2" runat="server" OnClick="Button1_Click" SkinID="blue" Text="全选" />                </td>
                <td style="padding-left: 10px; padding-top: 10px" width="422" valign="bottom">
                    <asp:Button ID="Button3" runat="server" OnClick="btdel_Click" OnClientClick="javascript:{if(confirm('是否确认删除这些数据库备份?')){return true;}return false;}"
                        SkinID="blue" Text="选中删除" /></td>
            </tr>
        </table>
    </form>
</body>
</html>
