<%@ Page Title="" Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true"
    Theme="eMain" Culture="auto" UICulture="auto"
    EnableEventValidation="false"
    CodeBehind="Default.aspx.cs" Inherits="site_HITS_CompanyAccessories_Default" %>

<%@ Register Src="~/Controls/ScriptingHelper.ascx" TagName="ScriptingHelper" TagPrefix="uc" %>
<%@ Register Src="~/Controls/DefaultHeader.ascx" TagName="DefaultHeader" 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/CompanyAccessoryAddPopup.ascx" TagName="AddPop" TagPrefix="apop" %>
<%@ Register Src="~/Controls/PopupWindow.ascx" TagName="PopupWindow" TagPrefix="uc" %>



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

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

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

    <uc:ScriptingHelper ID="ScriptingHelper1" runat="server" />
    <h1>
        <asp:Literal ID="m_litHandsetAccessory" runat="server" Text="<%$ Resources: ModelManagement, LabelTitleAccessoriesMap %>" />
    </h1>

    <uc:DefaultHeader ID="DefaultHeader1" runat="server" />



    <div class="mastersearch">
        <table cellspacing="0" cellpadding="0">
            <tr>
                <td style="padding-right: 0px">
                    <img id="m_imgSearchCriteria" runat="server" src="../../../images/Collapse_13x13.jpg" class="showstate"
                        onclick="expandMasterSearch(this, 'm_pnlMasterSearchCriteria')" alt="contract" />
                </td>
                <td width="100%" valign="middle">
                    <asp:Literal ID="m_litFilters" runat="server" Text="<%$ Resources: Default, LabelSearchCriteria %>" /></td>
            </tr>
        </table>
    </div>

    <div id="m_pnlMasterSearchCriteria" style="background-color: #DBDCDE">
        <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
            <tr>
                <td colspan="2" align="left">
                    <div id="DivOrganization" style="margin-right: 0px;">
                        <uc1:ClientCarrierDropDowns ID="ClientCarrierDropDowns1" OnClientChanged="ucClientCarrierDropDowns_ClientChanged"
                            runat="server" DropDownWidth="219" LabelWidth="108" DefaultCarrierText="<%$ Resources: Default, HeaderListItemAll %>" />
                    </div>
                </td>
            </tr>
        </table>

        <div style="padding-left: 200px; background-color: White">
            <asp:Button ID="m_btnSearch" runat="server" Text="<%$ Resources : Default,ButtonSearch %>" CssClass="pagebutton" OnClick="m_btnSearch_Click" />
            <%--<input id="m_btnClear" type="button" runat="server" value="<%$ Resources : Default,ButtonClear %>" class="pagebutton" />--%>
        </div>
    </div>


    <asp:Panel ID="TempPanel" runat="server" />

    <%--  <asp:Panel ID="m_pnlCompanyAccessoryGrid" Visible="False" runat="server">--%>
    <asp:Panel ID="m_pnlSearchResults" runat="server">
        <h2>
            <asp:Literal ID="m_litSearchResults" runat="server" Text="<%$ Resources : Default,LabelSearchResults %>" />
            <asp:Label ID="m_lblSuccessMessage" runat="server" CssClass="successmessage" Visible="True" />
        </h2>
    </asp:Panel>
    <%--    </asp:Panel>--%>
    <asp:Label ID="m_lblNoAccessoriesFound" Font-Bold="True" ForeColor="Red" runat="server"
        Visible="False" Text="<%$ Resources : Default,LabelNoResultsFound %>" />

    <br />
    <asp:UpdatePanel ID="pnlAccessoryAssociation" runat="server" UpdateMode="Always">
    <ContentTemplate>
    <asp:Panel ID="m_pnlCompanyAccessoryGrid" runat="server" Style="background-color: #DBDCDE" BorderColor="Transparent" BorderWidth="0">

        <%--<aa:AccessoryAssociations ID="aaManufacturerAccessoryAssociations" runat="server" />--%>
        <asp:GridView ID="gridViewAccessoryAssociation" Visible="False" Style="width: auto" runat="server">
            <Columns>
                <%-- <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <asp:CheckBox ID="checkBoxSelected" TextAlign="Left" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:CheckBox ID="checkBoxDeleted" TextAlign="Left" runat="server" Checked='<%#Eval("IsDeleted")%>'></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <%--<asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryType %>"
                    SortExpression="Type">
                    <ItemTemplate>
                        <asp:Label ID="labelType" TextAlign="Left" runat="server" Text='<%# Bind("TYPE_NAME") %>'></asp:Label>
                      <%--  <asp:HiddenField ID="hiddenFieldTypeId" runat="server" Value='<%# Bind("TYPE_ID") %>'></asp:HiddenField>
                        <asp:HiddenField ID="hiddenFieldAccessoryId" runat="server" Value='<%# Bind("ACCESSORY_ID") %>' />
                        <asp:HiddenField ID="hiddenFieldId" runat="server" Value='<%# Bind("Id") %>'></asp:HiddenField>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryName %>"
                    SortExpression="Name">
                    <ItemTemplate>
                        <asp:Label ID="labelName" TextAlign="Left" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%--<asp:TemplateField HeaderText="<%$ Resources : ModelManagement, HeaderTextAccessoryManufacturer%>"
                    SortExpression="Manufacturer">
                    <ItemTemplate>
                        <asp:Label ID="labelManufacturer" TextAlign="Left" runat="server" Text='<%# Bind("MANUFACTURER_NAME") %>'></asp:Label>
                        <asp:HiddenField ID="hiddenFieldManufacturerId" runat="server" Value='<%# Bind("MANUFACTURER_ID") %>'></asp:HiddenField>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryDescription %>"
                    SortExpression="Description">
                    <ItemTemplate>
                        <asp:Label ID="labelDescription" TextAlign="Left" runat="server" Text='<%# Bind("DESCRIPTION") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryCost %>"
                    SortExpression="Cost">
                    <ItemTemplate>
                        <asp:Label ID="labelCost" TextAlign="Center" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "COST", "{0:$0.00}")  %>'></asp:Label>
                        <asp:HiddenField ID="hiddenFieldCost" runat="server" Value='<%# Bind("COST") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryColor %>"
                    SortExpression="Color">
                    <ItemTemplate>
                        <asp:Label ID="labelColor" TextAlign="Left" runat="server" Text='<%# Bind("COLOR_TEXT") %>'></asp:Label>
                        <asp:HiddenField ID="hiddenFieldColorId" runat="server" Value='<%# Bind("COLOR_ID") %>'></asp:HiddenField>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryFullKit %>">
                    <ItemTemplate>
                        <asp:CheckBox ID="checkBoxFullKit" TextAlign="Left" runat="server" Checked='<%#Eval("FULL_KIT")%>'></asp:CheckBox>
                        <asp:HiddenField ID="hiddenFieldFullKit" runat="server" Value='<%# Bind("FULL_KIT") %>' />
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:TemplateField HeaderText="SKU" SortExpression="SKU">
                    <ItemTemplate>
                        <asp:TextBox TextMode="SingleLine" TextAlign="Left" Wrap="true" ID="textSku" runat="server"
                            Text='<%# Bind("SKU") %>'></asp:TextBox>--%>
                <%-- <asp:HiddenField ID="hiddenFieldPreviousSKU" runat="server" Value='<%# Bind("SKU") %>' />
                        <asp:HiddenField ID="hiddenFieldDefaultSKU" runat="server" Value='<%# Bind("DEFAULT_SKU") %>' />
                    </ItemTemplate>
                </asp:TemplateField>--%>
            </Columns>
        </asp:GridView>

        <cc1:HitsSearchGridView ID="gvAccessoryAssociation" runat="server" OnRowDataBound="gvAccessoryAssociation_RowDataBound"
            AutoGenerateColumns="False" BackColor="White" BorderColor="Black" BorderStyle="Solid"
            BorderWidth="1px"
            ShowMenu="True" ShowHotlineMenu="False" ShowDeHotlineMenu="False" CustomPagerID="HitsPager1"
            ShowSelectField="False" ClientFunctionPrint="window.print();" AtlasScriptManagerID=""
            ClientFunctionActivateSelected="" ClientFunctionDeActivateSelected="" ClientFunctionDeHotline=""
            ClientFunctionDelete="" ClientFunctionEmailSelected="" ClientFunctionExportSelected=""
            ClientFunctionHotline="" CssClassCustomPaging="" CssClassMenu="" PropagateActionToChildID=""
            ShowActivateMenu="False" ShowDeActivateMenu="False" ShowDeleteMenu="False" ShowDeSelectMenu="False"
            ShowEmailMenu="False" ShowExportCSV="False" ShowExportCSVWithSummary="False" ShowExportMenu="False"
            ShowExportXML="False" ShowExportXMLWithSummary="False" ShowPrintMenu="False" ShowSelectMenu="False"
            ClientFunctionSetStatus="" ShowSetStatus="False" AllowToExportAll="False" ClientFunctionDeSelectAllClicked=""
            ClientFunctionExecute="" ClientFunctionGenerateSelected="" ClientFunctionNew="" ClientFunctionReshipReplacement=""
            ClientFunctionSelectAllClicked="" ClientFunctionUnfulfill="" ClientFunctionValidate="" ShowDehotline="False"
            ShowExecuteMenu="False" ShowExportXLS="False" ShowGenerate="False" ShowNewMenu="False" ShowReship="False"
            ShowSelectMenuChk="False" ShowUnfulfill="False" ShowValidateMenu="False" ShowVerifyModelMapMenu="False">

            <%-- <RowStyle HorizontalAlign="Left" VerticalAlign="Top" Font-Overline="False" Font-Size="X-Small"
                            Font-Strikeout="False" Font-Underline="False" BorderColor="Black" BorderStyle="Solid"
                            BorderWidth="1px" />
                        <HeaderStyle Font-Size="X-Small" Wrap="True" />--%>
            <Columns>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:CheckBox ID="checkBoxDeleted" TextAlign="Left" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryType %>" SortExpression="Type">
                    <ItemTemplate>
                        <asp:Label ID="labelType" TextAlign="Left" runat="server"></asp:Label>
                        <asp:HiddenField ID="hiddenFieldTypeId" runat="server"></asp:HiddenField>
                        <asp:HiddenField ID="hiddenFieldAccessoryId" runat="server"></asp:HiddenField>
                        <asp:HiddenField ID="hiddenFieldId" runat="server"></asp:HiddenField>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryName %>"
                    SortExpression="Name">
                    <ItemTemplate>
                        <asp:Label ID="labelName" TextAlign="Left" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement, HeaderTextAccessoryManufacturer%>"
                    SortExpression="Manufacturer">
                    <ItemTemplate>
                        <asp:Label ID="labelManufacturer" TextAlign="Left" runat="server"></asp:Label>
                        <%--<asp:HiddenField ID="hiddenFieldManufacturerId" runat="server" ></asp:HiddenField>--%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryDescription %>"
                    SortExpression="Description">
                    <ItemTemplate>
                        <asp:Label ID="labelDescription" TextAlign="Left" runat="server"> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryCost %>"
                    SortExpression="Cost">
                    <ItemTemplate>
                        <asp:Label ID="labelCost" TextAlign="Center" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryColor %>"
                    SortExpression="Color">
                    <ItemTemplate>
                        <asp:Label ID="labelColor" TextAlign="Left" runat="server"></asp:Label>
                        <%--<asp:HiddenField ID="hiddenFieldColorId" runat="server"></asp:HiddenField>--%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : ModelManagement,HeaderTextAccessoryFullKit %>">
                    <ItemTemplate>
                        <asp:CheckBox ID="checkBoxFullKit" TextAlign="Left" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SKU" SortExpression="SKU">
                    <ItemTemplate>
                        <asp:TextBox Width="200" TextMode="SingleLine" TextAlign="Left" ID="textSku" runat="server"></asp:TextBox>
                        <%--<asp:HiddenField ID="hiddenFieldDefaultSKU" runat="server" >--%>
                    </ItemTemplate>
                </asp:TemplateField>

            </Columns>
            <%--  <RowStyle HorizontalAlign="Left" VerticalAlign="Top" Font-Overline="False" Font-Size="XX-Small"
                            Font-Strikeout="False" Font-Underline="False" />--%>
            <%--  <EditRowStyle HorizontalAlign="Left" VerticalAlign="Top" />
                        <HeaderStyle Font-Size="XX-Small" Wrap="True" />--%>
        </cc1:HitsSearchGridView>

        <div>
            <asp:Button ID="btnAddAccessoryAssociation" runat="server" Text="<%$ Resources : Default, ButtonAdd %>" OnClick="m_btnAccessoryAdd_Click"
                CssClass="pagebutton" />
        </div>

    </asp:Panel>
        <apop:AddPop ID="AddpopupCompanyAccessory" runat="server" OnAccesoryAddCompleted="apop_AddCompleted" />
            </ContentTemplate>
