<%@ page language="C#" masterpagefile="~/MasterPages/Main.master" autoeventwireup="true" inherits="Business_ATM, App_Web_atm.aspx.36edc644" viewStateEncryptionMode="Always" maintainScrollPositionOnPostBack="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script language="javascript" type="text/javascript">

//        function removeCommas(Num) {
//            //            document.getElementById("<%=TextBox1.ClientID%>").value = document.getElementById("<%=TextBox1.ClientID%>").value.replace(/,/g, "");
//            Num=Num.replace(/\,/g, ''));
//        }
    function validate()
    {
        var message = "";
        if (document.getElementById("<%=TextBox1.ClientID%>").value=="")
        {
            message += "Overage Account Feild can not be blank\n";
            document.getElementById("<%=TextBox1.ClientID%>").style.backgroundColor="#c8d1e4";
        }
        if (document.getElementById("<%=TextBox2.ClientID%>").value=="")
        {
            message += "Shortage Account Feild can not be blank\n";
            document.getElementById("<%=TextBox2.ClientID%>").style.backgroundColor="#c8d1e4";
        }
        if (document.getElementById("<%=TextBox3.ClientID%>").value=="")
        {
            message += "Cash Account Feild can not be blank\n";
            document.getElementById("<%=TextBox3.ClientID%>").style.backgroundColor="#c8d1e4";
        }
        
    
        if(message.length >0)
        {
            message = "please notice the following requirments:\n\n" + message;
            alert(message);
            return false;
        }
          return true;
      }
