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

<%@ Register Src="../ASCX/WorkCalendar.ascx" TagName="WorkCalendar" TagPrefix="uc1" %>
<%@ 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" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript">
        function ddlMissionList_OnSelectedIndexChanged(e) {
            for (var i = 0; i < window.Page_Validators.length; i++) {
                var validator = window.Page_Validators[i];
                var hourlyValidatorIds = ["txtBeginTimeRegexValidator",
                    "txtBeginTimeRequiredValidator",
                    "txtEndTimeRegexValidator",
                    "txtEndTimeRequiredValidator"];
                var isDaily = e.options[e.options.selectedIndex].getAttribute("isdaily") == "0";
                for (var j = 0; j < hourlyValidatorIds.length; j++) {
                    if (hourlyValidatorIds[j] == validator.id) {
                        window.ValidatorEnable(validator, isDaily);
                    }
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
    <table width="100%" border="0">
        <tr>
            <td colspan="2" align="right">
                <asp:Image ID="Image1" runat="server" SkinID="imgAddMissionLabel" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="CenterTD">
                <asp:Label ID="lblNote" runat="server" Text="" SkinID="LblWhiteFont"></asp:Label>
                <hr style="size: 1; width: 80%; color: Yellow" />
                <asp:Label ID="lblError" runat="server" Text="" SkinID="LblError"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RightTD" dir="rtl">
                <asp:DropDownList ID="ddlMissionList" runat="server" AutoPostBack="True" onChange="ddlMissionList_OnSelectedIndexChanged(this)" OnSelectedIndexChanged="ddlMissionList_SelectedIndexChanged"
                    SkinID="ddlYellow" Width="200px" >
                </asp:DropDownList>
            </td>
            <td class="LeftTD" style="width: 150px">
                نوع ماموریت:
            </td>
        </tr>
        <tr>
            <td class="RightTD" dir="rtl">
                <asp:DropDownList ID="ddlCity" runat="server" SkinID="ddlYellow" Width="200px">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="rfvCity" runat="server" ControlToValidate="ddlCity"
                    Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
            <td class="LeftTD" style="width: 150px">
                نام شهر:
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Panel runat="server" ID="pnlBeginTime" Visible="false">
                    <table width="100%" cellpaddin="0" cellspacing="0">
                        <tr>
                            <td align="right">
                                <asp:RegularExpressionValidator ClientIDMode="Static" ID="txtBeginTimeRegexValidator" runat="server" ControlToValidate="txtBeginTime"
                                    Font-Names="Tahoma" Font-Size="8pt" ErrorMessage="ساعت را صحیح وارد نمایید" ValidationExpression="(0[0-9]|[1][0-9]|[2][0123])[:](0[0-9]|[1-5][0-9])"></asp:RegularExpressionValidator>
                                <asp:RequiredFieldValidator ClientIDMode="Static" ID="txtBeginTimeRequiredValidator" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtBeginTime"></asp:RequiredFieldValidator>
                                <asp:TextBox ID="txtBeginTime" runat="server" Width="100px"></asp:TextBox>
                                <cc1:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtBeginTime"
                                    AutoComplete="false" MaskType="Time" Mask="99:99">
                                </cc1:MaskedEditExtender>
                            </td>
                            <td class="LeftTD" style="width: 150px">
                                از ساعت:
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" 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="RequiredFieldValidator3" runat="server" ControlToValidate="txtbeginDate"
                    Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:TextBox ID="txtbeginDate" runat="server" Width="100px"></asp:TextBox>
                <cc1:MaskedEditExtender ID="MaskedEditExtender3" 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"
                                NextPrevStyle-ForeColor="White">
                            </KingOfDotNet:PersianCalendar>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
            <td class="LeftTD" style="width: 150px">
                از تاریخ:
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Panel runat="server" ID="pnlEndTime" Visible="false">
                    <table width="100%" cellpaddin="0" cellspacing="0">
                        <tr>
                            <td align="right">
                                <asp:RegularExpressionValidator ClientIDMode="Static" ID="txtEndTimeRegexValidator" runat="server" ControlToValidate="txtEndTime"
                                    Font-Names="Tahoma" Font-Size="8pt" ErrorMessage="ساعت را صحیح وارد نمایید" ValidationExpression="(0[0-9]|[1][0-9]|[2][0123])[:](0[0-9]|[1-5][0-9])"></asp:RegularExpressionValidator>
                                <asp:RequiredFieldValidator ClientIDMode="Static" ID="txtEndTimeRequiredValidator" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtEndTime"></asp:RequiredFieldValidator>
                                <asp:TextBox ID="txtEndTime" runat="server" Width="100px"></asp:TextBox>
                                <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtEndTime"
                                    AutoComplete="false" MaskType="Time" Mask="99:99">
                                </cc1:MaskedEditExtender>
                            </td>
                            <td class="LeftTD" style="width: 150px">
                                تا ساعت:
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" 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="RequiredFieldValidator4" runat="server" ControlToValidate="txtEndDate"
                    Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:TextBox ID="txtEndDate" runat="server" Width="100px"></asp:TextBox>
                <cc1:MaskedEditExtender ID="MaskedEditExtender4" 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">
                            </KingOfDotNet:PersianCalendar>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </td>
            <td class="LeftTD" style="width: 150px">
                تا تاریخ:
            </td>
        </tr>
        <tr>
            <td class="RightTD" dir="rtl">
                <asp:TextBox ID="txtPlace" runat="server" Width="300px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPlace" runat="server" ControlToValidate="txtPlace"
                    Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
            <td class="LeftTD" style="width: 150px">
                محل ماموریت:
            </td>
        </tr>
        <tr>
            <td class="RightTD" dir="rtl">
                <asp:TextBox ID="txtDescrption" runat="server" Rows="3" TextMode="MultiLine" Width="540px"></asp:TextBox>
            </td>
            <td class="LeftTD" style="width: 150px">
                توضیحات:
            </td>
        </tr>
        <tr>
            <td align="left" colspan="2">
                <div style = "margin-left:90px;">
                    <div style="float: left; margin-right: 3px">
                        <asp:Button ID="btnRegisterMission" runat="server" Text="ثبت ماموریت" SkinID="btnOrange"
                            OnClick="btnRegisterMission_Click" Enabled="False" />
                    </div>
                    <div style="float: left;">
                        <asp:Button ID="btnWorkCalendar" runat="server" Text="تقویم کاری" SkinID="btnOrange"
                            OnClick="btnWorkCalendar_Click" CausesValidation="False" />
                    </div>
                    <div style="clear: both">
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <uc1:WorkCalendar ID="workCalendar" runat="server" Visible="false" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"
        InitialDelayTime="2" MinDisplayTime="100" Width="542px">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlMissionList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlBeginTime" />
                    <telerik:AjaxUpdatedControl ControlID="pnlEndTime" />
                    <telerik:AjaxUpdatedControl ControlID="btnRegisterMission" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnWorkCalendar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="workCalendar" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRegisterMission">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="btnRegisterMission" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
  
</asp:Content>
