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

<%@ Register Src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%--<script src="../js/validation.js" language ="javascript" type ="text/javascript" ></script>--%>
    <link href="../css/tab.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">

        function KeyPressFuncNotSpecialCharecter() {
            if ((event.keyCode >= 47 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 97 && event.keyCode <= 122)) {
                event.returnValue = true;
            }
            else {
                event.returnValue = false;
            }
        }
        function KeyPressFuncIsWholeNumber() {
            if (event.keyCode < 48 || event.keyCode > 57) {
                event.returnValue = false;
            }
        }
        function validate() {
            var message = "";

            if (document.getElementById("<%=txtaddMerchantName.ClientID%>").value == "") {
                message += "Merchant Name Feild can not be blank\n";
                document.getElementById("<%=txtaddMerchantName.ClientID%>").style.backgroundColor = "#c8d1e4";
            }
            if (document.getElementById("<%=txtAddMerchantAcct.ClientID%>").value == "") {
                message += "Merchant Account can not be blank\n";
                document.getElementById("<%=txtAddMerchantAcct.ClientID%>").style.backgroundColor = "#c8d1e4";
            }
            if (document.getElementById("<%=txtNoOfTerminals.ClientID%>").value == "") {
                message += "Number of Terminals can not be blank\n";
                document.getElementById("<%=txtNoOfTerminals.ClientID%>").style.backgroundColor = "#c8d1e4";
            }



            if (message.length > 0) {
                message = "please Note the following requirments:\n\n" + message;
                alert(message);
                return false;
            }
            return true;
        }

        //      function KeyPressNotSpecialCharecter() 
        //      {
        ////          if ((event.keyCode >= 47 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 97 && event.keyCode <= 122)) {
        ////              event.returnValue = true;
        //          //          }

        //          if (event.keyCode < 45 || event.keyCode > 57) {
        //              event.returnValue = false;
        //          }
        //          
        //      }

    </script>
    <style type="text/css">
        .style2
        {
            width: 25%;
        }
        .style3
        {
            width: 25%;
            height: 18px;
        }
        .style4
        {
            height: 18px;
            width: 185px;
        }
        .style5
        {
            width: 15%;
            height: 18px;
        }
        .style9
        {
            width: 17%;
        }
        .style10
        {
            width: 17%;
            height: 18px;
        }
        .style11
        {
            width: 185px;
        }
    </style>
