<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManagePledges.aspx.cs" Inherits="Admin_ManagePledges" %>

<!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>Manage Pledges</title>
            <link href="../Styles/MSStyles_Main.css" type="text/css" rel="Stylesheet" />

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    
    
<asp:Panel ID="pnlContent" runat="server" style="margin: 10px; padding: 10px;" HorizontalAlign="Left" Width="80%" BackColor="#233052">   
    
        <h1>Pledges Manager</h1>
    
        <asp:GridView ID="gvPledges" runat="server" DataSourceID="dsPledges"
        AlternatingRowStyle-BackColor="#CCCCCC" AlternatingRowStyle-ForeColor="Black"
        AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
        GridLines="Horizontal" DataKeyNames="ID" CellPadding="5" CellSpacing="2" 
        BorderColor="Gray" BorderWidth="1px" BorderStyle="Inset" Width="80%" 
        PageSize="50" AllowPaging="True" AllowSorting="True">
        
            <AlternatingRowStyle BackColor="#CCCCCC" ForeColor="Black" />
        </asp:GridView>
        
        <asp:HyperLink ID="btnExcel" runat="server" Text="Download List" NavigateUrl="~/Admin/PledgeList.aspx" Target="_blank" />(right-click save-as)
        <asp:SqlDataSource ID="dsPledges" runat="server" 
         SelectCommand="SELECT ID, EmailAddress, DateAdded, User_IP FROM Pledges ORDER BY DateAdded DESC" SelectCommandType="Text"
         DeleteCommand="DELETE FROM Pledges WHERE ID = @ID" DeleteCommandType="Text"
         UpdateCommand="UPDATE Pledges SET EmailAddress = @EmailAddress, DateAdded = @DateAdded, User_IP = @User_IP WHERE ID = @ID" UpdateCommandType="Text" />
         </asp:Panel>        

    </form>
</body>
</html>
