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

<%@ 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">
    <h3>Autorização de Férias
    </h3>
    <table border="0" cellpadding="0" cellspacing="0" style="width: 400px">
        <tr>
            <td colspan="3" style="height: 15px; width: 400px;">
                <h6>Verifique abaixo as solicitações de férias pendentes de aprovação:</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="Gerando Relatório..." />
    <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 existem solicitações de férias para autorizar" OnRowCreated="gwFerias_RowCreated" OnRowCommand="gwFerias_RowCommand">
        <FooterStyle BackColor="#CCCCCC" CssClass="txtWhite" ForeColor="Black" HorizontalAlign="Center"
            VerticalAlign="Middle" />
        <Columns>
            <asp:BoundField DataField="pnm_Funcionario" HeaderText="Nome Servidor"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <%--            <asp:BoundField DataField="cdMatricula" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Matricula"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>--%>
            <asp:BoundField DataField="pdt_PeriodoSolicitadoDe" DataFormatString="{0:dd/MM/yyyy}" HeaderText="De"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="pdt_PeriodoSolicitadoAte" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Até"
                HtmlEncode="False" ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Autorizar" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
                <ItemTemplate>
                    <asp:ImageButton ID="btAutorizar" runat="server" CommandName="Autorizar" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "pid_SolicitacaoFerias") %>'
                        ImageUrl="~/App_Themes/White/Images/check.ico" OnClick="btAutorizar_Click" />
                </ItemTemplate>
            </asp:TemplateField>
<%--            <asp:ButtonField ItemStyle-HorizontalAlign="Center" HeaderText="Autorizar" ButtonType="Image" CommandName="Imprimir" ImageUrl="~/App_Themes/White/Images/check.ico"
                                        Text="Autorizar" c></asp:ButtonField>--%>
            <asp:TemplateField HeaderText="Recusar" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
                <ItemTemplate>
                    <asp:ImageButton ID="btNegar" runat="server" CommandArgument='DataBinder.Eval(Container.DataItem, "pid_Ferias") %>'
                        ImageUrl="~/App_Themes/White/Images/reprove.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 abaixo o motivo da não autorização</div>
                <br />
                <div>
                    <asp:TextBox ID="txtMotivoReprovação" runat="server" Width="250px" Height="80px" MaxLength="200"></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="hdIdAutorizacaoFerias" runat="server" />

</asp:Content>