</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>
                            Terminal Order Form
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
                <br />
                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                    <tr>
                        <td>
                        </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 />
                            <asp:Panel ID="pnl_filters" runat="server" Width="100%">
                                <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal">
                                            Merchant Name
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtMerchantName" runat="server" class="fieldNormal" Width="250"
                                                MaxLength="20"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal">
                                            Branch
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlBranch" runat="server" DataTextField="branch_name" Width="250px"
                                                DataValueField="branch_code" class="fieldNormal">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal">
                                            Status
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlStatus" runat="server">
                                                <asp:ListItem Text="Select" Value="" />
                                                <asp:ListItem Text="Entered" Value="Entered" />
                                                <asp:ListItem Text="Approved" Value="Approved" />
                                                <asp:ListItem Text="Rejected" Value="Rejected" />
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="text-align: center">
                                            <asp:Button ID="Button1" runat="server" Text="Search" CssClass="Btn_L_Normal" OnClick="Button1_Click" />
                                            <asp:Button ID="btnAdd" runat="server" class="Btn_L_Normal" OnClick="btnAdd_Click"
                                                Text="     Add     " />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="text-align: center">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                            <br />
                            <br />
                            <asp:Panel ID="pnl_add_Controls" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Add- Terminal Order Form</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="style2">
                                            Merchant Name
                                        </td>
                                        <td class="style11">
                                            <asp:TextBox ID="txtaddMerchantName" runat="server" class="fieldNormal" MaxLength="50"
                                                Width="250"></asp:TextBox>
                                        </td>
                                        <td class="style9">
                                            Merchant Account Number
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:TextBox ID="txtAddMerchantAcct" runat="server" class="fieldNormal"  MaxLength="20" Width="250"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Number Of Terminals&nbsp;
                                        </td>
                                        <td class="style11">
                                            <asp:TextBox ID="txtNoOfTerminals" runat="server" class="fieldNormal" MaxLength="5"
                                                Width="250"></asp:TextBox>
                                        </td>
                                        <td class="style9">
                                            Agreement Signed Date
                                        </td>
                                        <td class="tdNormal" style="width: 15%;">
                                            <uc1:DatePicker ID="DatePicker1" runat="server" width="250" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            Terminal Type
                                        </td>
                                        <td class="style11">
                                            <asp:DropDownList ID="ddlTerminalType" runat="server" class="fieldNormal" Width="250"
                                                DataTextField="type_name" DataValueField="type_code">
                                                <asp:ListItem Text="New" Value="New" />
                                                <asp:ListItem Text="Add" Value="Add" />
                                            </asp:DropDownList>
                                        </td>
                                        <td class="style9">
                                            Brahch ID
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:DropDownList ID="ddladdBranchID" runat="server" DataValueField="branch_code"
                                                class="fieldNormal" Width="250">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style3">
                                            Relationship Officer ID
                                        </td>
                                        <td class="style4">
                                            <asp:TextBox ID="txtRelationOfficerID" runat="server" class="fieldNormal" Width="250" MaxLength="10"
                                               ></asp:TextBox>
                                        </td>
                                        <td class="style10">
                                            Relationship Officer Name
                                        </td>
                                        <td class="style5">
                                            <asp:TextBox ID="txtRelationOfficerName" runat="server" class="fieldNormal" Width="250" MaxLength="50">
                                            </asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            &nbsp;
                                        </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"
                                                OnClientClick="return validate()" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlResult" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">ATM 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" Width="100%" runat="server" AutoGenerateColumns="False"
                                                AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"
                                               onrowcommand="GridView1_RowCommand"  EmptyDataText="There are no Results" DataKeyNames="Record_ID">
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                <Columns>
                                                
                                                   <asp:BoundField DataField="Record_ID" HeaderText="Record ID"  Visible="false"/>
                                                    <asp:BoundField DataField="MERCHANT_NAME" HeaderText="Merchant Name" />
                                                    <asp:BoundField DataField="MERCHANT_ACCOUNT_NUMBER" HeaderText="Accout Number" />
                                                    <asp:BoundField DataField="NO_OF_TERMINALS" HeaderText="Number Of Terminals" />
                                                    <asp:BoundField DataField="AGGREMENT_SIGNED_DATE" HeaderText="Agreement Signed Date" />
                                                    <asp:BoundField DataField="TERMINAL_TYPE" HeaderText="Terminal Type" />
                                                    <asp:BoundField DataField="branch_id" HeaderText="Branch ID" />
                                                    <asp:BoundField DataField="REL_OFFICER_ID" HeaderText="Rel. Officer ID" />
                                                    <asp:BoundField DataField="REL_OFFICER_NAME" HeaderText="Rel. Officer Name" />
                                                    <asp:BoundField DataField="ADDED_BY" HeaderText="Added By" />
                                                    <asp:BoundField DataField="APPROVED_BY" HeaderText="Approved By" />
                                                    <asp:BoundField DataField="STATUS" HeaderText="Status" />
                                                    <asp:BoundField DataField="Remarks" HeaderText="Operation Team Remarks" Visible="false" />
                                                    <asp:BoundField DataField="ROW_NUM" HeaderText=" Row" Visible="false" />
                                                   
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="e" Text="View/Update" ImageUrl="~/Images/edit.jpg" >
                                                                </asp:ButtonField>
                                                                
                                                    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="r" Text="Report" ImageUrl="~/Images/print.jpg" />
                                                            
                                                    <%--    <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="vm" Text="View Modification" ImageUrl="~/Images/view.jpg" />
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="vd" Text="View Current Details" ImageUrl="~/Images/document_view.jpg" />
                                                                
                                                                <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>--%>
                                                </Columns>
                                            </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>
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlApprove" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Approve/Reject Screen</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Remarks
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtRemarks"  runat="server" MaxLength="100" 
                                                class="fieldNormal" Width="544px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:Label ID="LabelStatus" runat="server" Text="Status" class=""></asp:Label>  
                                            
                                        </td>
                                        <td class="tdNormal" style="width: 40%">
                                            <asp:DropDownList ID="ddlUpdateStatus" runat="server" Width="250">
                                                 <asp:ListItem Text="Approve" Value="Approved" />
                                                <asp:ListItem Text="Reject" Value="Rejected" />
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancelUpdate" runat="server" Text="   Cancel   " class="Btn_M_Normal"
                                                CausesValidation="False" OnClick="btnCancelUpdate_Click" />
                                            <asp:Button ID="btnUpdate" runat="server" Text="   Update   " class="Btn_M_Normal"
                                                OnClick="btnUpdate_Click"  />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <!------------------------------------body End2 ----------------------------------------------->
                            <br />
                        </td>
                    </tr>
                </table>
                <!------------------------------------body End2 ----------------------------------------------->
            </td>
        </tr>
    </table>
</asp:Content>
