<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form id="form1" runat="server">
<table style="width: 100%;">
<tr>
<td style="width: 309px"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="height: 37px; width: 309px;">Documento / Rut</td>
<td style="height: 37px">
<asp:TextBox ID="txtdocumento" runat="server" Width="229px"></asp:TextBox>
</td>
<td style="height: 37px"></td>
</tr>
<tr>
<td colspan="3">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID_Cliente" DataSourceID="SqlDataSource1" Width="100px">
<Columns>
<asp:BoundField DataField="ID_Cliente" ItemStyle-Width="50px" HeaderText="ID_Cliente" InsertVisible="False" ReadOnly="True" SortExpression="ID_Cliente">
<ItemStyle Width="128px" />
</asp:BoundField>
<asp:BoundField DataField="Nombre" ItemStyle-Width="50px" HeaderText="Nombre" SortExpression="Nombre">
<ItemStyle Width="128px" />
</asp:BoundField>
<asp:BoundField DataField="Apellido" HeaderText="Apellido" SortExpression="Apellido">
<ItemStyle Width="128px" />
</asp:BoundField>
<asp:BoundField DataField="DocumentoRut" HeaderText="DocumentoRut" SortExpression="DocumentoRut">
<ItemStyle Width="128px" />
</asp:BoundField>
<asp:TemplateField HeaderText="Direccion" SortExpression="Direccion">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Direccion") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Direccion") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="128px" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Actualizar"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancelar"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Editar"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="128px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SISLIVEConnectionString2SERVIDORWEB %>" DeleteCommand="DELETE FROM [Clientes] WHERE [ID_Cliente] = @ID_Cliente" InsertCommand="INSERT INTO [Clientes] ([Nombre], [Apellido], [DocumentoRut], [Direccion]) VALUES (@Nombre, @Apellido, @DocumentoRut, @Direccion)" SelectCommand="SELECT * FROM [Clientes] WHERE ([DocumentoRut] = @DocumentoRut)" UpdateCommand="UPDATE [Clientes] SET [Nombre] = @Nombre, [Apellido] = @Apellido, [DocumentoRut] = @DocumentoRut, [Direccion] = @Direccion WHERE [ID_Cliente] = @ID_Cliente">
<DeleteParameters>
<asp:Parameter Name="ID_Cliente" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Nombre" Type="String" />
<asp:Parameter Name="Apellido" Type="String" />
<asp:Parameter Name="DocumentoRut" Type="String" />
<asp:Parameter Name="Direccion" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="txtdocumento" Name="DocumentoRut" PropertyName="Text" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Nombre" Type="String" />
<asp:Parameter Name="Apellido" Type="String" />
<asp:Parameter Name="DocumentoRut" Type="String" />
<asp:Parameter Name="Direccion" Type="String" />
<asp:Parameter Name="ID_Cliente" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</form>
</asp:Content>