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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" type="text/javascript">
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 />
                                        <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">
                                                        </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>
                                            <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">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: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>
                                                        <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">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 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>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox1" runat="server" class="fieldNormal"  MaxLength="30"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox2" runat="server" class="fieldNormal" MaxLength="30"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox3" runat="server" class="fieldNormal" MaxLength="30"></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>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox4" runat="server" class="fieldNormal" MaxLength="30"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                    
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox5" runat="server" class="fieldNormal" MaxLength="30"></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal">
                                                                </td>
                                                                <td class="tdNormal">
                                                                    <asp:TextBox ID="TextBox6" runat="server" class="fieldNormal" MaxLength="30"></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>

