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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" type="text/javascript">
function validate() {
        var message = "";
        if (validateEmptyValues()) {
//            if (isNaN(document.getElementById("<%=txtDebit.ClientID%>").value)
//                || isNaN(document.getElementById("<%=TxtCredit .ClientID%>").value)               
//                ) {

//                //message += "Please enter a valid amount value\n";
//                //document.getElementById("<%=lblError.ClientID%>").innerHTML = "Please enter a valid amount value";
//                alert("Please enter a valid amount value");
                return true;
            } else {
                document.getElementById("<%=lblError.ClientID%>").innerHTML = "";
                return true;
            }
        }
        else {
            //document.getElementById("<%=lblError.ClientID%>").innerHTML = "Please enter atleast one value";
            alert("Please enter the Debit and Credit Account");
            return false;
        }
    }

    function validateEmptyValues() {
        var message = "";

        if (document.getElementById("<%=txtDebit.ClientID%>").value == ""
                || document.getElementById("<%=TxtCredit.ClientID%>").value == ""
                            
                ) {

            
            return false;
        } else {
            return true;
        }

    }
    </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>
                                        SAMA Monthly Account</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 runat="server" id="eventsRow">
                                                    <td class="tdNormal" style="width:15%">
                                                        SAMA Type
                                                    </td>
                                                    <td class="tdNormal" colspan="2">
                                                        <asp:DropDownList ID="ddlSAMAType" runat="server" DataTextField="SAMA_MONTHLY_GL_DESCRIBTION" 
                                                            Width="250px" DataValueField="LSM_G_CODE" class="fieldNormal">
                                                        </asp:DropDownList>
                                                 </td>
                                                 <td class="tdNormal" style="width:15%">&nbsp;</td>
                                                 <td class="tdNormal" style="width:30%">
                                                    &nbsp;
                                                 </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:UpdateProgress ID="UpdateProgress1" runat="server" 
                                                        AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
                                                        <ProgressTemplate>
                                                            <img alt="Loading" src="../Images/ajax-loader.gif" />
                                                        </ProgressTemplate>
                                                    </asp:UpdateProgress>
                                        <asp:Panel ID="pnlResult" runat="server" Width="100%" Visible="false">
                                            <fieldset id="addItem">
                                             <legend id="addItem">SAMA Monthly 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" AllowSorting="True" CellPadding="4" 
                                                            ForeColor="#333333" GridLines="None" EmptyDataText="There are no Results" 
                                                            DataKeyNames="SMTA_CODE" onrowcommand="GridView1_RowCommand" 
                                                            onrowdatabound="GridView1_RowDataBound" 
                                                            onrowcreated="GridView1_RowCreated" >
                                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                            <Columns>
                                                                <asp:BoundField DataField="SMTA_CODE_DESC" HeaderText="SAMA Account Desc" />
                                                                <asp:BoundField DataField="RECORD_DATE" HeaderText="Record Date" />
                                                                <asp:BoundField DataField="DEBIT_ACCOUNT" HeaderText="Debit Account" />
                                                                <asp:BoundField DataField="CREDIT_ACCOUNT" HeaderText="Credit Account" />
                                                                <asp:BoundField DataField="CREATED_BY" HeaderText="Created By" />
                                                                <asp:BoundField DataField="MODIFIED_BY" HeaderText="Modified By" />
                                                                <asp:BoundField DataField="MODIFIED_DATE" HeaderText="Modified Date" /> 
                                                                <asp:BoundField DataField="app_status" HeaderText="app_status"/>
                                                                <asp:BoundField DataField="status" HeaderText="Status"/>                                                             
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="vm" Text="View Modification" ImageUrl="~/Images/view.jpg" />                                                                
                                                              
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="e" 
                                                                    Text="Edit" ImageUrl="~/Images/edit.jpg" >
                                                                </asp:ButtonField>
                                                                
                                                            </Columns>
                                                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                                            <EditRowStyle BackColor="#999999" />
                                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Right" />
                                                        </asp:GridView></td>
                                                </tr>
                                             
                                            </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"/>
                                                </tr>
                                            </table>   
                                        <asp:Panel ID="pnlControls" runat="server" Width="100%" Visible="false">
                                            <fieldset id="addItem">
                                                <legend id="addItem">SAMA Monthly Account Details</legend>
                                            </fieldset>
                                            <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td colspan ="2" class="tdNormal">
                                                        SAMA Monthly Total Account Description
                                                    </td>
                                                    <td colspan="2" class ="tdNormal">
                                                        <asp:DropDownList ID="ddlSAMAType1" runat="server" class="fieldNormal" 
                                                            DataTextField="SAMA_MONTHLY_GL_DESCRIBTION" DataValueField="LSM_G_CODE" 
                                                            Width="250px">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan ="2" class="tdNormal">
                                                        Debit Account
                                                    </td>
                                                    <td colspan=2>
                                                        <asp:TextBox ID="txtDebit" runat="server" class="fieldNormal  " MaxLength="19"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                  <tr>
                                                    <td colspan ="2" class="tdNormal">
                                                        Crdit Account
                                                    </td>
                                                    <td colspan=2>
                                                        <asp:TextBox ID="TxtCredit" runat="server" class="fieldNormal" MaxLength="19"></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   "
                                                            class="Btn_M_Normal" onclick="btnSave_Click" OnClientClick="return validate()" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>                                    
                                        <!------------------------------------body End2 ----------------------------------------------->
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
                 </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

