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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<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;
        }
    }
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
                   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                     <ContentTemplate>
<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>
                                        Branch</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%">
                                     <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
                                                        AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
                                                        <ProgressTemplate>
                                                            <img alt="Loading" src="../Images/ajax-loader.gif" />
                                                        </ProgressTemplate>
                                                    </asp:UpdateProgress>
                                        <table border="0" width=100% cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                
                                                <tr>
                                                    <td class="tdNormal">
                                                        Branch</td>
                                                    <td colspan=4>
                                                        <asp:TextBox ID="txtBranchCode" runat="server" class="fieldNormal" Width=250 
                                                            MaxLength="3"></asp:TextBox>
                                                 </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 ID="Label1" runat="server" Text="Are you sure you want to delete this Branch ?"></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">Branch 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="branch_cd" onrowcommand="GridView1_RowCommand" 
                                                            onpageindexchanging="GridView1_PageIndexChanging">
                                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                            <Columns>
                                                                <asp:BoundField DataField="branch_cd" HeaderText="Branch code" />
                                                                <asp:BoundField DataField="l_nm" HeaderText="l_nm" />                                   
                                                                <asp:BoundField DataField="a_nm" HeaderText="Name" /> 
                                                                 
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="d" 
                                                                    Text="Delete" ImageUrl="~/Images/delete.jpg" >
                                                                </asp:ButtonField>
                                                                
                                                            </Columns>
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                               
                                            </table>
                                            
                                        </asp:Panel> 
                                        <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"/>
                                                    </td> 
                                                </tr>
                                            </table>   
                                        <asp:Panel ID="pnlControls" runat="server" Width="100%" Visible="false" 
                                            style="text-align: left">
                                            <fieldset id="addItem">
                                                <legend id="addItem">Branch 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:TextBox ID="txtBranch" runat="server" class="fieldNormal" MaxLength="3"></asp:TextBox>
                                                    </td>
                                                  
                                                    <td class="tdNormal" style="width:15%">
                                                        Name</td>
                                                    <td class="tdNormal" style="width:15%">
                                                        <asp:TextBox ID="txtBranchName" runat="server" class="fieldNormal" MaxLength="255"></asp:TextBox>
                                                    </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/>
                                        <%--<asp:Panel ID="pnlGrid" runat="server" Width="100%" Visible ="false" >
                                            
                               
                                               <asp:GridView ID="GridView2" CssClass="gridMaster" Width ="100%" runat="server" AutoGenerateColumns="False"
                                                                OnRowCommand="GridView1_RowCommand" AllowSorting="True" CellPadding="4" 
                                                                ForeColor="#333333" GridLines="None" OnRowCreated="GridView2_RowCreated"
                                                                DataKeyNames="mkt_code" AllowPaging ="True">
                                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                                <Columns>
                                                                                                                        
                                                                    <asp:BoundField DataField="chg_id" HeaderText="Change Id" />                                      
                                                                    <asp:BoundField DataField="column_name" HeaderText="Column Name"  />
                                                                    <asp:BoundField DataField="old_value" HeaderText="Old Value"  />
                                                                    <asp:BoundField DataField="new_value" HeaderText="New Value"  />
                                                                    <asp:BoundField DataField="changed_rec_id" HeaderText="RRN"  />
                                                                    <asp:BoundField DataField ="chg_type_code" HeaderText ="chg_type_code" />
                                                                    <asp:BoundField DataField="chg_type" HeaderText="Request Type"  />
                                                                        
                                                                </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" />
                                                            </asp:GridView>
                                                 <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgForm">
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btnClose" runat="server" Text="     Close     " 
                                                            class="Btn_M_Normal" onclick="btnClose_Click"/>
                                                </tr>
                                            </table>
                              
                                         </asp:Panel>--%>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
                </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

