<%@ 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_Accessories_Default" %>

<%@ Register Src="~/Controls/CustomSorter.ascx" TagName="CustomSorter" TagPrefix="uc" %>
<%@ 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" %>

<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, LabelTitleAccessories %>" />
    </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 align="right">
                    <asp:Literal ID="m_litTechType" runat="server" Text="<%$ Resources: ModelManagement, LabelAccessoryTypeColon %>" />
                </td>
                <td align="left">
                    <asp:DropDownList ID="m_ddlAccessoryType" runat="server" Width="171px">
                    </asp:DropDownList>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litName" runat="server" Text="<%$ Resources: HandsetManagement, LabelNameColon %>" />
                </td>
                <td>
                    <asp:TextBox ID="m_txtModel" runat="server" Width="165px"></asp:TextBox>
                    <%--                    <SmartAjaxToolkit:SmartAutoCompleteExtender ID="SmartAutoCompleteExtender1" runat="server"
                        OnAutoCompleteCallback="SearchModels" TargetControlID="m_txtModel"
                        UpdateMode="Callback" EnableCaching="false" MinimumPrefixLength="2" />--%>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litManufactuer" runat="server" Text="<%$ Resources: HandsetManagement, LabelManufacturerColon %>" />
                </td>
                <td>
                    <asp:DropDownList ID="m_ddlManufacturer" runat="server" Width="171px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Literal ID="m_litDescription" runat="server" Text="<%$ Resources: HandsetManagement, LabelDescriptionColon %>" />
                </td>
                <td>
                    <asp:TextBox ID="m_txtDescription" runat="server" Width="165px"></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litCost" runat="server" Text="<%$ Resources : ModelManagement , LabelAccessoryCostColon %>" />
                </td>
                <td>
                    <asp:TextBox ID="m_txtCost" runat="server" Width="165px"></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litColor" runat="server" Text="<%$ Resources: HandsetManagement, LabelColorColon %>" />
                </td>
                <td>
                    <asp:DropDownList ID="m_ddlColor" runat="server" Width="171px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Literal ID="m_litPageSize" runat="server" Text="<%$ Resources: Default, LabelRecordsPerPageColon %>" />
                </td>
                <td>
                    <asp:DropDownList ID="m_ddlPageSize" runat="server">
                        <asp:ListItem Text="20" Value="20"></asp:ListItem>
                        <asp:ListItem Text="50" Value="50"></asp:ListItem>
                        <asp:ListItem Text="100" Value="100"></asp:ListItem>
                        <asp:ListItem Text="<%$ Resources: Default, ListItemAll %>" Value="0"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td align="right"></td>
                <td></td>
                <td align="right">
                    <asp:Literal ID="m_litActive" runat="server" Text="<%$ Resources: HandsetManagement, LabelActiveColon %>" />
                </td>
                <td align="left">
                    <asp:DropDownList ID="m_ddlActive" runat="server">
                        <asp:ListItem Text="<%$ Resources: Default, All %>" Value="0"></asp:ListItem>
                        <asp:ListItem Text="<%$ Resources:ModelManagement, AccessoryActive %>" Value="1"></asp:ListItem>
                        <asp:ListItem Text="<%$ Resources:ModelManagement, AccessoryInactive %>" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                </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_pnlAccessoryGrid" 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>
        <cc1:HitsSearchGridView ID="m_gvAccessories" runat="server" AutoGenerateColumns="False"
            Width="100%" AllowPaging="True" OnRowDataBound="m_gvAccessories_RowDataBound"
            OnPageIndexChanged="m_gvAccessories_PageIndexChanged" OnPageIndexChanging="m_gvAccessories_PageIndexChanging"
            OnMenuItemCommand="m_gvAccessories_OnMenuItemCommand" ShowMenu="True" ShowSelectField="True"
            ShowActivateMenu="False" ShowDeActivateMenu="False" ShowEmailMenu="False" ShowPrintMenu="True"
            ShowHotlineMenu="False" ShowDeHotlineMenu="False" CustomPagerID="HitsPager1"
            ClientFunctionPrint="window.print();" OnCustomPageIndexChanged="m_gvAccessories_PageIndexChanged"
            OnCustomPageIndexChanging="m_gvAccessories_PageIndexChanging" ShowDeleteMenu="True"
            ShowDeSelectMenu="True" ShowExportMenu="True" ShowSelectMenu="True"
            AtlasScriptManagerID="" ClientFunctionActivateSelected="" ClientFunctionDeActivateSelected=""
            ClientFunctionDeHotline="" ClientFunctionDelete="" ClientFunctionEmailSelected=""
            ClientFunctionExportSelected="" ClientFunctionHotline="" ClientFunctionSetStatus=""
            CssClassCustomPaging="" CssClassMenu="" PropagateActionToChildID="" ShowExportCSV="True"
            ShowExportCSVWithSummary="False" ShowExportXML="True" ShowExportXMLWithSummary="False"
            ShowSetStatus="False">
            <Columns>
                <asp:TemplateField HeaderText="Type">
                    <HeaderStyle Wrap="true" />
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litType" Text="<%$ Resources : ModelManagement,HeaderTextAccessoryType %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csType" SortExpression="Type" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle VerticalAlign="Top" Width="60px" />
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TypeName") %>' ID="Label5"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Accessory Name">
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litAccessoryName" Text="<%$ Resources : ModelManagement,HeaderTextAccessoryName %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csAccessoryName" SortExpression="Name" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle Width="150px" VerticalAlign="Top" />
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="m_lbtnAccessoryName" Text='<%# Bind("Name") %>' Font-Underline="True" OnClick="m_lbtnAccessoryName_Click"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Manufacturer">
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litManufacturer" Text="<%$ Resources : OrganizationManagement,HeaderTextManufacturer %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csManufacturer" SortExpression="Manufacturer" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle VerticalAlign="Top" Width="100px" />
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "MfgName") %>' ID="Label1"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Accessory Description">
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litAccessoryDescription" Text="<%$ Resources : ModelManagement,HeaderTextAccessoryDescription %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csAccessoryDes" SortExpression="Description" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle VerticalAlign="Top" Width="590px" />
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# Bind("Description") %>' ID="Label3"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Cost">
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litCost" Text="<%$ Resources : ModelManagement,HeaderTextAccessoryCost %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csCost" SortExpression="Cost" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle VerticalAlign="Top" Width="190px" />
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Cost", "{0:$0.00}")  %>' ID="m_labCost"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Active Status">
                    <HeaderTemplate>
                        <asp:Literal runat="server" ID="m_litActiveStatus" Text="<%$ Resources : ModelManagement,HeaderTextAccessoryActiveStatus %>"></asp:Literal>
                        <br />
                        <uc:CustomSorter runat="server" ID="m_csStatus" SortExpression="Status" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </HeaderTemplate>
                    <ItemStyle VerticalAlign="Top" Width="190px" />
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# TranslateActiveText(Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "Active"))) %>' ID="m_labActiveStatus"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>


            </Columns>

            <PagerTemplate>
                <cc1:HitsPager ID="HitsPager1" runat="server" GoButtonText="<%$ Resources : Default, GoButtonText %>" />
            </PagerTemplate>
            <PagerSettings Mode="NumericFirstLast" />
            <HeaderStyle HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Left" />
            <EditRowStyle HorizontalAlign="Left" VerticalAlign="Top" />
        </cc1:HitsSearchGridView>
    </asp:Panel>
    <asp:Label ID="m_lblNoAccessoriesFound" Font-Bold="True" ForeColor="Red" runat="server"
        Visible="False" Text="<%$ Resources : Default,LabelNoResultsFound %>" />

    <br />
    <asp:ObjectDataSource ID="odsAccessoryDataSource" runat="server" SelectMethod="Select"
        TypeName="AccessoryDataSource" EnablePaging="True" SelectCountMethod="SelectCount" OldValuesParameterFormatString="original_{0}" >
        <SelectParameters>
            <asp:SessionParameter Name="objAccSearch" SessionField="AccessorySearchCriteria" Type="Object" />
            <asp:ControlParameter ControlID="m_gvAccessories" DefaultValue="1" Name="startRowIndex"
                PropertyName="PageIndex" Type="Int32" />
            <asp:Parameter DefaultValue="10" Name="maximumRows" Type="Int32" />

        </SelectParameters>
    </asp:ObjectDataSource>

</asp:Content>
