<%@ Page Title="" Language="C#" MasterPageFile="~/eosWinkartWeb/eosWinkartWeb.Master"
    AutoEventWireup="true" CodeBehind="extraWorkReqList.aspx.cs" Inherits="WebKart.eosWinkartWeb.extraWorkReqList" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="KingOf.Net.Web.UI.WebControls.PersianCalendar" Namespace="KingOf.Net.Web.UI.WebControls"
    TagPrefix="KingOfDotNet" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            width: 274px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <table width="100%">
        <tr>
            <td colspan="2" align="right">
                <asp:Image ID="imgKarkarddetail" SkinID="imgezafeKarArchive" runat="server" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="CenterTD">
                <asp:Label ID="lblError" runat="server" SkinID="LblError"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtbeginDate"
                    Display="Dynamic" ErrorMessage=".تاریخ را صحیح وارد نمایید" ValidationExpression="\d\d\d\d[/](((0[1-6])[/](0[1-9]|[12][0-9]|3[01]))|((0[7-9]|1[012])[/](0[1-9]|[12][0-9]|3[0])))"
                    ValidationGroup="Search" Font-Names="tahoma" Font-Size="8pt"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtbeginDate"
                    Display="Dynamic" ErrorMessage="*" ValidationGroup="Search"></asp:RequiredFieldValidator>
                <asp:TextBox ID="txtbeginDate" runat="server" Width="100px"></asp:TextBox>
                <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" AutoComplete="false"
                    Mask="9999/99/99" MaskType="Date" TargetControlID="txtbeginDate">
                </cc1:MaskedEditExtender>
                <cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" TargetControlID="txtbeginDate"
                    PopupControlID="pnlBeginDate" Position="Bottom">
                </cc1:PopupControlExtender>
                <asp:Panel runat="server" ID="pnlBeginDate">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <KingOfDotNet:PersianCalendar ID="beginDateCalander" runat="server" OnSelectionChanged="beginDateCalander_SelectionChanged">
                                <TodayDayStyle BackColor="#FFCC66" />
                            </KingOfDotNet:PersianCalendar>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
            <td class="LeftTD" valign="top">
                از تاریخ:
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEndDate"
                    Display="Dynamic" ErrorMessage=".تاریخ را صحیح وارد نمایید" ValidationExpression="\d\d\d\d[/](((0[1-6])[/](0[1-9]|[12][0-9]|3[01]))|((0[7-9]|1[012])[/](0[1-9]|[12][0-9]|3[0])))"
                    ValidationGroup="Search" Font-Names="tahoma" Font-Size="8pt"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEndDate"
                    Display="Dynamic" ErrorMessage="*" ValidationGroup="Search"></asp:RequiredFieldValidator>
                <asp:TextBox ID="txtEndDate" runat="server" Width="100px"></asp:TextBox>
                <cc1:MaskedEditExtender ID="MaskedEditExtender2" runat="server" AutoComplete="false"
                    Mask="9999/99/99" MaskType="Date" TargetControlID="txtEndDate">
                </cc1:MaskedEditExtender>
                <cc1:PopupControlExtender ID="PopupControlExtender2" runat="server" TargetControlID="txtEndDate"
                    PopupControlID="pnlEndDate" Position="Bottom">
                </cc1:PopupControlExtender>
                <asp:Panel runat="server" ID="pnlEndDate">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <KingOfDotNet:PersianCalendar ID="endDateCalander" runat="server" OnSelectionChanged="endDateCalander_SelectionChanged"
                                NextPrevStyle-ForeColor="White" NextPrevFormat="CustomText">
                            </KingOfDotNet:PersianCalendar>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
            <td class="LeftTD" valign="top">
                تا تاریخ:
            </td>
        </tr>
        <tr>
            <td class="RightTD">
                <asp:DropDownList ID="ddlSerachKind" runat="server" SkinID="ddlYellow" Width="230px"
                    AutoPostBack="True" OnSelectedIndexChanged="ddlSerachKind_SelectedIndexChanged">
                    <asp:ListItem Selected="True" Value="1">درخواست های جدید و در حال پیگیری</asp:ListItem>
                    <asp:ListItem Value="2">درخواست های تائید شده</asp:ListItem>
                    <asp:ListItem Value="3">درخواست های پذیرفته نشده</asp:ListItem>
                    <asp:ListItem Value="4">درخواست های برگشت خورده</asp:ListItem>
                    <asp:ListItem Value="5">تمامی مجوزهای اضافه کار</asp:ListItem>
                    <asp:ListItem Value="7">درخواست های در حالت تعلیق</asp:ListItem>
                </asp:DropDownList>
                <asp:Button ID="btnSearchRequest" runat="server" Text="جستجو" SkinID="btnOrange"
                    OnClick="btnSearchRequest_Click" />
            </td>
            <td class="LeftTD">
                نوع درخواست:
            </td>
        </tr>
        <tr>
            <td colspan="2" class="RightTD">
                <img src="../App_Themes/eosMainThem/image/alarm.png" alt="" />
                <asp:Label ID="lblMsg" runat="server" Text="توجه: سطر های سبز رنگ برگه های اضافه کار گروهی هستند و ممکن است در شرایط تمام درخواست ها مشاهده نشوند."
                    SkinID="LblWhiteFont" Font-Names="tahoma" Font-Size="10"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="CenterTD">
                <hr style="size: 1; color: Yellow; width: 600px">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <telerik:RadGrid runat="server" ID="grdExtraWorks" Skin="WebBlue" AutoGenerateColumns="False"
                    GridLines="None" GroupingEnabled="False" Font-Names="Tahoma"
                    AllowPaging="True" PageSize="20" OnPageIndexChanged="grdExtraWorks_OnPageIndexChanged"
                    DataSourceID="extraWorkODS"  OnPageSizeChanged="grdExtraWorks_OnPageSizeChanged"  OnItemDataBound="grdExtraWorks_OnItemDataBound"
                    Font-Size="10pt"  OnSortCommand="grdExtraWorks_SortCommand" OnItemCommand="grdExtraWorks_OnItemCommand">
                    <MasterTableView NoDetailRecordsText="" NoMasterRecordsText="اطلاعاتی برای نمایش موجود نمی باشد"
                        AllowCustomPaging="False" AllowCustomSorting="True"> 
                        <Columns>
                            <telerik:GridBoundColumn DataField="Year" HeaderText="سال" UniqueName="Year" 
                                Display="false" AllowSorting="False" >
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="statusType" HeaderText="وضعیت" UniqueName="statusType"
                              AllowSorting="False">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="requestDate" HeaderText="تاریخ درخواست" UniqueName="requestDate"
                                AllowSorting="False">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ENDTIME" HeaderText="ساعت پایان" UniqueName="ENDTIME"
                                AllowSorting="False">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ENDDATE" HeaderText="تاریخ پایان" UniqueName="ENDDATE" AllowSorting="True">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BEGINTIME" HeaderText="ساعت شروع" UniqueName="BEGINTIME" AllowSorting="False">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BEGINDATE" HeaderText="تاریخ شروع" UniqueName="BEGINDATE" AllowSorting="True">
                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PAGENO" HeaderText="شماره برگه" UniqueName="PAGENO"
                                Display="false" AllowSorting="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DBKIND" HeaderText="" UniqueName="DBKIND" 
                                Display="false" AllowSorting="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Year" HeaderText="" UniqueName="Year" 
                                Display="false" AllowSorting="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="isGroup" HeaderText="" UniqueName="isGroup" 
                                Display="false" AllowSorting="False">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true"
                        AllowAutoScrollOnDragDrop="False">
                        <Selecting EnableDragToSelectRows="False" />
                    </ClientSettings>
                </telerik:RadGrid>
                             
                
                <asp:ObjectDataSource runat="server" ID="extraWorkODS" EnablePaging="True" StartRowIndexParameterName="startRecord"
                    MaximumRowsParameterName="maxRecords" SelectCountMethod="GetCount" SelectMethod="GetExtraWorksForPerson"
                    TypeName="Eos.WebKart.Domain.ExtraWork"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="CenterTD">
                <asp:Panel runat="server" Visible="false" ID="pnlMissionDetail">
                    <table width="100%" cellpadding="3" cellspacing="4">
                        <tr>
                            <td class="RightTD">
                                <asp:Label ID="lblPageKind" runat="server" Text=""></asp:Label>
                            </td>
                            <td class="LeftTD">
                                نوع درخواست:
                            </td>
                            <td class="RightTD" style="width: 300px">
                                <asp:Label ID="lblPageNumber" runat="server" Text=""></asp:Label>
                            </td>
                            <td style="width: 150px" class="LeftTD">
                                شماره برگه:
                            </td>
                        </tr>
                        <tr>
                            <td class="RightTD">
                                <asp:Label ID="lbllastChangeDate" runat="server" Text=""></asp:Label>
                            </td>
                            <td class="LeftTD">
                                تاریخ آخرین تغییرات:
                            </td>
                            <td class="RightTD">
                                <asp:Label ID="lblName" runat="server" Text=""></asp:Label>
                            </td>
                            <td style="width: 150px" class="LeftTD">
                                درخواست دهنده:
                            </td>
                        </tr>
                        <tr>
                            <td class="RightTD">
                                <asp:Label ID="lblApprovedBy" runat="server" Text=""></asp:Label>
                            </td>
                            <td style="width: 150px" class="LeftTD">
                                تائید/رد کننده:
                            </td>
                            <td class="RightTD">
                                <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
                            </td>
                            <td class="LeftTD">
                                وضعیت:
                            </td>
                        </tr>
                        <tr>
                            <td class="RightTD" colspan="3">
                                <asp:Label ID="lblDescript" runat="server" Text=""></asp:Label>
                            </td>
                            <td style="width: 150px" class="LeftTD" valign="top">
                                توضیحات:
                            </td>
                        </tr>
                        <tr>
                            <td class="RightTD" colspan="4">
                                <asp:Label ID="lblPersonelsName" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" class="CenterTD">
                                <hr style="size: 1; color: Yellow; width: 600px">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" class="CenterTD">
                                <asp:Label ID="lblExtraWorkMessage" runat="server" Text=""></asp:Label>
                                <br />
                                <telerik:RadGrid runat="server" ID="grdPageCommentList" Skin="WebBlue" AutoGenerateColumns="False"
                                    GridLines="None" AllowPaging="false" AllowSorting="false" GroupingEnabled="False"
                                    Font-Names="Tahoma" Font-Size="10pt">
                                    <MasterTableView NoDetailRecordsText="" NoMasterRecordsText="اطلاعاتی برای نمایش موجود نمی باشد"
                                        AllowCustomPaging="False">
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="comment" HeaderText="روند جریان مجوز اضافه کار"
                                                UniqueName="comment">
                                                <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Right" />
                                                <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Right" />
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                <asp:Button ID="btnDelete" runat="server" Text="حذف برگه" SkinID="btnOrange" OnClick="btnDelete_Click" />
                                &nbsp;<asp:Button ID="btnEdit" runat="server" OnClick="btnEdit_Click" SkinID="btnOrange"
                                    Text="ویرایش برگه" />
                            </td>
                            <td class="CenterTD">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"
        InitialDelayTime="2" MinDisplayTime="100" Width="184px">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlSerachKind">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="grdExtraWorks" />
                    <telerik:AjaxUpdatedControl ControlID="pnlMissionDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSearchRequest">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="grdExtraWorks" />
                    <telerik:AjaxUpdatedControl ControlID="pnlMissionDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdExtraWorks">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="pnlMissionDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnDelete">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="grdExtraWorks" />
                    <telerik:AjaxUpdatedControl ControlID="pnlMissionDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
   
</asp:Content>
