<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/DefaultLogedContentMasterPage.master" AutoEventWireup="true" CodeBehind="ControleDeFerias.aspx.cs" Inherits="CECAM.RH.asp.ControleDeFerias" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ConteudoCorpo" runat="server">
        <script type="text/javascript">
            function fFormataCampoData(/*event,*/ obj, nextField) {
                obj.maxLength = 10;
                if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;

                if (obj.value.length == 2)
                    obj.value += "/";
                if (obj.value.length == 5)
                    obj.value += "/";

                if (obj.value.length == 9) {
                    if (nextField != null) {
                        window.setTimeout("document.getElementById('" + nextField + "').focus();", 10);
                    }
                }
            }
    </script>
    <h3>Controle de Férias
    </h3>
    <table border="0" cellpadding="0" cellspacing="0" style="width: 400px">
        <tr>
            <td colspan="3" style="height: 15px; width: 400px;">
                <h6>Para agendar férias, verifique a disponibilidade abaixo e informe o período desejado:</h6>
            </td>
        </tr>
        <tr>
            <td colspan="3" style="height: 15px; width: 400px;">&nbsp;</td>
        </tr>
    </table>
    <br />
    <div id="dvMensagem" runat="server" style="color: #ff0000; font-weight: bold;">Mensagem</div>
    <dx:ASPxLoadingPanel ID="LoadingPanel" ContainerElementID="ConteudoCorpo1" runat="server" ClientInstanceName="LoadingPanel" Modal="True" Text="Carregando..." />
    <asp:GridView ID="gwFerias" runat="server" AutoGenerateColumns="False" BackColor="White"
        BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" CssClass="txtWhite"
        GridLines="Vertical" PageSize="5" Width="500px" EmptyDataText="Não foram encontrados registros de férias" DataKeyNames="pid_RegistroFerias" OnRowCreated="gwFerias_RowCreated">
        <FooterStyle BackColor="#CCCCCC" CssClass="txtWhite" ForeColor="Black" HorizontalAlign="Center"
            VerticalAlign="Middle" />
        <Columns>
            <asp:BoundField DataField="pdt_PeriodoDe" DataFormatString="{0:dd/MM/yyyy}" HeaderText="De"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pdt_PeriodoAte" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Para"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pqtd_MaxDias" DataFormatString="{0:N0}" HeaderText="Máx. dias"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pqtd_DiasConcedidos" DataFormatString="{0:N0}" HeaderText="Concedidos"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pqtd_SaldoDias" DataFormatString="{0:N0}" HeaderText="Saldo"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pqtd_Ausencias" DataFormatString="{0:N0}" HeaderText="Ausências"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="situacao" HeaderText="Situação"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pds_observacao" HeaderText="Observação"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Agendar" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
                <ItemTemplate>
                    <asp:ImageButton ID="btAgendar" runat="server" CommandArgument='DataBinder.Eval(Container.DataItem, "pid_Ferias") %>'
                        ImageUrl="~/App_Themes/White/Images/agenda.ico" OnClientClick="ASPxPopupControl2.Show();" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle BackColor="#EEEEEE" ForeColor="Black" Font-Size="0.8em" />
        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="Gainsboro" />
    </asp:GridView>


    <dx:ASPxPopupControl
        ID="ASPxPopupControl2"
        runat="server"
        Modal="True"
        ClientInstanceName="ASPxPopupControl2"
        HeaderText="Solicitação de Férias"
        PopupHorizontalAlign="WindowCenter"
        PopupVerticalAlign="WindowCenter"
        Width="300px"
        ShowCloseButton="false"
        ContentStyle-HorizontalAlign="Center">
        <ContentStyle HorizontalAlign="Center"></ContentStyle>
        <ContentCollection>
            <dx:PopupControlContentControl>
                <div class="lblAviso">Informe o Período das ferias</div>
                <br />
                <div>
                    De:
                    <asp:TextBox ID="txtPeriodoDe" runat="server" Width="80px"></asp:TextBox>
                    Até:
                    <asp:TextBox ID="txtPeriodoAte" runat="server" Width="80px"></asp:TextBox>
                </div>
                <br />
                <div style="display: block; width: 80%;">
                    <div style="display: inline; float: left; width: 20%;"> <p></p></div>
                    <div style="display: inline; float: left;">
                            <dx:ASPxButton ID="btnConfirmar" runat="server" Text="Confirmar" Width="80px" ClientInstanceName="btnSim" AutoPostBack="false" OnClick="btnConfirmar_Click">
                                <ClientSideEvents Click="function(s, e) { ASPxPopupControl2.Hide(); }" />
                            </dx:ASPxButton>
                    </div>
                    <div style="display: inline; float: right;">
                            <dx:ASPxButton ID="btnCancelar" runat="server" Text="Cancelar" Height="20px" Width="80px" AutoPostBack="False">
                                <ClientSideEvents Click="function(s, e) { ASPxPopupControl2.Hide(); }" />
                            </dx:ASPxButton>
                    </div>
                </div>

            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>



    <input type="hidden" id="hdIdSolicitacaoFerias" runat="server" />
    <input type="hidden" id="hdqtdSaldoFerias" runat="server" />

</asp:Content>