</script>
</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>
                                        ATM Information</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">
                                                        Branch
                                                    </td>
                                                    <td colspan=4>
                                                        <asp:DropDownList ID="ddlChannels" runat="server" DataTextField="branch_name" 
                                                            Width="250px" DataValueField="branch_code" class="fieldNormal" 
                                                            AutoPostBack="True" onselectedindexchanged="ddlChannels_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                 </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal">
                                                        Terminal
                                                    </td>
                                                    <td colspan=4>
                                                        <asp:TextBox ID="txtATMnumber" runat="server" class="fieldNormal" Width=250 
                                                            MaxLength="16"></asp:TextBox>
                                                 </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal">
                                                        ATM Type
                                                    </td>
                                                    <td colspan=4>
                                                    <asp:DropDownList ID="ddlType" runat="server" DataTextField="type_name" 
                                                            Width=250px DataValueField="type_code" class="fieldNormal">
                                                    </asp:DropDownList>
                                                 </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="5" style="text-align:center">
                                                        <asp:Button ID="Button1" runat="server" Text="Search" CssClass="Btn_L_Normal" 
                                                            onclick="Button1_Click" />
                                                    </td>
                                                </tr>
                                            </table>

                                    </asp:Panel>
                                            <br />
                                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                        
                                        
                                        <asp:Panel ID="pnl_confirmation" runat="server" Width="100%">
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td colspan="2" class="tdNormal" align="center">
                                                       <asp:Label runat="server" Text="Are you sure you want to delete this ATM ?"></asp:Label>                                                       
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal">
                                                       <asp:Button ID="btn_conf_ok" runat="server" Text="OK" CssClass="Btn_L_Normal" 
                                                            onclick="btn_conf_ok_Click"/>
                                                    </td>

                                                    <td class="tdNormal">
                                                       <asp:Button ID="btn_conf_cancel" runat="server" Text="Cancel" 
                                                            CssClass="Btn_L_Normal" onclick="btn_conf_cancel_Click"/>
                                                    </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" EmptyDataText="There are no Results" 
                                                            DataKeyNames="atm_number" 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="branch_code" HeaderText="Branch code" />
                                                                <asp:BoundField DataField="atm_number" HeaderText="ATM Number" />
                                                                <asp:BoundField DataField="term_id" HeaderText="Terminal ID" />
                                                                <asp:BoundField DataField="type_code" HeaderText="" />
                                                                <asp:BoundField DataField="atm_type" HeaderText="Type" />
                                                                <asp:BoundField DataField="overage_acct_number" HeaderText="overage_acct_number" />
                                                                <asp:BoundField DataField="shortage_acct_number" HeaderText="shortage_acct_number" />
                                                                <asp:BoundField DataField="cash_acct_number" HeaderText="cash_acct_number" />
                                                                <asp:BoundField DataField="overage_dep_acct_number" HeaderText="cash_acct_number" />
                                                                <asp:BoundField DataField="shortage_dep_acct_number" HeaderText="cash_acct_number" />
                                                                <asp:BoundField DataField="cash_dep_acct_number" HeaderText="cash_acct_number" />
                                                                <asp:BoundField DataField="modified_by" HeaderText="" />
                                                                <asp:BoundField DataField="modify_date" HeaderText="" />
                                                                <asp:BoundField DataField="ATM_GROUP" HeaderText="Group"/>
                                                                <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:BoundField DataField="suspense_acct_number" HeaderText="suspense_acct_number" />
                                                                <asp:BoundField DataField="suspense_dep_acct_number" HeaderText="suspense_acct_number" />

                                                                <asp:BoundField DataField="overage_usd_acct_number" HeaderText="overage_usd_acct_number" />
                                                                <asp:BoundField DataField="shortage_usd_acct_number" HeaderText="shortage_usd_acct_number" />
                                                                <asp:BoundField DataField="cash_usd_acct_number" HeaderText="cash_usd_acct_number" />
                                                                <asp:BoundField DataField="suspense_usd_acct_number" HeaderText="suspense_usd_acct_number" />
                                                                
                                                                <asp:BoundField DataField="overage_coin_dep_acct_number" HeaderText="overage_coin_dep_acct_number" />
                                                                <asp:BoundField DataField="shortage_coin_dep_acct_number" HeaderText="shortage_coin_dep_acct_number" />
                                                                <asp:BoundField DataField="coin_dep_acct_number" HeaderText="coin_dep_acct_number" />
                                                                <asp:BoundField DataField="suspense_coin_dep_acct_number" HeaderText="suspense_coin_dep_acct_number" />


                                                            </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>
                                                        <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" 
                                            style="text-align: left">
                                            <fieldset id="addItem">
                                                <legend id="addItem">ATM Details</legend>
                                            </fieldset>
                                            <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        Branch 
                                                    </td>
                                                    <td class="tdNormal" colspan="2">
                                                        <asp:DropDownList ID="DropDownList1" runat="server" class="fieldNormal"
                                                        DataTextField="branch_name" DataValueField="branch_code"></asp:DropDownList>
                                                    </td>
                                                    <td class="tdNormal" style="width:15%">
                                                        </td>
                                                    <td class="tdNormal" style="width:30%">
                                                        
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        Terminal ID
                                                    </td>
                                                    <td class="tdNormal" colspan="2">
                                                        <asp:TextBox ID="txtTerminalID" runat="server" class="fieldNormal" 
                                                            MaxLength="16"></asp:TextBox>
                                                        </td>
                                                    <td class="tdNormal" style="width:15%">
                                                        &nbsp;</td>
                                                    <td class="tdNormal" style="width:30%">
                                                        &nbsp;</td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        ATM Type
                                                    </td>
                                                    <td class="tdNormal" colspan="2">
                                                        <asp:DropDownList ID="DropDownList3" runat="server" class="fieldNormal" 
                                                            DataTextField="type_name" DataValueField="type_code">
                                                        </asp:DropDownList></td>
                                                    <td class="tdNormal" style="width:15%">
                                                        </td>
                                                    <td class="tdNormal" style="width:30%">
                                                        </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        ATM Group</td>
                                                    <td class="tdNormal" colspan="2">
                                                        <asp:DropDownList ID="ddlATMGroup" runat="server" class="fieldNormal" 
                                                            DataTextField="GROUP_NAME" DataValueField="GID">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td class="tdNormal" style="width:15%">
                                                        &nbsp;</td>
                                                    <td class="tdNormal" style="width:30%">
                                                        &nbsp;</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="5">
                                                        <fieldset id="addItem">
                                                            <legend id="addItem">Withdrowal Accounts</legend>
                                                        </fieldset>
                                                        <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                            <tr>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Surplus Account 
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Shortage Account
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Cash Account</td>
                                                                    <td class="tdNormal" style="width:30%">
                                                                    Suspense Account</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox1" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox2" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox3" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                 <td class="tdNormal">
                                                                    <asp:TextBox ID="txtSuspense" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width:30%">
                                                                   USD Surplus Account 
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                   USD Shortage Account
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                  USD  Cash Account</td>
                                                                    <td class="tdNormal" style="width:30%">
                                                                   USD Suspense Account</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtUSDSurplusAccount" runat="server" class="fieldNormal" 
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtUSDShortageAccount" runat="server" class="fieldNormal" 
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtUSDCashAccount" runat="server" class="fieldNormal" 
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                 <td class="tdNormal">
                                                                    <asp:TextBox ID="txtUSDSuspenseAccount" runat="server" class="fieldNormal" 
                                                                         MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="5">
                                                        <fieldset id="addItem">
                                                            <legend id="addItem">Deposit Accounts</legend>
                                                        </fieldset>
                                                        <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                            <tr>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Surplus Account 
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Shortage Account
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Cash Account</td>
                                                                     <td class="tdNormal" style="width:30%">
                                                                    Suspense Account</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox4" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox5" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox6" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtDepSuspense" runat="server" class="fieldNormal" 
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                              <tr>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Coin Surplus Account 
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Coin Shortage Account
                                                                </td>
                                                                <td class="tdNormal" style="width:5%">
                                                                </td>
                                                                <td class="tdNormal" style="width:30%">
                                                                    Coin Account</td>
                                                                     <td class="tdNormal" style="width:30%">
                                                                    Coin Suspense Account</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtCoinSurpAccc" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtCoinShortAcct" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtCoinAcct" runat="server" class="fieldNormal" MaxLength="20"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="txtCoinSusAcc" runat="server" class="fieldNormal" 
                                                                        MaxLength="20"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr> 
                                               
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        Modified By
                                                    </td>
                                                    <td class="tdNormal" style="width:30%">
                                                        <asp:Label ID="lblUser" runat="server" Text="Label" Font-Bold="True"></asp:Label>
                                                        </td>
                                                    <td class="tdNormal" style="width:10%">
                                                        </td>
                                                    <td class="tdNormal" style="width:15%">
                                                    Modify dDate
                                                        &nbsp;</td>
                                                    <td class="tdNormal" style="width:30%">
                                                    <asp:Label ID="lblDate" runat="server" Text="Label" Font-Bold="True"></asp:Label>
                                                        &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   " OnClientClick="return validate()"
                                                            class="Btn_M_Normal" onclick="btnSave_Click" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>                                    
                                        <!------------------------------------body End2 ----------------------------------------------->
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
</asp:Content>

