<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" Inherits="site_HITS_HandsetModel_Default" Title="Brightstar Device Protection: Handset Model Master"
    Theme="eMain" Culture="auto" UICulture="auto"
    EnableEventValidation="false" Codebehind="Default.aspx.cs" %>

<%@ 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_litHandsetModel" runat="server" Text="<%$ Resources: HandsetManagement, LabelTitleModels %>" />
    </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_litModel" runat="server" Text="<%$ Resources: ModelManagement, LabelModelColon %>" />
                </td>
                <td>
                    <asp:TextBox ID="m_txtModel" runat="server" Width="165px" TabIndex="1"></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_litERPModelName" runat="server" Text="<%$ Resources: HandsetManagement, LabelERPModelNameColon %>" />
                </td>
                <td align="left">
                    <asp:TextBox ID="m_txtERPModelName" runat="server" Width="165px" TabIndex="6"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <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"  TabIndex="2">
                    </asp:DropDownList>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litERPShortDescription" runat="server" Text="<%$ Resources: HandsetManagement, LabelERPShortDescriptionColon %>" />
                </td>
                <td align="left">
                    <asp:TextBox ID="m_txtERPShortDescription" runat="server" Width="165px" TabIndex="7"></asp:TextBox>
                </td>                
            </tr>
            <tr>
                <td align="right">
                    <asp:Literal ID="m_litTechType" runat="server" Text="<%$ Resources: SubscriberManagement, LabelTechnologyTypeColon %>"/>
                </td>
                <td>
                    <asp:DropDownList ID="m_ddlTechType" runat="server" Width="171px" TabIndex="3">
                    </asp:DropDownList>
                </td>
                <td align="right">
                    <asp:Literal ID="m_litERPType" runat="server" Text="<%$ Resources: HandsetManagement, LabelERPTypeColon %>" />
                </td>
                <td align="left">
                    <asp:DropDownList ID="m_ddlERPType" runat="server" Width="171px" TabIndex="8">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Literal ID="m_litModalityHeader" runat="server" Text="<%$ Resources: Default, LabelModalityColon %>" />
                </td>
                <td>
                    <asp:TextBox ID="m_txtModality" runat="server" Width="165px" TabIndex="4"></asp:TextBox>
                    <SmartAjaxToolkit:SmartAutoCompleteExtender ID="SmartAutoCompleteExtender2" runat="server"
                        OnAutoCompleteCallback="SearchModalitys" TargetControlID="m_txtModality"
                        UpdateMode="Callback" EnableCaching="false" MinimumPrefixLength="2" />
                </td>
                <td align="right">
                    <asp:Literal ID="m_litERPColor" runat="server" Text="<%$ Resources: HandsetManagement, LabelERPColorColon %>" />
                </td>
                <td align="left">
                    <asp:DropDownList ID="m_ddlERPColor" runat="server" Width="171px" TabIndex="9">
                    </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" TabIndex="10">
                    </asp:DropDownList>
                </td>
                <td align="right">
                </td>
                <td>
                </td>
                <td align="right">
                </td>
                <td align="left">
                </td>                
            </tr>
        </table>
        
        <div style="text-align: center; padding-top: 10px; background-color: White">
            <asp:Button ID="m_btnSearch" runat="server" Text="<%$ Resources : Default,ButtonSearch %>" CssClass="pagebutton" OnClick="m_btnSearch_Click"
                  TabIndex="11" />
            <input id="m_btnClear" type="button" runat="server" value="<%$ Resources : Default,ButtonClear %>" class="pagebutton"
                 TabIndex="12" />
        </div>
    </div>
    
    <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 ID="m_pnlHandsetModelGrid" Visible="False" runat="server" >
        <cc1:HitsSearchGridView ID="m_gvHandsetModel" runat="server" AutoGenerateColumns="False"
            Width="100%" AllowPaging="True" OnRowDataBound="m_gvHandsetModel_RowDataBound"
            OnPageIndexChanged="m_gvHandsetModel_PageIndexChanged" OnPageIndexChanging="m_gvHandsetModel_PageIndexChanging"
            OnMenuItemCommand="m_gvHandsetModel_OnMenuItemCommand" ShowMenu="True" ShowSelectField="True"
            ShowActivateMenu="False" ShowDeActivateMenu="False" ShowEmailMenu="False" ShowPrintMenu="True"
            ShowHotlineMenu="False" ShowDeHotlineMenu="False" CustomPagerID="HitsPager1"
            ClientFunctionPrint="window.print();" OnCustomPageIndexChanged="m_gvHandsetModel_PageIndexChanged"
            OnCustomPageIndexChanging="m_gvHandsetModel_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="Model Name">
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litModelName" Text="<%$ Resources : ModelManagement,HeaderTextModel %>"></asp:Literal>
                         <br />
                         <uc:CustomSorter runat="server" ID="m_csModelName" SortExpression="ModelName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                     </headertemplate>
                    <itemstyle width="250px" verticalalign="Top" />
                    <itemtemplate>
                        <asp:LinkButton runat="server" ID="m_lbtnModelName" Font-Underline="True" OnClick="m_lbtnModelName_Click"></asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Manufacturer">
                    <edititemtemplate>
                            <asp:TextBox runat="server" Text='<%# Bind("OrganizationName") %>' ID="TextBox1" ></asp:TextBox>
                    </edititemtemplate>
                    <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='<%# Bind("OrganizationName") %>' ID="Label1"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Technology Type">
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("TechType") %>' ID="TextBox5"></asp:TextBox>
                    </edititemtemplate>
                    <HeaderStyle Wrap="true" />
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litTechType" Text="<%$ Resources : OrganizationManagement,HeaderTextTechnologyType %>"></asp:Literal>
                            <br />
                            <uc:CustomSorter runat="server" ID="m_csTechType" SortExpression="TECH_TYPE" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle verticalalign="Top" width="60px" />
                    <itemtemplate>
                            <asp:Label runat="server" Text='<%# Bind("TechTypeText") %>' ID="Label5" ></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Modality">
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("Modality") %>' ID="TextBox2"></asp:TextBox>
                    </edititemtemplate>
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litModality" Text="<%$ Resources : ModelManagement,HeaderTextModality %>"></asp:Literal>
                            <br />
                            <uc:CustomSorter runat="server" ID="m_csModality" SortExpression="Modality" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>
                    <itemstyle verticalalign="Top" width="300px" />
                    <itemtemplate>
                            <asp:Label runat="server" Text='<%# Bind("Modality") %>' ID="Label2"></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
               
                <asp:TemplateField HeaderText="ERP Model Name" >
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("modelTypeName") %>' ID="TextBox3"></asp:TextBox>
                    </edititemtemplate>
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litErpModelName" Text="<%$ Resources : ModelManagement,HeaderTextErpModelName %>"></asp:Literal>
                            <br />
                            <uc:CustomSorter runat="server" ID="m_csErpModelName" SortExpression="modelTypeName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle verticalalign="Top" width="200px" />
                    <itemtemplate>
                        <asp:Label runat="server" Text='<%# Bind("modelTypeName") %>' ID="Label3" ></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ERP Short Desc" >
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("modelShortName") %>' ID="TextBox4"></asp:TextBox>
                    </edititemtemplate>
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litErpModelShortName" Text="<%$ Resources : ModelManagement,HeaderTextErpModelShortDesc %>"></asp:Literal>
                            <br />
                            <uc:CustomSorter runat="server" ID="m_csErpModelShortDesc" SortExpression="modelShortName" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle verticalalign="Top" width="300px" />
                    <itemtemplate>
                        <asp:Label runat="server" Text='<%# Bind("modelShortName") %>' ID="Label4" ></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ERP Type" >
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("ErpType") %>' ID="TextBox6"></asp:TextBox>
                    </edititemtemplate>
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litErpType" Text="<%$ Resources : ModelManagement,HeaderTextType %>"></asp:Literal>
                             <br />
                            <uc:CustomSorter runat="server" ID="m_csErpType" SortExpression="ErpType" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle verticalalign="Top" width="200px" />
                    <itemtemplate>
                        <asp:Label runat="server" Text='<%# Bind("ErpType") %>' ID="Label6" ></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ERP Color" >
                    <edititemtemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("ErpColor") %>' ID="TextBox7"></asp:TextBox>
                    </edititemtemplate>
                    <headertemplate>
                        <asp:Literal runat="server" ID="m_litErpColor" Text="<%$ Resources : ModelManagement,HeaderTextColor%>"></asp:Literal>
                             <br />
                            <uc:CustomSorter runat="server" ID="m_csErpColor" SortExpression="ErpColor" OnSortAscendingClicked="customSorter_SortClicked" OnSortDescendingClicked="customSorter_SortClicked"></uc:CustomSorter>
                    </headertemplate>   
                    <itemstyle verticalalign="Top" width="200px" />
                    <itemtemplate>
                        <asp:Label runat="server" Text='<%# Bind("ErpColor") %>' ID="Label7" ></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>
        <br />
        <h2>
            <asp:Literal ID="m_litHandsetModelComments" runat="server" Text="<%$ Resources : HandsetManagement,HandsetModelComments %>"
                />
        </h2>
        
        <asp:GridView ID="m_gvHandsetModelComments" runat="server" AutoGenerateColumns="False"
            Width="100%" OnRowDataBound="m_gvHandsetModelComments_RowDataBound" OnRowDeleting="m_gvHandsetModelComments_RowDeleting"
            >
            <Columns>
                <asp:TemplateField HeaderText="Who">
                    <HeaderTemplate>
                        <asp:Literal ID="m_litWho" Text="<%$ Resources : Default,HeaderTextWho %>" runat="server" />
                        <br />
                        <uc:CustomSorter ID="m_csWho" SortExpression="Who" runat="server" OnSortAscendingClicked="CommentsSorter_SortClicked"
                            OnSortDescendingClicked="CommentsSorter_SortClicked" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="m_lblLastFirstName" runat="server" ></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="150px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : Default,HeaderTextDate %>">
                    <HeaderTemplate>
                        <asp:Literal ID="m_litDate" Text="<%$ Resources : Default,HeaderTextDate %>" runat="server" />
                        <br />
                        <uc:CustomSorter ID="m_csDate" SortExpression="Date" runat="server" OnSortAscendingClicked="CommentsSorter_SortClicked"
                            OnSortDescendingClicked="CommentsSorter_SortClicked" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="m_lblDate" runat="server" ></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="90px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Field">
                    <HeaderTemplate>
                        <asp:Literal ID="m_litField" Text="<%$ Resources : Default,HeaderTextField %>" runat="server" />
                        <br />
                        <br />
                    </HeaderTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FieldName") %>' ></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle Width="100px" />
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FieldName") %>' ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Comments Old">
                    <HeaderTemplate>
                        <asp:Literal ID="m_litCommentsOld" Text="<%$ Resources : Default,HeaderTextCommentsOld %>" runat="server" />
                        <br />
                        <br />
                    </HeaderTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("OldData") %>' ></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle CssClass="gv-LineBreak" Width="355px" />
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("OldData") %>' ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Comments New">
                    <HeaderTemplate>
                        <asp:Literal ID="m_litCommentsNew" Text="<%$ Resources : Default,HeaderTextCommentsNew %>" runat="server" />
                        <br />
                        <br />
                    </HeaderTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("NewData") %>' ></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle CssClass="gv-LineBreak" Width="355px" />
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("NewData") %>' ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources : Default,HeaderTextID %>" Visible="False">
                    <ItemStyle Width="15px" />
                    <ItemTemplate>
                        <asp:Label ID="m_lblId" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField DeleteText="<%$Resources : Default,DeleteLabel %>" ShowDeleteButton="True" >
                    <ControlStyle Font-Underline="True" />
                </asp:CommandField>
            </Columns>
            <RowStyle VerticalAlign="Top" />
        </asp:GridView>
    </asp:Panel>
    <asp:Label ID="m_lblNoHandsetModelsFound" Font-Bold="True" ForeColor="Red" runat="server"
        Visible="False" Text="<%$ Resources : Default,LabelNoResultsFound %>" />
    <asp:ObjectDataSource ID="odsHandsetModelDataSource" runat="server" SelectMethod="Select"
        TypeName="HandsetModelDataSource" EnablePaging="True" SelectCountMethod="SelectCount">
        <SelectParameters>
            <asp:SessionParameter Name="objHandsetData" SessionField="HandsetModel" Type="Object" />
            <asp:ControlParameter ControlID="m_gvHandsetModel" DefaultValue="1" Name="startRowIndex"
                PropertyName="PageIndex" Type="Int32" />
            <asp:Parameter DefaultValue="10" Name="maximumRows" Type="Int32" />
            <asp:SessionParameter Name="HandsetModelSortExpression" SessionField="HandsetModelSortExpression"
                Type="Object" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>