<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="ManageEvents.aspx.cs" Inherits="Admin_ManageEvents" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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 Events</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">   

<h3>MurraySabrin.com - Event Manager</h3>
    
<asp:Panel ID="pnlResults" runat="server" Visible="false" CssClass="NoticePanel"  >
    <asp:Label ID="lblResults" runat="server" />
</asp:Panel>

        <asp:Panel ID="pnlNew" runat="server" >
            <b>Add New</b><br />
            Title:  <asp:TextBox ID="txtTitle" runat="server" Width="150"></asp:TextBox><br />
            Description: <asp:TextBox ID="txtDescription" runat="server" Rows="4" Width="350" TextMode="MultiLine" /><br />
            Event Date: <asp:TextBox ID="txtEventDate" runat="server" /> <br />
            <asp:Button ID="btnAdd" runat="server" Text="Add Event" OnClick="btnAdd_Click" />
            
            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Animated="true" 
                TargetControlID="txtEventDate"  />
        </asp:Panel>
    
        <asp:GridView ID="gvEvents" runat="server" AutoGenerateColumns="false"
        AlternatingRowStyle-BackColor="#CCCCCC" AlternatingRowStyle-ForeColor="Black"
        AutoGenerateDeleteButton="true" AutoGenerateEditButton="true" OnRowEditing="gvEvents_RowEditing"
        GridLines="Horizontal" DataKeyNames="ID" CellPadding="5" CellSpacing="2" BorderColor="Gray" 
        BorderWidth="1" BorderStyle="Inset" Width="80%" OnRowDeleting="gvEvents_Delete" 
        OnRowCancelingEdit="gvEvents_CancelEdit" OnRowUpdated="gvEvents_RowUpdated" OnRowCommand="gvEvents_Command" 
        OnRowUpdating="gvEvents_RowUpdating" >
        
            <Columns>
                <asp:TemplateField HeaderText="Event Date">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEventDate" runat="server" Text='<% #Eval("EventDateString") %>' />
                         <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Animated="true" 
                                TargetControlID="txtEventDate"  />

                    </EditItemTemplate>
                    <ItemTemplate>                    
                        <asp:Label ID="lblEventDate" runat="server" Text='<% #Eval("EventDateString") %>' />
                    </ItemTemplate>
                
                </asp:TemplateField>

               <asp:TemplateField HeaderText="Title">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="server" Text='<% #Eval("Title") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>                    
                        <asp:Label ID="lblTitle" runat="server" Text='<% #Eval("Title") %>' />
                    </ItemTemplate>                
                </asp:TemplateField>

               <asp:TemplateField HeaderText="Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDescription" TextMode="MultiLine" Width="400px" Rows="4" runat="server" Text='<% #Eval("Description") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>                    
                        <asp:Label ID="lblDescription" runat="server" Text='<% #Eval("Description") %>' />
                    </ItemTemplate>                
                </asp:TemplateField>
            
            </Columns>
        </asp:GridView>
</asp:Panel>        
    </form>
</body>
</html>
