<%@ Import Namespace="MTCUN" %>

<%@ Page Language="c#" CodeBehind="Backup.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.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_button">
                            <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="60%" OnRowDeleting="GridView1_RowDeleting" DataKeyNames="FileName" OnRowCommand="GridView1_RowCommand">
                            <Columns>
                                <asp:BoundField DataField="DateAndTime" HeaderText="备份日期" />
                                <asp:BoundField DataField="FileName" HeaderText="文件名" />
                                <asp:TemplateField HeaderText="下载">
                                    <ItemTemplate>
                                        <div class="lab_button_sub" id="divhlk" runat="server">
                                            <asp:HyperLink ID="hlkDown" runat="server" Text="下载" NavigateUrl='<%# string.Format("DownDb.aspx?fileName={0}",Eval("FileName")) %>'></asp:HyperLink>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="还原">
                                    <ItemTemplate>
                                        <div class="lab_button_sub" id="div00" runat="server">
                                            <asp:LinkButton ID="lbn00" runat="server" Text="还原" CommandName="restore" CommandArgument='<%#Eval("FileName") %>'
                                                OnClientClick='<%# string.Format(@"return confirm(""你确定将数据还原到{0}？"");",Eval("DateAndTime"))%>'></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="删除">
                                    <ItemTemplate>
                                        <div class="lab_button_sub" id="divDelete" runat="server">
                                            <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="delete" OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td style="width: 162px">上传备份：
                    </td>
                    <td>
                        <asp:FileUpload ID="fudFile" runat="server" />
                        <label class="lab_button">
                            <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>
            </table>
        </div>
    </form>
</body>
</html>
