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

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        ID:<asp:TextBox ID="txtID" runat="server" ReadOnly="True" Width="71px"></asp:TextBox>
        <br />
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nome: <asp:TextBox ID="txtNome" 
            runat="server" EnableViewState="False" MaxLength="50" Width="214px"></asp:TextBox>
        <br />
&nbsp;&nbsp;Sobrenome:<asp:TextBox ID="txtSobrenome" runat="server" EnableViewState="False" 
            MaxLength="50" Width="213px"></asp:TextBox>
&nbsp;&nbsp;
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    
        <asp:Button ID="btnPreencher" runat="server" onclick="btnPreencher_Click" 
            Text="Exibir tabela" />
    
        <asp:Button ID="ExcluirAdd" runat="server" onclick="ExcluirAdd_Click" 
            Text="Excluir registros" Width="128px" Enabled="False" 
            EnableViewState="False" OnClientClick="return confirm('Você deseja realmente excluir este registro?')" />
        
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        
        <asp:Label ID="Label1" runat="server"></asp:Label>
        <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
            ConnectionString="name=SchoolEntities" DefaultContainerName="SchoolEntities" 
            EnableFlattening="False" EntitySetName="Person" EntityTypeFilter="Person">
        </asp:EntityDataSource>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="PersonID" 
            onselectedindexchanged="GridView1_SelectedIndexChanged">
            <Columns>
                <asp:CommandField ShowSelectButton="True" SelectText="Selecionar" />
                <asp:BoundField DataField="PersonID" HeaderText="PersonID" ReadOnly="True" 
                    SortExpression="PersonID" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" 
                    SortExpression="LastName" />
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                    SortExpression="FirstName" />
                <asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                    SortExpression="HireDate" />
                <asp:BoundField DataField="EnrollmentDate" HeaderText="EnrollmentDate" 
                    SortExpression="EnrollmentDate" />
            </Columns>
            <SelectedRowStyle BackColor="Blue" ForeColor="White"/>            
        </asp:GridView>
        <br />    
    </div>
    </form>
</body>
</html>
