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

<%@ 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: 150px;
        }
        .style4
        {
            width: 200px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="padding-right: 30px">
        <table width="100%">
            <tr>
                <td colspan="2" class="RightTD">
                    <asp:Image ID="Image1" runat="server" SkinID="imgePersonDayWorkLabel" />
                </td>
            </tr>
            <tr>
                <td colspan="2" class="CenterTD">
                    <asp:Label ID="lblError" runat="server" Text="" SkinID="LblError"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="RightTD">
                    <img src="../App_Themes/eosMainThem/image/alarm.png" alt="" />
                    کاربر گرامی : برای انتخاب پرسنل مورد نظر می توانید از جستجو بر اساس نام یا بر اساس
                    شماره پرسنلی بهره مند شوید.
                    <br />
                    توجه: در صورت وارد کردن شماره پرسنلی, جستجو بر اساس نام فاقد اعتبار می باشد
                </td>
            </tr>
            <tr>
                <td class="RightTD" style="width: 500px">
                    <telerik:RadComboBox ID="ddlPersons" runat="server" Width="280px" Height="140px"
                        EmptyMessage="نام خانوادگی پرسنل مورد نظررا وارد کنید" DataTextField="PersonName"
                        DataValueField="perno" AllowCustomText="True" Font-Names="Tahoma" Font-Size="10pt"
                        MarkFirstMatch="True" Skin="Vista" ItemRequestTimeout="5000" LoadingMessage="در حال بارگذاری..."
                        ShowMoreResultsBox="false" Sort="Ascending">
                    </telerik:RadComboBox>
                </td>
                <td class="LeftTD" style="width: 250px">
                    انتخاب پرسنل بر اساس نام:
                </td>
            </tr>
            <tr>
                <td class="RightTD" style="width: 500px">
                    <asp:TextBox ID="txtPerno" runat="server" Width="165px"></asp:TextBox>
                    &nbsp;<asp:Button ID="btnSubmit" runat="server" Text="جستجو" SkinID="btnOrange" OnClick="btnSubmit_Click" />
                </td>
                <td class="LeftTD" style="width: 250px">
                    انتخاب پرسنل بر اساس شماره پرسنلی:
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 520px">
                    <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="dd" Font-Names="tahoma" Font-Size="8pt"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtbeginDate"
                        Display="Dynamic" ErrorMessage="*"></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 style="width: 250px" class="LeftTD" valign="top">
                    از تاریخ:
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 520px">
                    <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="dd" Font-Names="tahoma" Font-Size="8pt"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEndDate"
                        Display="Dynamic" ErrorMessage="*"></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"
                                    NextPrevFormat="CustomText">
                                </KingOfDotNet:PersianCalendar>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                </td>
                <td style="width: 250px" class="LeftTD" valign="top">
                    تا تاریخ:
                </td>
            </tr>
            <tr>
                <td class="RightTD" colspan="2">
                    <hr style="size: 1; color: Yellow; width: 80%" />
                    <asp:Label ID="lblSelectedPersonName" runat="server" Text="" SkinID="LblError">
                    </asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%">
                        <tr>
                            <td class="CenterTD" style="background-color: #6b8e23; width: 50%">
                                روز های تعطیل رسمی یا تعطیل توافقی
                            </td>
                            <td class="CenterTD" style="background-color: #f08080; width: 50%">
                                غیبت
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <telerik:RadGrid runat="server" ID="grdWorkDetail" Skin="WebBlue" AutoGenerateColumns="False"
                        GridLines="None" OnItemCommand="grdWorkDetail_ItemCommand" AllowSorting="True"
                        ShowStatusBar="True" Font-Names="Tahoma" Font-Size="10pt" OnSortCommand="grdWorkDetail_SortCommand"
                        OnItemDataBound="grdWorkDetail_ItemDataBound">
                        <MasterTableView NoMasterRecordsText="اطلاعاتی برای نمایش موجود نمی باشد" DataKeyNames="DDATE">
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="WORKTOTAL" HeaderText="میزان حضور" UniqueName="WORKTOTAL">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="MISSION" HeaderText="ماموریت" UniqueName="MISSION">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Morakhasi" HeaderText="مرخصی" UniqueName="Morakhasi">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EXTRAWORKTOTAL" HeaderText="کل اضافه کار" UniqueName="EXTRAWORKTOTAL"
                                    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="totalKasrKar" HeaderText=" کل کسر کار" UniqueName="totalKasrKar"
                                    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="dayName" HeaderText="روز هفته" UniqueName="dayName"
                                    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="DDATE" HeaderText="تاریخ" UniqueName="DDATE">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="HOLIDAY" HeaderText="تعطیل رسمی یا توافقی" Visible="False"
                                    UniqueName="HOLIDAY">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DAILYABSENCE" HeaderText="غیبت" Visible="False"
                                    UniqueName="DAILYABSENCE">
                                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true"
                            AllowAutoScrollOnDragDrop="False">
                            <Selecting EnableDragToSelectRows="False" />
                        </ClientSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="CenterTD">
                    <asp:Panel ID="pnlTotal" runat="server" Visible="false">
                        <table width="100%" cellpadding="3" cellspacing="4">
                            <tr>
                                <td colspan="4" class="RightTD">
                                    <img src="../App_Themes/eosMainThem/image/totalInfo.png" alt="" />
                                    <hr style="size: 1; color: Yellow; width: 80%" />
                                </td>
                            </tr>
                            <tr>
                                <td class="RightTD">
                                    <asp:Label ID="lblTotalWork" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    جمع کل کارکرد:
                                </td>
                                <td class="RightTD">
                                    <asp:Label ID="lblSelectedDay" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    تعداد روز انتخاب شده:
                                </td>
                            </tr>
                            <tr>
                                <td class="RightTD">
                                    <asp:Label ID="lblTotalEzafeKar" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    جمع کل اضافه کار:
                                </td>
                                <td class="RightTD">
                                    <asp:Label ID="lblTotalKasrKar" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    جمع کل کسر کار:
                                </td>
                            </tr>
                            <tr>
                                <td class="RightTD">
                                    <asp:Label ID="lblTotalMission" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    جمع کل ماموریت ها:
                                </td>
                                <td class="RightTD">
                                    <asp:Label ID="lblTotalMorakhasi" runat="server" Text=""></asp:Label>
                                </td>
                                <td class="LeftTD">
                                    جمع کل مرخصی ها:
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:HyperLink runat="server" ImageUrl="~/App_Themes/eosMainThem/icons/45491.png"
                                        ID="hlPrint" Target="_blank" Visible="false"></asp:HyperLink>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <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="btnSubmit">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="lblError" />
                            <telerik:AjaxUpdatedControl ControlID="grdWorkDetail" />
                            <telerik:AjaxUpdatedControl ControlID="pnlTotal" />
                            <telerik:AjaxUpdatedControl ControlID="lblSelectedPersonName" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="grdWorkDetail">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="pnlTotal" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="hlPrint">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="hlPrint" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
        </table>
    </div>
</asp:Content>
