<%@ Import Namespace="SWTraining" %>

<%@ Page Language="c#" CodeBehind="Backup.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Admin_Backup"
    Title="系统设置-数据备份" %>

<!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 id="Head1" runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div class="divpanel">
        <table class="table" cellspacing="0">
            <tr>
                <th colspan="2" align="center">
                    数据库备份与恢复
                </th>
            </tr>
            <tr>
                <td style="width: 162px">
                    备份路径：
                </td>
                <td>
                    <asp:TextBox ID="tbxBackupPath" runat="server" Enabled="False" Width="424px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 162px">
                    数据备份：
                </td>
                <td>
                    备份说明：
                    <asp:TextBox ID="tbxRemark" runat="server" Width="99px"></asp:TextBox>
                        <label class="lab_buttom">
<asp:Button ID="btnBackup" runat="server" Text="备份" OnClick="btnBackup_Click"></asp:Button>
</label>
                </td>
            </tr>
            <tr>
                <td style="width: 162px">
                    备份列表：
                </td>
                <td>
                    <asp:GridView ID="GridView1" CssClass="smallgridview" runat="server" AutoGenerateColumns="False"
                        Width="50%" OnRowDeleting="GridView1_RowDeleting" DataKeyNames="FileName" OnRowCommand="GridView1_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="DateAndTime" HeaderText="备份日期" />
                            <asp:BoundField DataField="FileName" HeaderText="文件名" />
                            <asp:TemplateField HeaderText="下载">
                                <ItemTemplate>
                                    <asp:HyperLink ID="hlkDown" runat="server" Text="下载" NavigateUrl='<%# string.Format("DownDb.aspx?fileName={0}",Eval("FileName")) %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="还原">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbn00" runat="server" Text="还原" CommandName="restore" CommandArgument='<%#Eval("FileName") %>'
                                        OnClientClick='<%# string.Format(@"return confirm(""你确定将数据还原到{0}？"");",Eval("DateAndTime"))%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="删除">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="delete" OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="width: 162px">
                    上传备份：
                </td>
                <td>
                    <asp:FileUpload ID="fudFile" runat="server" />
                        <label class="lab_buttom">
<asp:Button ID="btnFTP" runat="server" OnClick="btnFTP_Click" Text="上传" />
</label>
                </td>
            </tr>
            <tr>
                <td style="width: 162px">
                    提示信息：
                </td>
                <td>
                    <asp:Label ID="labMsg" runat="server" EnableViewState="False" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <th colspan="2">
                    EXCEL导入数据
                </th>
            </tr>
            <tr>
                <td style="width: 162px">
                    导入潜在学员信息：
                </td>
                <td>
                    <a href="ExcelImport2.aspx" target="_blank">[导入]</a>
                </td>
            </tr>
            <tr>
                <td style="width: 162px">
                    导入正式学员信息：
                </td>
                <td>
                    <a href="ExcelImport.aspx" target="_blank">[导入]</a>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
