<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="True"
    Inherits="site_HITS_Subscriber_Add" Title="Brightstar Device Protection: Create New Subscriber"
    Theme="eMain" Culture="auto" UICulture="auto"
    CodeBehind="Add.aspx.cs" %>

<%@ Register Src="~/Controls/ChildHeader.ascx" TagName="ChildHeader" TagPrefix="uc" %>
<%@ Register Src="~/Controls/PhoneNumber.ascx" TagName="PhoneNumber" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/PersistNav.ascx" TagName="PersistNav" TagPrefix="uc" %>
<%@ Register Src="~/Controls/HITSCalendar.ascx" TagName="HITSCalendar" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components" TagPrefix="cc1" %>
<%@ Register Src="~/Controls/ClientCarrierDropDowns.ascx" TagName="ClientCarrierDropDowns" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/AddressValidationLookup.ascx" TagName="ucAddressLookupDlg" TagPrefix="uc" %>
<%@ Register TagPrefix="eSecuritelHITSControls" Namespace="WebSite.Controls" Assembly="WebSite" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>

    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryTop" runat="server" HeaderText="The following items need to be reviewed before creating a new subscriber." />
    <table width="100%">
        <tr>
            <td>
                <h1>
                    <asp:Literal ID="m_litAddNewSubscriberHeader" runat="server" Text="<%$ Resources: SubscriberManagement, CreateNewSubscriber %>" />
                </h1>
            </td>
            <td valign="top">
                <uc:PersistNav ID="PersistNav1" runat="server" />
            </td>
        </tr>
    </table>
    <uc:ChildHeader ID="ChildHeader1" runat="server" />
    <center>
        <asp:Label ID="m_lblCannotAdd" runat="server" ForeColor="Red" Font-Bold="true" Text="<%$ Resources: SubscriberManagement, LabelNotCreateNewSubs4DeactivatedCarrier %>" />
    </center>
    <asp:Panel ID="m_pnlMain" runat="server">
        <h2>
            <asp:Literal ID="m_litGeneralInfoHeader" runat="server" Text="<%$ Resources : UsersManagement,LabelGeneralInformation %>" />
            <asp:Label ID="m_lblStatus" runat="server" /></h2>
        <div class="greyblock">
            <span class="required">*</span>
            <asp:Literal ID="m_litRequired" runat="server" Text="<%$ Resources : Default,LabelIndicatesRequiredFields %>" />

            <div class="div-customSubscriber-Row">
                <div class="client-div">
                    <uc1:ClientCarrierDropDowns
                        ID="ucClientCarrierDropDowns"
                        runat="server"
                        LabelWidth="108"
                        OnClientChanged="ucClientCarrierDropDowns_ClientChanged"
                        OnCarrierChanged="ucClientCarrierDropDowns_CarrierChanged"
                        OrientationOfDropDowns="Vertical" ShowValidator="true" />

                </div>
                <div class="div-subscriberAcc">
                    <asp:Literal ID="m_litAccountNumber" runat="server" Text="<%$ Resources : SubscriberManagement,LabelAccountNumberSign %>" />
                    <span class="required">*</span>
                </div>
                <div class="div-subscriberAcc-inputContainter">
                    <asp:TextBox ID="m_txtAccountNumber" runat="server" />
                    <asp:RequiredFieldValidator ID="m_rfAccountNumber" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                        ControlToValidate="m_txtAccountNumber" Display="Dynamic" ErrorMessage="<%$ Resources : SubscriberManagement,ErrorMessageAccountNumberRequired %>"
                        ToolTip="<%$ Resources : SubscriberManagement,ErrorMessageAccountNumberRequired %>" />
                </div>

            </div>

            <table border="0" cellpadding="0" cellspacing="0" class="gvTable tbl-subscrAcc">

                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litLastName" runat="server" Text="<%$ Resources : Default,LastNameLabel %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtLastName" runat="server" />
                        <asp:RequiredFieldValidator ID="m_rfLastName" runat="server" ControlToValidate="m_txtLastName"
                            Display="Dynamic" Text="<%$ Resources:Default, ValidatorText %>" ToolTip="<%$ Resources : SubscriberManagement,ToolTipLastNameRequired %>"
                            ErrorMessage="<%$ Resources : SubscriberManagement,ToolTipLastNameRequired %>" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litFirstName" runat="server" Text="<%$ Resources: SubscriberManagement, LabelFirstName %>" />
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtFirstName" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litAddress1" runat="server" Text="<%$ Resources: AddressResources, Address1 %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtAddress1" runat="server" />
                        <asp:RequiredFieldValidator ID="m_rftxtAddress1" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ControlToValidate="m_txtAddress1" Display="Dynamic" ErrorMessage="<%$ Resources: AddressResources, ErrorMessageAddressIsRequired %>"
                            ToolTip="<%$ Resources: AddressResources, ErrorMessageAddressIsRequired %>" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litAddress2" runat="server" Text="<%$ Resources: AddressResources, Address2 %>" />
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtAddress2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litCity" runat="server" Text="<%$ Resources : AddressResources,City %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtCity" runat="server" />
                        <asp:RequiredFieldValidator ID="m_rftxtCity" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ControlToValidate="m_txtCity" Display="Dynamic" ErrorMessage="City is required"
                            ToolTip="City is required" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litCountry" runat="server" Text="<%$ Resources : AddressResources,Country %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="m_ddlCountry" runat="server" Width="100px" CausesValidation="false" OnSelectedIndexChanged="m_ddlCountry_SelectedIndexChanged" AutoPostBack="true" />

                        <asp:CustomValidator ID="m_cvCountry" runat="server" ControlToValidate="m_ddlCountry"
                            Text="<%$ Resources:Default, ValidatorText %>" OnServerValidate="m_cvCountry_ServerValidate" />

                        <asp:RequiredFieldValidator ID="m_frddlCountry" runat="server" ControlToValidate="m_ddlCountry"
                            Text="<%$ Resources:Default, ValidatorText %>" InitialValue="<%$ Resources : Default,HeaderListDropDownTextSelect %>" />
                    </td>


                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litZip" runat="server" Text="<%$Resources : AddressResources,Zip %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtZip" runat="server" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="m_txtZip"
                            ValidationExpression="<%$ Resources:AddressResources, ZipValidation %>" Text="<%$ Resources:Default, ValidatorText %>"
                            Display="Dynamic" ErrorMessage="<%$ Resources : AddressResources,ErrorMessageZipCodeisInAnInvalidFormat %>" ToolTip="<%$ Resources : AddressResources,ErrorMessageZipCodeisInAnInvalidFormat %>" />
                    </td>

                    <td class="td-alignRight">
                        <asp:Literal ID="m_litState" runat="server" Text="<%$ Resources:AddressResources, State  %>" />
                        <span class="required">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="m_ddlState" runat="server" CausesValidation="false">
                            <asp:ListItem Text="<%$ Resources : Default,HeaderListDropDownTextSelect %>"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:CustomValidator ID="m_cvState" runat="server" ControlToValidate="m_ddlState"
                            Text="<%$ Resources:Default, ValidatorText %>" OnServerValidate="m_cvState_ServerValidate" />
                        <asp:RequiredFieldValidator ID="m_frddlState" runat="server" ControlToValidate="m_ddlCountry"
                            Text="<%$ Resources:Default, ValidatorText %>" InitialValue="<%$ Resources : Default,HeaderListDropDownTextSelect %>" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight" nowrap="nowrap">
                        <asp:Literal ID="m_litHomePhone" runat="server" Text="<%$ Resources: SubscriberManagement, LabelHomePhoneColon %>" />
                    </td>
                    <td nowrap="nowrap">
                        <uc1:PhoneNumber ID="m_ucHomePhone" runat="server" Required="false" CssClass="homePhone-SubAcc-input" />
                        <asp:Label ID="m_txtExample" runat="server" CssClass="span-example" Text="<%$ Resources: UsersManagement, LabelExamplexxxxxxxxxx %>"></asp:Label><br />
                    </td>
                    <td class="td-alignRight" nowrap="nowrap">
                        <asp:Literal ID="m_litAltPhone" runat="server" Text="Alt Phone:" />
                    </td>
                    <td nowrap="nowrap" class="td-altPhoneNumber">
                        <uc1:PhoneNumber ID="m_ucAltPhone" runat="server" Required="false" CssClass="td-altPhoneNumber-input" />
                        <asp:Literal ID="m_litAltExt" runat="server" Text="ext" />
                        <asp:TextBox ID="m_txtExt" runat="server" CssClass="txtExt-smallBox" Width="45" />
                        <asp:Label ID="Label1" runat="server" CssClass="span-example" Text="<%$ Resources: UsersManagement, LabelExamplexxxxxxxxxx %>"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight" nowrap="nowrap">
                        <asp:Literal ID="m_litSubscriberSince" runat="server" Text="Subscriber Since:" />
                        <span class="required">*</span>
                    </td>
                    <td nowrap="nowrap">
                        <uc:HITSCalendar ID="m_calSubscriberSince" runat="server" Required="true" CssClass=" width-subscAcc" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litEmail" runat="server" Text="<%$ Resources : SubscriberManagement,LabelEmailColon %>" />
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtEmail" runat="server" />
                        <asp:RegularExpressionValidator ID="m_regExValEmail" runat="server" ControlToValidate="m_txtEmail"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Text="<%$ Resources:Default, ValidatorText %>"
                            Display="Dynamic" ErrorMessage="Email is not in an invalid format" ToolTip="Email is not in an invalid format" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight" nowrap="nowrap">
                        <asp:Literal ID="m_litCoveredSince" runat="server" Text="Covered Since:" />
                        <span class="required">*</span>
                    </td>
                    <td nowrap="nowrap">
                        <uc:HITSCalendar ID="m_calCoveredSince" runat="server" Required="true" CssClass=" width-subscAcc" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litAccountType" runat="server" Text="Account Type:" />
                    </td>
                    <td>
                        <asp:DropDownList ID="m_ddlAccountType" DataTextField="RefName" DataValueField="ID" runat="server"></asp:DropDownList>
                    </td>

                </tr>
            </table>
        </div>

        <h2>
            <asp:Literal ID="m_litHandsetInformation" runat="server" Text="Handset Information" />
        </h2>
        <div class="greyblock">
            <table border="0" cellpadding="0" cellspacing="0" class="gvTable tbl-subscrAcc">
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litMIN" runat="server" Text="MIN:" />
                    </td>
                    <td>
                        <uc1:PhoneNumber ID="m_ucMIN" runat="server" Required="false" CssClass="homePhone-SubAcc-input" />
                        <asp:Label runat="server" CssClass="span-example" Text="<%$ Resources: UsersManagement, LabelExamplexxxxxxxxxx %>" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litModelName" runat="server" Text="Model Name:" />
                        <span class="required">* </span>
                    </td>
                    <td>
                        <asp:DropDownList ID="m_ddlModelName" runat="server" AutoPostBack="true" />
                        <asp:CustomValidator ID="m_cvModelName" runat="server" ControlToValidate="m_ddlModelName"
                            Display="Dynamic" Text="<%$ Resources:Default, ValidatorText %>" OnServerValidate="m_cvDropDownGeneral_ServerValidate"
                            ToolTip="Model is required" ErrorMessage="Model is required" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litMDN" runat="server" Text="<%$ Resources : HandsetManagement,LabelMDNColon %>" />
                        <span class="required" runat="server" id="m_litMDN_required">* </span>
                    </td>
                    <td>
                        <uc1:PhoneNumber ID="m_ucMDN1" runat="server" Required="true" CssClass="homePhone-SubAcc-input" />
                        <asp:Label runat="server" CssClass="span-example" Text="<%$ Resources: UsersManagement, LabelExamplexxxxxxxxxx %>" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litBornOnDate" runat="server" Text="Born On Date:" />
                        <span class="required">* </span>
                    </td>
                    <td>
                        <asp:Label ID="lblBornOnDate" runat="server"></asp:Label>
                        <uc:HITSCalendar ID="m_calBornOnDate" runat="server" Required="true" CssClass=" width-subscAcc" />
                    </td>
                </tr>
                <tr>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litESN_IMEI" runat="server" Text="ESN/IMEI:" />
                        <span class="required">* </span>
                    </td>
                    <td>
                        <asp:TextBox ID="m_txtESN_IMEI" runat="server" />
                        <asp:RequiredFieldValidator ID="m_rfESN_IMEI" runat="server" ControlToValidate="m_txtESN_IMEI"
                            Display="Dynamic" Text="<%$ Resources:Default, ValidatorText %>" ToolTip="ESN/IMEI is required"
                            ErrorMessage="ESN/IMEI is required" />
                        <asp:CustomValidator ID="m_cvESN_IMEI" runat="server" ControlToValidate="m_txtESN_IMEI"
                            EnableClientScript="true" ErrorMessage="<%$ Resources: SubscriberManagement, ErrorMessageNotValidESNIMEI %>"
                            OnServerValidate="m_cvESN_IMEI_ServerValidate" ToolTip="<%$ Resources: SubscriberManagement, ToolTipESNIMEIMustBeValidLength %>"
                            Text="<%$ Resources:Default, ValidatorText %>" />
                    </td>
                    <td class="td-alignRight">
                        <asp:Literal ID="m_litTechType" runat="server"
                            Text="<%$ Resources: SubscriberManagement,LabelTechnologyTypeColon %>" />
                    </td>
                    <td>
                        <asp:Label ID="lblTechType" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
        <h2>
            <asp:Literal ID="m_litRatePlans" runat="server" Text="Service Plans" />
        </h2>
        <div id="divRatePlanFeatureSearchDiv" style="background-color: #DBDCDE">
            <eSecuritelHITSControls:RatePlanSelectionGrid runat="server" ID="m_ucRatePlans"></eSecuritelHITSControls:RatePlanSelectionGrid>
        </div>
        <h2>
            <asp:Literal ID="m_litNotes" runat="server" Text="Notes" />
        </h2>
        <div class="greyblock">
            <div class="div-notesWrapper">
                <div class="div-notesInfo">
                    <b>
                        <asp:Literal ID="m_litDate" runat="server" /></b>
                    (<asp:Literal ID="m_litUserName" runat="server" />)
                </div>
                <div class="div-center">
                    <asp:TextBox ID="m_txtNotes" runat="server" TextMode="MultiLine" CssClass="notestb-subsAcc" />
                </div>
            </div>
        </div>
        <div class="div-searchbuttons-center">
            <asp:Button ID="m_btnAdd" runat="server" Text="<%$ Resources : Default,ButtonCreate %>" OnClick="m_btnAdd_Click" CssClass="pagebutton" />
            <asp:Button ID="m_btnCancel" runat="server" Text="<%$ Resources : Default,ButtonCancel %>" OnClick="m_btnCancel_Click"
                CssClass="pagebutton" CausesValidation="False" />
        </div>
    </asp:Panel>
    <!-- Code to support the Address Lookup Popup -->
    <asp:Panel runat="server" ID="pnlAddressLookupDialogPopup" CssClass=""
        Style="display: none; width: 800px; height: 400px;">
        <asp:Panel ID="pnlMatchingAddressHeader" runat="server" EnableViewState="false" CssClass="modalHeader">
            <asp:Label ID="Label2" runat="server" EnableViewState="false" Text="<%$ Resources: AddressResources, SelectAppropriateSubscriberAddress %>" />
        </asp:Panel>
        <asp:Panel ID="pnlMatchingAddressBody" runat="server" CssClass="modalContent" Style="text-align: left;">
            <uc:ucAddressLookupDlg ID="aldMatch" runat="server" />
        </asp:Panel>
    </asp:Panel>
    <eSecuritelHITSControls:HITSModalPopupExtender ID="mdlAddressLookupPopupDialog" runat="server" TargetControlID="btnOnlyHereToSatisfyTargetControlIDForPopup"
        PopupControlID="pnlAddressLookupDialogPopup" BackgroundCssClass="modalBackground"
        CancelControlID="btnOnlyHereToSatisfyTargetControlIDForPopup2" BehaviorID="mdlAddressLookupPopupDialog">
    </eSecuritelHITSControls:HITSModalPopupExtender>
    <span style="display: none">
        <asp:Button runat="server" ID="btnOnlyHereToSatisfyTargetControlIDForPopup2" Text="If you see me, there is an error." /><br />
        <asp:Button runat="server" ID="btnOnlyHereToSatisfyTargetControlIDForPopup" Text="If you see me, there is an error." /><br />
    </span>
    <!-- End of the road for the address Lookup stuff. -->
    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryBottom" runat="server" HeaderText="The following items need to be reviewed before creating a new subscriber." />
</asp:Content>
