<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="frmInterfaces.aspx.cs" Inherits="bajaWare.Interfaces.frmInterfaces" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>
<%@ Register Src="../UserControl/Mensaje.ascx" TagName="Mensaje" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <script language="javascript" type="text/javascript">
        function selectallCons() {
            var gridview = document.getElementById('grvListaInterface');
            var chk = document.getElementById('chkHeadCons');
            for (var i = 1; i < gridview.rows.length; i++) {
                gridview.rows[i].cells[3].firstChild.checked = chk.checked;
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContenido" runat="server">
    <table>
        <tr>
            <td colspan="2" align="center" class="Titulo">
                Generacion de Interfaces
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Label runat="server" ID="lblCalendario" Text="Monitor de Generación de Interfaces"
                            Font-Size="9px" ForeColor="Blue" Font-Bold="true" Style="text-align: right"></asp:Label>
                        <center>
                            <asp:Calendar ID="calInterfaces" runat="server" BackColor="White" BorderColor="Black"
                                BorderStyle="Solid" CellSpacing="1" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt"
                                ForeColor="Black" Height="160px" NextPrevFormat="ShortMonth" SelectionMode="None"
                                Width="270px" OnDayRender="calPagosRef_DayRender" OnVisibleMonthChanged="calPagosRef_VisibleMonthChanged">
                                <SelectedDayStyle BackColor="#333399" ForeColor="#FFFF66" />
                                <WeekendDayStyle BackColor="#CCCCCC" ForeColor="#666699" />
                                <TodayDayStyle BackColor="White" ForeColor="#33CC33" />
                                <OtherMonthDayStyle BackColor="#CCCCCC" ForeColor="#CCCCCC" />
                                <DayStyle BackColor="White" ForeColor="#3333CC" />
                                <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="White" />
                                <DayHeaderStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" Height="8pt" />
                                <TitleStyle BackColor="#333399" BorderStyle="Solid" Font-Bold="True" Font-Size="8pt"
                                    ForeColor="White" Height="12pt" />
                            </asp:Calendar>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr style="height: 5px;">
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 17px; background-color: Blue;">
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td style="font-size: 10px;">
                                        <b>Dias de Corte (Interfaces Generadas)</b>
                                    </td>
                                </tr>
                            </table>
                        </center>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="">
                <br />
            </td>
        </tr>
        <tr>
            <td class="th">
                Fecha:
            </td>
            <td align="left">
                <asp:TextBox runat="server" ID="txtFecha"></asp:TextBox>
                <AjaxToolkit:CalendarExtender runat="server" ID="calFecha" TargetControlID="txtFecha"
                    Format="dd/MM/yyyy">
                </AjaxToolkit:CalendarExtender>
                <AjaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
                    TargetControlID="txtFecha" WatermarkText="Fecha" WatermarkCssClass="watermarked" />
                <asp:RequiredFieldValidator ID="rfv_txtFecha" runat="server" ErrorMessage="<b>Fecha invalida</b><br />Dato obigatorio."
                    ControlToValidate="txtFecha" Display="None" ValidationGroup="vsg_Interface" InitialValue="" />
                <AjaxToolkit:ValidatorCalloutExtender ID="vce_txtFech" runat="server" Enabled="True"
                    TargetControlID="rfv_txtFecha" />
            </td>
        </tr>
        <tr>
            <td>
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:UpdatePanel runat="server" ID="UPD_btnGenera" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Button runat="server" ID="btnGenera" Text="Generar Layout" OnClick="btnGenera_OnClick"
                            CssClass="Boton" ValidationGroup="vsg_Interface" OnClientClick="javascript:IniciaProgreso();" />
                        <iframe id="iframe" src="" runat="server" width="0px" height="0px"></iframe>
                    </ContentTemplate>
                    <Triggers>
                        <asp:PostBackTrigger ControlID="btnGenera" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <div id="Process" style="visibility: hidden;">
                    <img id="imgP" src="" width="300" height="40"><br>
                    Espere un momento...<br>
                </div>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPD_grvListaInterface">
                    <ContentTemplate>
                        <asp:Panel runat="server" ID="pnlInterface" Height="500px">
                            <asp:GridView ID="grvListaInterface" ClientIDMode="Static" runat="server" AllowSorting="false"
                                Width="95%" AutoGenerateColumns="false" EmptyDataText="" AllowPaging="false"
                                OnRowDataBound="grvListaInterface_RowDataBound" OnRowCommand="grvListaInterface_OnRowCommand"
                                ShowHeader="true" ShowHeaderWhenEmpty="true" DataKeyNames="intInterfaceid" CssClass="tablestyle">
                                <AlternatingRowStyle CssClass="alternatingrowstyle" />
                                <HeaderStyle CssClass="headerstyle" />
                                <RowStyle CssClass="rowstyle" />
                                <Columns>
                                    <asp:BoundField DataField="intInterfaceid" HeaderText="ID" />
                                    <asp:BoundField DataField="vchInterface" HeaderText="Interface" />
                                    <asp:BoundField DataField="vchNegocio" HeaderText="Negocio" ItemStyle-Width="200px" />
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            Sel<br />
                                            <input type="checkbox" id="chkHeadCons" name="SelectAll" onclick="selectallCons();"
                                                style="" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox runat="server" ID="chkSelect" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPD_Reg">
                    <ContentTemplate>
                        <asp:Button runat="server" ID="btnRegresa" Text="Regresar" OnClientClick="window.location.href('frmBusqueda.aspx');"
                            CssClass="Boton" CausesValidation="false" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <uc1:Mensaje ID="Mensaje" runat="server" />
    <script language="javascript" type="text/javascript">
        function IniciaProgreso() {
            if (document.getElementById("ctl00_ContentPlaceHolderContenido_txtFecha").value != "Fecha") {
                document.getElementById("Process").style.visibility = "";
                document.getElementById("imgP").src = "../Images/loading2.gif"
            }

        }
        function TerminaProgreso() {
            document.getElementById("Process").style.visibility = "hidden";
        }
    </script>
</asp:Content>
