<%@ Page Title="Planet Wrox - Management - Reviews" Language="
VB" MasterPageFile="~/MasterPages/ManagementMaster.master" AutoEventWireup="false" CodeFile="Reviews.aspx.
vb" Inherits="Management_Reviews" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
AppendDataBoundItems="True" DataSourceID="SqlDataSource1" DataTextField="Name"
DataValueField="Id">
<asp:ListItem Value="">Please make a selection</asp:ListItem>
</asp:DropDownList>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="Id" DataSourceID="SqlDataSource2" style="margin-top: 0px">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:CheckBoxField DataField="Authorized" HeaderText="Authorized"
SortExpression="Authorized" />
<asp:BoundField DataField="CreateDateTime" HeaderText="CreateDateTime"
SortExpression="CreateDateTime" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:PlanetWroxConnectionString1 %>"
SelectCommand="SELECT [Id], [Title], [Authorized], [CreateDateTime] FROM [Review] WHERE ([GenreId] = @GenreId)"
DeleteCommand="DELETE FROM [Review] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [Review] ([Title], [Authorized], [CreateDateTime]) VALUES (@Title, @Authorized, @CreateDateTime)"
UpdateCommand="UPDATE [Review] SET [Title] = @Title, [Authorized] = @Authorized, [CreateDateTime] = @CreateDateTime WHERE [Id] = @Id">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="GenreId"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Authorized" Type="Boolean" />
<asp:Parameter Name="CreateDateTime" Type="DateTime" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Authorized" Type="Boolean" />
<asp:Parameter Name="CreateDateTime" Type="DateTime" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:PlanetWroxConnectionString1 %>"
SelectCommand="SELECT [Id], [Name] FROM [Genre] ORDER BY [SortOrder]">
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>