<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true"
    Inherits="site_HITS_ModelMap_Add" Title="eSecuritel - Model Map Add" Culture="auto"
    UICulture="auto" CodeBehind="Add.aspx.cs" %>

<%@ Register Src="~/Controls/PersistNav.ascx" TagName="PersistNav" TagPrefix="uc" %>
<%@ Register Src="~/Controls/ChildHeader.ascx" TagName="ChildHeader" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components"
    TagPrefix="cc1" %>
<%@ Register Src="../../../Controls/ModelMap/MMP_ReplacementSection.ascx" TagName="MMP_ReplacementSection" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ClientCarrierDropDowns.ascx" TagName="ClientCarrierDropDowns" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/Fulfillment/FulfillmentMethod.ascx" TagName="FulfillmentMethod" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

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

    <script language="javascript" type="text/javascript">

        // Get a reference to the PageRequestManager.
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_beginRequest(BeginRequest);
        prm.add_endRequest(EndRequest);

        // Executed when the async postback begins.
        function BeginRequest(sender, args) {
            document.getElementById("ProcessButtonsDIV").disabled = true;
            document.getElementById("ProcessButtonsDIV").className = "";
            document.getElementById("DivOrganization").disabled = true;

            var ctl1 = document.getElementById("ctl00_eContent_lblPleaseWaitOrganization");
            ctl1.innerText = "Please Wait..."; //Resources.Default.LabelPleaseWait;
            //document.getElementById("DivOrganization").className = "Progress";

        }

        // Executed when the async postback completes.
        function EndRequest(sender, args) {

            document.getElementById("ProcessButtonsDIV").disabled = false;
            document.getElementById("ProcessButtonsDIV").className = "";
            document.getElementById("DivOrganization").disabled = false;
            document.getElementById("DivOrganization").className = "";

            var ctl1 = document.getElementById("ctl00_eContent_lblPleaseWaitOrganization");
            ctl1.innerText = "";
            InitDdlModel();
        }

        function m_ddlModel_OnChange() {
            //            var ddlModel = $get('<%= m_ddlModel.ClientID %>');
            //            var txtTechType = $get('<%= m_txtTechType.ClientID %>');

            //            txtTechType.value = ddlModel.options[ddlModel.selectedIndex].TechType;
        }

        function InitDdlModel() {
            //            var ddlModel = $get('<%= m_ddlModel.ClientID %>');

            //            for (var i = 0; i < ddlModel.options.length; i++) {
            //                ddlModel.options[i].TechType = GetTechType(ddlModel.options[i].value);
            //            }

            //            m_ddlModel_OnChange();
        }

        function GetTechType(modelID) {
            var toRet = '';

            //            for (var i = 0; i < allModels.length; i++) {

            //                if (allModels[i].HandsetModelID == modelID) {
            //                    toRet = allModels[i].TechType;
            //                    break;
            //                }
            //            }

            return toRet;
        }

    </script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table width="100%">
                <tr>
                    <td>
                        <h1>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources : ModelMapManagement,LabelModelMapAdd %>" />
                        </h1>
                    </td>
                    <td valign="top">
                        <uc:PersistNav ID="PersistNav1" runat="server" />
                    </td>
                </tr>
            </table>
            <uc:ChildHeader ID="ChildHeader1" runat="server" />
            <!---------------------------------------TABLE ------------------------------------------->
            <h2>
                <asp:Literal ID="m_litGeneralInfo" runat="server" Text="<%$ Resources : AdministrationManagement,LabelGeneralInformation %>" />
                <asp:Literal ID="lblSuccess" runat="server"></asp:Literal>
            </h2>
            <div class="greyblock">
                <span style="color: #ff0000">* </span>
                <asp:Literal ID="m_litRequired" runat="server" Text="<%$ Resources : Default,LabelIndicatesRequiredFields %>" />
                &nbsp;
                <asp:Label ID="lblPleaseWaitOrganization" runat="server" ForeColor="Red"
                    Text="" />
                <br />
                <table style="width: 100%">
                    <tr>
                        <td align="left">
                            <table border="0" cellpadding="0" cellspacing="0" >
                                <tr>
                                    <%--<td style="width: 132px" align="right">
                                        <span style="color: #ff0000">*</span>
                                        <asp:Literal ID="m_litOrganizationHeader" runat="server" Text="Carrier:" />
                                    </td>--%>
                                    <td style="width: 500px;"><%--align="left" style="padding: 0px; margin: 0px;">--%>
                                        <div id="DivOrganization" class="" style="text-align: left; padding: 0px; margin: 0px;">
                                            <%--<asp:DropDownList ID="m_ddlOrganization" runat="server" Width="316px" 
                                                AutoPostBack="true" Style="text-align: left; padding: 0px; margin: 0px;" 
                                                Height="21px">
                                            </asp:DropDownList>--%>
                                            <uc1:ClientCarrierDropDowns
                                                ID="ucClientCarrierDropDowns"
                                                runat="server"
                                                DropDownWidth="316px"
                                                LabelWidth="132"
                                                OnClientChanged="ucClientCarrierDropDowns_ClientChanged"
                                                OnCarrierChanged="ucClientCarrierDropDowns_CarrierChanged"
                                                OrientationOfDropDowns="Vertical" ShowValidator="true" />
                                        </div>
                                    </td>
                                    <td align="right" style="width: 210px">
                                        <asp:Literal ID="m_litSLAHours" runat="server" Text="<%$ Resources : InventoryManagement,LabelSLADaysUntilInventoryAvailableColon %>" />
                                        <asp:Label ID="lblRequireCarrier" Text="*" runat="server" ForeColor="Red" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="m_txtSLADays" runat="server" Width="300px" Text="72"></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="validateSLAhours" Text="<%$ Resources : Default,LabelOnlyNumbersAreAllowed %>" ControlToValidate="m_txtSLADays" runat="server" Display="Dynamic" EnableClientScript="false" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                            </table>
                            <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
                                <tr>
                                    <td style="width: 132px;" align="right">
                                        <asp:Literal ID="m_litModelHeader" runat="server" Text="<%$ Resources : ModelManagement,LabelModelColon %>" />
                                    </td>
                                    <td style="width: 301px;" align="left">
                                        <asp:DropDownList ID="m_ddlModel" runat="server" Width="322px"
                                            OnSelectedIndexChanged="m_ddlModel_SelectedIndexChanged" AutoPostBack="true">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="right">
                                        <asp:Literal ID="Literal6" runat="server" Text="<%$ Resources : ModelMapManagement, LabelReturnSKU %>" />
                                    </td>
                                    <td style="width: 455px">
                                        <asp:TextBox ID="m_txtReturnSKU" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    
                                </tr>
                                <tr>
                                    <td style="width: 132px" align="right">
                                        <asp:Literal ID="m_litTechType" runat="server" Text="<%$ Resources: SubscriberManagement,LabelTechnologyTypeColon %>" />
                                    </td>
                                    <td style="width: 275px">
                                        <asp:TextBox ID="m_txtTechType" runat="server" Width="310px" ReadOnly="true"></asp:TextBox>
                                    </td>                                    
                                     <td style="width: 132px" align="Right">
                                        <asp:Literal ID="m_litModelFlagHeader" runat="server" Text="<%$ Resources : Default,LabelUnfulfillableColon %>" />
                                    </td>
                                    <td style="width: 301px">
                                        <asp:CheckBox ID="m_chbModelFlag" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="width: 132px">
                                        <asp:Literal ID="m_litOrgModelsHeader" runat="server" Text="<%$ Resources : ModelManagement,LabelCompanysSpaceModelsColon %>" />
                                    </td>
                                    <td style="width: 301px">
                                        <asp:TextBox ID="m_txtOrgModels" TextMode="MultiLine" runat="server" Width="316px"
                                            Height="70"></asp:TextBox>
                                    </td>
                                    <td style="width: 132px" align="Right">
                                        <asp:Literal ID="m_litFulfillmentMethod" runat="server" Text="<%$ Resources: FulfillmentManagement, LabelFulfillmentMethodColon %>" />
                                    </td>
                                    <td>
                                        <uc:FulfillmentMethod runat="server" ID="m_fulfillmentMethod" RepeatDirection="Horizontal"></uc:FulfillmentMethod>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 132px" align="right">
                                        <asp:Literal ID="Literal4" runat="server" Text="<%$ Resources : OrganizationManagement,ActiveColonLabel %>" />
                                    </td>
                                    <td style="width: 455px">
                                        <asp:CheckBox ID="m_chbActive" runat="server" Checked="true" />
                                    </td>
                                    <td align="right">
                                        <asp:Literal ID="ReimbursementEnabledLiteral" runat="server" Text="<%$ Resources : ModelMapManagement,LabelReimbursementEnabled %>" />
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="m_chbReimbursementEnabled" runat="server" Text="<%$ Resources : ModelMapManagement,LabelChkbxCashCardReimbursement %>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 132px" align="right">
                                        <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources : ModelMapManagement,EOLColonLabel %>" />
                                    </td>
                                    <td style="width: 455px">
                                        <asp:CheckBox ID="m_chbEol" runat="server" />
                                    </td>
                                      <td align="right">
                                        <asp:Literal ID="Literal8" runat="server" Text="<%$ Resources : ModelMapManagement, LabelDefectiveClaimLimitForAEToPEConversion %>" />
                                    </td>

                                    <td style="width: 455px">
                          
                                        <asp:TextBox ID="m_txtDefectiveClaimLimitForAEToPEConversion" runat="server" Width="50px"></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="vldtDefectiveClaimLimitForAEToPEConversion" Text="<%$ Resources : Default,LabelOnlyNumbersAreAllowed %>" ControlToValidate="m_txtDefectiveClaimLimitForAEToPEConversion" runat="server" Display="Dynamic" EnableClientScript="false" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                          
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Literal ID="Literal9" runat="server" Text="<%$ Resources : ModelMapManagement, AltSKU %>" />
                                    </td>
                                    <td style="width: 455px">
                                        <asp:TextBox ID="txtAltSKU" runat="server" TextMode="MultiLine" Width="308px" Height="70"></asp:TextBox>
                                    </td>
                                    <td></td>
                                    <td></td>
                                </tr>

                            </table>
                        </td>
                        <td valign="top">&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div runat="server" id="InsuranceReplacementDiv" visible="false">
                <h2>
                    <asp:Literal ID="m_litReplacementHeader" runat="server" Text="<%$ Resources : ClaimsManagement,LabelInsuranceReplacement %>" />
                </h2>
                <div class="greyblock">
                    <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
                        <tr>
                            <td align="center" style="width: 15%">&nbsp;
                            </td>
                            <td align="center" style="width: 15%">
                                <b>
                                    <asp:Literal ID="m_litSKUHeader" runat="server" Text="eSecuritel SKUs" /></b>
                            </td>
                            <td align="center" style="width: 15%">
                                <b>
                                    <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources : OrganizationManagement,LabelClientSKUs %>" /></b>
                            </td>

                            <td align="center" style="width: 120px">
                                <b>
                                    <asp:Literal ID="Literal5" runat="server" Text="<%$ Resources : OrganizationManagement,LabelBrightstarSKU %>" /></b>
                            </td>


                            <%-- <td align="center" style="width: 15%">
                                <b>
                                    <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:OrganizationManagement,LabelBrightstarReturnSKU %>" /></b>
                            </td>--%>

                            <td align="center" style="width: 15%">
                                <b>
                                    <asp:Literal ID="m_litWarrantyFeeHeader" runat="server" Text="<%$ Resources:OrganizationManagement,LabelIncludeSimWithReplacement %>" /></b>
                            </td>
                            <td align="center" style="width: 25%">&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <b>
                                    <asp:Literal ID="m_litOrganicRowTitle" runat="server" Text="<%$ Resources : Default,LabelHandsetOnly %>" /></b>
                            </td>
                            <td align="right">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtOrganicSKU" runat="server" Width="200px"
                                    Height="50" />
                            </td>
                            <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtHandsetOnlyClientSku" runat="server" Width="200px"
                                    Height="50" />
                            </td>

                            <td style="width: 120px">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtOrganicBrightstarSKU" runat="server" Width="200px"
                                    Height="50" />
                            </td>

                            <%--  <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtHandsetOnlyReturnSku" runat="server" Width="200px"
                                    Height="50" />
                            </td>--%>


                            <td align="center" style="width: 455px">
                                <asp:CheckBox ID="m_chbINSIncludeSimWithReplacementHandsetOnly" runat="server" />
                            </td>
                            <td>&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <b>
                                    <asp:Literal ID="m_litRefurbishedRowTitle" runat="server" Text="<%$ Resources : Default,LabelNonNewKit %>" /></b>
                            </td>
                            <td align="right">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtRefurbishedSKU" runat="server" Width="200px"
                                    Height="50" />
                            </td>
                            <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNonNewClientSku" runat="server" Width="200px" Height="50" />
                            </td>

                            <td style="width: 120px">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNonNewBrightstarSku" runat="server" Width="200px" Height="50px" />
                            </td>

                            <%-- <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNonNewReturnSku" runat="server" Width="200px" Height="50" />
                            </td> --%>

                            <td align="center" style="width: 455px">
                                <asp:CheckBox ID="m_chbINSIncludeSimWithReplacementNonNewKit" runat="server" />
                            </td>
                            <td>&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <b>
                                    <asp:Literal ID="m_litRefurbishedRowTitle0" runat="server" Text="<%$ Resources : Default,LabelNewKit %>" /></b>
                            </td>
                            <td align="right">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNewSKU" runat="server" Width="200px" Height="50" />
                            </td>
                            <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNewClientSku" runat="server" Width="200px" Height="50" />
                            </td>

                            <td style="width: 120px">
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNewBrightstarSku" runat="server" Width="200px" Height="50px" />
                            </td>

                            <%-- <td>
                                <asp:TextBox TextMode="MultiLine" ID="m_txtNewReturnedSku" runat="server" Width="200px" Height="50" />
                            </td>--%>

                            <td align="center"  style="width: 455px">
                                <asp:CheckBox ID="m_chbINSIncludeSimWithReplacementNewKit" runat="server" />
                            </td>
                            <td>&nbsp;
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <h2>
                <asp:Literal ID="literalMWReplacementHeader" runat="server" Text="<%$ Resources : Default,LabelMWReplacementHeader%>" />
            </h2>
            <div class="greyblock">
                <uc1:MMP_ReplacementSection ID="MWReplacement" SkuHeader="Manufacturer Warranty"
                    Visible="false" runat="server" OrganicRowTitle="Handset Only" RefurbishedRowTitle="Non New Kit" NewRowTitle="New Kit" />
            </div>
            <h2>
                <asp:Literal ID="literalReturnReplacementHeader" runat="server" Text="<%$ Resources : Default,LabelReturnReplacementHeader%>" />
            </h2>
            <div class="greyblock">
                <uc1:MMP_ReplacementSection ID="ReturnReplacement" SkuHeader="Return"
                    Visible="false" runat="server" OrganicRowTitle="Handset Only" RefurbishedRowTitle="Non New Kit" NewRowTitle="New Kit" />
            </div>
            <table width="100%">
                <tr>
                    <td style="width: 375px">
                        <asp:CustomValidator ID="Validator1" runat="server" ErrorMessage="" ValidationGroup="SearchValidation"
                            Visible="false" />
                        <asp:ValidationSummary ID="ValidationSummary" runat="server" BorderStyle="none" ValidationGroup="SearchValidation"
                            Width="361px" />
                    </td>
                    <td align="left" valign="top">
                        <div id="ProcessButtonsDIV" class="" style="width: 202px; height: 38px; padding: 10px; text-align: center">
                            <asp:Button ID="m_btnSave" runat="server" Text="<%$ Resources : Default,ButtonSave %>" CssClass="pagebutton"
                                OnClick="btnAdd_Click" CausesValidation="False" />
                            <asp:Button ID="m_btnCancel" runat="server" Text="<%$ Resources : Default,ButtonCancel %>" CssClass="pagebutton"
                                OnClientClick="javascript:window.close();" />
                        </div>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