</asp:UpdatePanel>
    <br />
    <!----------------------------------Data Source---------------------------------->
    <asp:ObjectDataSource ID="odsCompanyAccessoryDataSource" runat="server" SelectMethod="Select"
        TypeName="CompanyAccessoryDataSource" EnablePaging="True" SelectCountMethod="SelectCount">
        <SelectParameters>
            <asp:SessionParameter Name="objAccSearch" SessionField="AccessorySearchCriteria" Type="Object" />
            <asp:ControlParameter ControlID="gridViewAccessoryAssociation" DefaultValue="1" Name="startRowIndex"
                PropertyName="PageIndex" Type="Int32" />
            <asp:Parameter DefaultValue="10" Name="maximumRows" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <!-------------------------------------------------------------------->

    <table width="100%">
        <tr>
            <td align="center">
                <div id="ProcessButtonsDIV">
                    <asp:Button ID="m_btnSave" runat="server" Text="<%$ Resources : Default,ButtonSave %>" CssClass="pagebutton"
                        OnClick="m_btnSave_Click" />
                    <asp:Button ID="m_btnCancel" runat="server" Text="<%$ Resources : Default,ButtonCancel %>" CssClass="pagebutton"
                        OnClientClick="javascript:window.close();" Visible="false" />
                </div>
            </td>
        </tr>
    </table>

    
    <uc:PopupWindow ID="ucPopupInvalidAssociation" runat="server" />
</asp:Content>
