<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    Culture="es-MX" CodeBehind="frmGrantias.aspx.cs" Inherits="bajaWare.Garantias.frmGrantias" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../UserControl/Grantia/wucGarantiaCredito.ascx" TagName="wucGarantiaCredito"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContenido" runat="server">
    <table>
        <tr>
            <td valign="middle">
                <asp:UpdatePanel ID="UPD_Persona" runat="server">
                    <ContentTemplate>
                        <div style="height: 350px; top: 2px;">
                            <asp:GridView ID="grvGarantias" runat="server" AllowSorting="false" Width="95%" AutoGenerateColumns="false"
                                EmptyDataText="No se encontraron Resultados" PageSize="10" AllowPaging="True"
                                ShowHeader="true" ShowHeaderWhenEmpty="true" ShowFooter="true" CssClass="tablestyle"
                                DataKeyNames="iGarantiaId" OnPageIndexChanging="grvGarantias_PageIndexChanging">
                                <AlternatingRowStyle CssClass="alternatingrowstyle" />
                                <HeaderStyle CssClass="headerstyle" />
                                <RowStyle CssClass="rowstyle" />
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <%# Convert.ToInt32(DataBinder.Eval(Container, "DataItemIndex")) + 1 %>.</ItemTemplate>
                                        <ItemStyle Font-Size="X-Small" HorizontalAlign="Center" Width="15px" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="iGarantiaId" HeaderText="ID" />
                                    <asp:BoundField DataField="strTipoGrantia" HeaderText="Tipo Garantia" />
                                    <asp:BoundField DataField="nValorComercial" HeaderText="Valor Garantia" />
                                    <asp:BoundField DataField="datFechaValuacion" HeaderText="Fecha Valuacion" />
                                    <asp:BoundField DataField="sintGradoPrelacion" HeaderText="Grado Prelacion" />
                                    <asp:BoundField DataField="iGarantiaId" HeaderText="iGarantiasId" Visible="false" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btnGo" runat="server" ImageUrl="~/Images/Botones/Edit24X24.png"
                                                Style="border: none;" Height="15px" ToolTip="Actualizar" CommandArgument='<%# Eval("iGarantiaId") %>'
                                                CausesValidation="false" CommandName="go" OnClick="btnGo_Click" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="grvGarantias" EventName="RowCommand" />

                        <asp:AsyncPostBackTrigger ControlID="grvGarantias" EventName="PageIndexChanging" />
                        <asp:AsyncPostBackTrigger ControlID="btnGuardaGarantia" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
            <td valign="top" style="top: 20px">
                <asp:UpdatePanel ID="UPD_Agrega" runat="server">
                    <ContentTemplate>
                        <br />
                        <br />
                        <asp:Button ID="btnAgrega" Text="Agregar" CssClass="Boton" runat="server" OnClick="btnAgrega_Click" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnAgrega" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr align="center">
      <td> <asp:Button ID="btnAtras" CssClass="Boton" Text="Atras"
              runat="server" onclick="btnAtras_Click" /></td>
      </tr>
    </table>
    <asp:Button ID="btnDomicilio" runat="server" Style="display: none;" />
    <asp:Button ID="btnMFinish" runat="server" Style="visibility: hidden" />
    <asp:ModalPopupExtender ID="mdlDatosGarantia" runat="server" TargetControlID="btnDomicilio"
        OkControlID="btnMFinish" CancelControlID="btnCierraDomicilio" PopupControlID="pnlPopup_Persona"
        BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>
    <asp:Panel ID="pnlPopup_Persona" runat="server" Width="85%" HorizontalAlign="Center">
        <%-- <asp:UpdatePanel ID="UPD_Persona" runat="server">
        <ContentTemplate>--%>
        <asp:Panel ID="pnlPopup_Pers" runat="server" BackColor="White" Width="100%">
            <table>
                <tr>
                    <td class="Titulo">
                        <center>
                            Datos Garantia
                        </center>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:UpdatePanel runat="server" ID="UPD_Datos">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPD_DatosDomicilio">
                                                <ContentTemplate>
                                                    <table>
                                                        <tr>
                                                            <td colspan="2">
                                                                <asp:TabContainer ID="Tabs" runat="server">
                                                                    <asp:TabPanel runat="Server" ID="tabCredito" TabIndex="0" HeaderText="Credito" Height="100px"
                                                                        BackColor="Transparent"><ContentTemplate><uc1:wucGarantiaCredito ID="wucGarantiaCredito1" runat="server" /></ContentTemplate></asp:TabPanel>
                                                                    <asp:TabPanel runat="Server" ID="tabFinanzas" Visible="false" TabIndex="1" HeaderText="Finanzas"
                                                                        Height="100px" BackColor="Transparent"><ContentTemplate><table><tr><td class="th">Linea Credito Garantiza </td><td><asp:TextBox ID="txtLineaCreditoGarantiza" runat="server"></asp:TextBox></td></tr></table></ContentTemplate></asp:TabPanel>
                                                                </asp:TabContainer>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td align="center">
       
                        <asp:Button ID="btnGuardaGarantia" runat="server" ValidationGroup="Garantia" Text="Guardar"
                            ToolTip="Guarda los datos del Aval" CssClass="Boton" OnClick="btnGuardaGarantia_Click" />
                        <asp:Button ID="btnCierraDomicilio" runat="server" Text="Cancelar" ToolTip="Cierra la ventana."
                            CssClass="Boton" CausesValidation="false" />
                      
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <%--        </ContentTemplate>
    </asp:UpdatePanel>--%>
    </asp:Panel>
</asp:Content>
