<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="messaging.aspx.cs" Inherits="PirTickets.messaging" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>
        Edit Customer Messages</h2>
    <p>
        <asp:Button ID="bNew" runat="server" onclick="bNew_Click" Text="New" 
            Width="53px" />
    </p>

    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="id" DataSourceID="SqlDataSource1" 
            AutoGenerateSelectButton="True" CellPadding="4" ForeColor="#333333" 
            ShowFooter="True" onselectedindexchanged="GridView1_SelectedIndexChanged" 
            Width="700px">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="status_name" HeaderText="Status level" 
                    SortExpression="status_name" />
                <asp:BoundField DataField="sms" HeaderText="SMS Message" 
                    SortExpression="sms" />
                <asp:BoundField DataField="email" HeaderText="Email Message" 
                    SortExpression="email" />
                <asp:CheckBoxField DataField="sendsms" HeaderText="Send SMS" 
                    SortExpression="sendsms" />
                <asp:CheckBoxField DataField="sendemail" HeaderText="Send Email" 
                    SortExpression="sendemail" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
            SelectCommand="SELECT messages.id, statuses.status_name, left([smsmessage],20) as sms, left( [emailmessage],20) as email, [sendoncomplete], [sendsms], [sendemail] FROM [messages] left join statuses on statuses.id = messages.status">
        </asp:SqlDataSource>
    </p>
</asp:Content>
