<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true"
    CodeFile="DeviceRep.aspx.cs" Inherits="POS_DeviceRep"  %>

<%@ Register Src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td valign="top">
                <!------------------------------------body St  ---------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                    <tr>
                        <td>
                            Device Repository
                        </td>
                    </tr>
                </table>
                <br>
                <!------------------------------------body End1 ----------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                    <tr>
                        <td align="center">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Frow">
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <fieldset id="addItem">
                                <legend id="addItem">Bulk Upload</legend>
                            </fieldset>
                            <table border="1" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                <tr>
                                    <td class="tdNormal" style="width: 15%">
                                        Vendor
                                    </td>
                                    <td class="tdNormal" style="width: 30%">
                                        <asp:DropDownList ID="ddlVendorUp" runat="server" DataTextField="v_name" DataValueField="v_code"
                                            class="fieldNormal" AutoPostBack="true" OnSelectedIndexChanged="ddlVendorUp_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td class="tdNormal" style="width: 10%">
                                        &nbsp;
                                    </td>
                                    <td class="tdNormal" style="width: 15%">
                                        Terminal Type
                                    </td>
                                    <td class="tdNormal" style="width: 30%">
                                        <asp:DropDownList ID="ddlTypeUp" runat="server" DataTextField="type_name" DataValueField="type_code"
                                            class="fieldNormal">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal" style="width: 15%">
                                        Upload Terminals
                                    </td>
                                    <td colspan="3" style="width: 50%">
                                        <asp:DropDownList ID="ddlFiles" 
                                            runat="server" DataTextField="filename" 
                                            DataValueField="filename" class="fieldNormal" ></asp:DropDownList> 
                                    </td>
                                    <td class="tdNormal">
                                        <asp:Button ID="btnUpload" runat="server" Text="Load" class="Btn_L_Normal" 
                                            onclick="btnUpload_Click" />
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <fieldset id="addItem">
                                <legend id="addItem">Search Terminals</legend>
                            </fieldset>
                            <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                <tr>
                                    <td class="tdNormal">
                                        Terminal Status
                                    </td>
                                    <td class="tdNormal">
                                        <asp:DropDownList ID="ddlStatus" runat="server" DataTextField="TERMINAL_STATUS_DESC"
                                            DataValueField="TERMINAL_STATUS_CODE" class="fieldNormal">
                                        </asp:DropDownList>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Terminal ID
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtTerminal" runat="server" class="fieldNormal" MaxLength="8"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        Merchant No
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtMerchantNo" runat="server" class="fieldNormal" MaxLength="8"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Client No
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtClientNo" runat="server" class="fieldNormal" MaxLength="8"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal" style="width: 15%">
                                        Vendor
                                    </td>
                                    <td class="tdNormal" style="width: 30%">
                                        <asp:DropDownList ID="ddlVendorF" runat="server" DataTextField="v_name" DataValueField="v_code"
                                            class="fieldNormal" AutoPostBack="true" OnSelectedIndexChanged="ddlVendorF_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td class="tdNormal" style="width: 10%">
                                        &nbsp;
                                    </td>
                                    <td class="tdNormal" style="width: 15%">
                                        Terminal Type
                                    </td>
                                    <td class="tdNormal" style="width: 30%">
                                        <asp:DropDownList ID="ddlTerTypeF" runat="server" DataTextField="type_name" DataValueField="type_code"
                                            class="fieldNormal">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="5" style="text-align: center">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="Btn_L_Normal" OnClick="btnSearch_Click" />
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                            <asp:Panel ID="pnlResult" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Device Search Results</legend>
                                </fieldset>
                                <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" colspan="5">
                                            <asp:GridView ID="GridView1" CssClass="gridMaster" runat="server" AutoGenerateColumns="False"
                                                AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"
                                                EmptyDataText="There are no Results" DataKeyNames="device_code" OnRowCommand="GridView1_RowCommand"
                                                OnRowCreated="GridView1_RowCreated">
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                <Columns>
                                                    <asp:BoundField DataField="terminal_id" HeaderText="Terminal ID" />
                                                    <asp:BoundField DataField="manufacturer" HeaderText="Manufacturer" />
                                                    <asp:BoundField DataField="purchase_date" HeaderText="Purchase Date" />
                                                    <asp:BoundField DataField="terminal_status" HeaderText="Status" />
                                                    <asp:BoundField DataField="occupied_status" HeaderText="Occupied" />
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="e" Text="Edit"
                                                        ImageUrl="~/Images/edit.jpg"></asp:ButtonField>
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="d" Text="Delete"
                                                        ImageUrl="~/Images/delete.jpg"></asp:ButtonField>
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="f" Text="Make Faulty"
                                                        ImageUrl="~/Images/faulty.jpg"></asp:ButtonField>
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="uf" Text="Revert Faulty"
                                                        ImageUrl="~/Images/trans.jpg"></asp:ButtonField>    
                                                </Columns>
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                                <EditRowStyle BackColor="#999999" />
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Right" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 20%">
                                            Go To Page:
                                            <asp:DropDownList ID="ddlPages" runat="server" class="fieldNormal" AutoPostBack="True"
                                                Width="50px" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                        <td class="tdNormal">
                                        </td>
                                        <td class="tdNormal">
                                        </td>
                                        <td class="tdNormal">
                                        </td>
                                        <td class="tdNormal">
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgForm">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnAdd" runat="server" Text="     Add     " class="Btn_M_Normal"
                                                OnClick="btnAdd_Click" />
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlControls" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Terminal Details</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Serial Number
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtSerialNo" runat="server" class="fieldNormal" MaxLength="16"></asp:TextBox>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Purchase Date
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <uc1:DatePicker ID="datePurchase" runat="server" width="250" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Model Number
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtModelNo" runat="server" class="fieldNormal" MaxLength="16"></asp:TextBox>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Manufacturer
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtManufac" runat="server" class="fieldNormal" MaxLength="16"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr style="display:none">
                                        <td class="tdNormal" style="width: 15%">
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            S/W Version
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtSWVersion" runat="server" class="fieldNormal" MaxLength="16"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Vendor
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:DropDownList ID="ddlVendor" runat="server" DataTextField="v_name" DataValueField="v_code"
                                                class="fieldNormal" AutoPostBack="true" OnSelectedIndexChanged="ddlVendor_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Terminal Type
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:DropDownList ID="ddlTermType" runat="server" DataTextField="type_name" DataValueField="type_code"
                                                class="fieldNormal" AutoPostBack=true 
                                                onselectedindexchanged="ddlTermType_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            TRMS
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtTRMS" runat="server" class="fieldNormal" MaxLength="16"></asp:TextBox>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Terminal ID
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtTerminalID" ReadOnly=true runat="server" class="fieldNormal" MaxLength="8"></asp:TextBox>
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Connection Type
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:Label ID="lblConType" runat="server" Text="" Font-Bold="True"></asp:Label>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Faulty Reason
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:Label ID="lblFaultyReason" runat="server" Text="" Font-Bold="True"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Client Name
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:Label ID="lblClientName" runat="server" Text="" Font-Bold="True"></asp:Label>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancel" runat="server" Text="   Cancel   " class="Btn_M_Normal"
                                                CausesValidation="False" OnClick="btnCancel_Click" />
                                            <asp:Button ID="btnSave" runat="server" Text="   Save   " 
                                                class="Btn_M_Normal" OnClick="btnSave_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlFaulty" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Reasons</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Reason
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:DropDownList ID="ddlReasons" runat="server" DataTextField="reason_nm" DataValueField="reason_cd"
                                                class="fieldNormal" AutoPostBack="false">
                                            </asp:DropDownList>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancelReason" runat="server" Text="   Cancel   " class="Btn_M_Normal"
                                                CausesValidation="False" OnClick="btnCancelReason_Click" />
                                            <asp:Button ID="btnSaveReason" runat="server" Text="   Save   " 
                                                class="Btn_M_Normal" OnClick="btnSaveReason_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <!------------------------------------body End2 ----------------------------------------------->
                            <br>
                        </td>
                    </tr>
                </table>
                <!------------------------------------body End2 ----------------------------------------------->
            </td>
        </tr>
    </table>
</asp:Content>
