<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true"
    CodeFile="ApproveClaimsECOM.aspx.cs" Inherits="ApproveClaimsECOM"  MaintainScrollPositionOnPostback ="false" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script type="text/javascript" >
   
    function disableCancelBtn() {
        document.getElementById('<%=Button1.ClientID %>').disabled = 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>
                            Approve E-Commerce Claims
                        </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 style="display:none">
                                    <td class="tdNormal">
                                        Claim Type
                                    </td>
                                    <td class="tdNormal" colspan=4>
                                        <asp:RadioButton ID="rdATM" AutoPostBack=true Text="ATM" GroupName=1 runat="server" 
                                            oncheckedchanged="rdATM_CheckedChanged"/>
                                        <asp:RadioButton ID="rdPOS" AutoPostBack=true Text="POS" GroupName=1 runat="server" Checked=true 
                                            oncheckedchanged="rdPOS_CheckedChanged" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        Claim ID <span style="color:Red">*</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtClaimID" runat="server" class="fieldNormal" Width="250"  MaxLength="15"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        
                                        Events</td>
                                    <td class="tdNormal">
                                        
                                        <asp:DropDownList ID="ddlEvents" runat="server"  Width="251px"
                                          DataTextField="evant_name" DataValueField="re_code" class="fieldNormal" AutoPostBack ="false">
                                        </asp:DropDownList>
                                        
                                    </td>
                                </tr>
                                <tr runat="server" id="rowATM">
                                    <td class="tdNormal">
                                        Reference Number
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtReference" runat="server" class="fieldNormal" Width="250"  MaxLength="12"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Card Number
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtCardNumber" runat="server" class="fieldNormal" Width="250"  MaxLength="19"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr runat="server" id="rowATM2">
                                    <td class="tdNormal">
                                        ATM No
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtATMNo" runat="server" class="fieldNormal" Width="250"  MaxLength="4"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                </tr>                                
                                <tr runat="server" id="rowPOS">
                                    <td class="tdNormal">
                                        Client Number
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtClientNo" runat="server" class="fieldNormal" Width="250"  MaxLength="20"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Terminal ID <span style="color:Red">*</span>
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtTermID" runat="server" class="fieldNormal" Width="250"  MaxLength="16"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr runat="server" id="rowPOS2">
                                    <td class="tdNormal">
                                        Retailer ID
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtRetailerID" runat="server" class="fieldNormal" Width="250"  MaxLength="20"></asp:TextBox>
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Card Number <span style="color:Red">*</span>
                                    </td>
                                    <td class="tdNormal">
                                        <asp:TextBox ID="txtCardPOS" runat="server" class="fieldNormal" Width="250"  MaxLength="19"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr runat="server" id="rowPOS3">
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        Search Type
                                    </td>
                                    <td class="tdNormal">
                                        <asp:RadioButton ID="rdCH" runat="server" GroupName="aaa" Text="Card Holder" 
                                            Checked="True" />
                                        <asp:RadioButton ID="rdMER" runat="server" GroupName="aaa" Text="Merchant" />
                                    </td>
                                </tr> 
                                <tr>
                                    <td class="tdNormal">
                                        Claim Status</td>
                                    <td>
                                        <asp:DropDownList ID="ddlClaimType" runat="server" DataTextField="CLAIM_STATUS_DESC" 
                                        Width="250px" DataValueField="CL_CODE" class="fieldNormal" AutoPostBack="True" 
                                            onselectedindexchanged="ddlClaimType_SelectedIndexChanged" ></asp:DropDownList>
                                    </td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                        SAMA Status</td>
                                    <td class="tdNormal">
                                        
                                        <asp:DropDownList ID="ddlSamaStatuses" runat="server" DataTextField="status_desc" 
                                        Width="250px" DataValueField="status_code" class="fieldNormal" 
                                            AutoPostBack="False" Enabled="False" ></asp:DropDownList>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        Claim Type</td>
                                    <td>
                                        <asp:DropDownList ID="ddlClaimType2" runat="server" Height="16px" Width="249px"
                                        DataTextField="CLAIM_TYPE"
                                        DataValueField="CT_CODE"
                                        class="fieldNormal">
                                        </asp:DropDownList>
                                    </td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                        Search Type</td>
                                    <td class="tdNormal">
                                        
                                        <asp:RadioButton ID="rdOnUs" runat="server" GroupName="aa" Text="On Us" 
                                            Checked="True" Enabled="False" />
                                        <asp:RadioButton ID="rdOther" runat="server" GroupName="aa" Text="Others" 
                                            Enabled="False" />
                                       
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        Transaction Date <span style="color:Red">*</span>
                                    </td>
                                    <td>
                                        <uc1:datepicker id="dtTranDate" runat="server" width="250" />
                                    </td>
                                    <td class="tdNormal">
                                    </td>
                                    <td class="tdNormal">
                                        
                                        Orginal Claim ID</td>
                                    <td class="tdNormal">
                                        
                                        <asp:TextBox ID="txtOrgClaimID"  MaxLength="15" runat="server" Width="247px"></asp:TextBox>
                                       
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        SAMA From Date</td>
                                    <td>
                                        
                                        <uc1:datepicker id="dtSamaFromDate" runat="server" width="250" />
                                        
                                    </td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="tdNormal">
                                        
                                                        SAMA to Date</td>
                                    <td>
                                        
                                        <uc1:datepicker id="dtSameToDate" runat="server" width="250" />
                                        
                                    </td>
                                    <td class="tdNormal">
                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                                        &nbsp;</td>
                                    <td class="tdNormal">
                                        
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td colspan="5" style="text-align: center">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="Btn_L_Normal"
                                            OnClientClick="" OnClick="btnSearch_Click" />
                                    &nbsp;&nbsp;&nbsp;
                                        <asp:Button ID="btnGenReport" runat="server" Text="Generate Report" CssClass="Btn_L_Normal"
                                            OnClientClick="" OnClick="btnGenReport_Click" Width="101px" />
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                            <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"
                                            DataKeyNames="claim_id" AllowPaging="True" AllowSorting="True" CellPadding="4"
                                            ForeColor="#333333" GridLines="None" EmptyDataText="There are no Results" 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="claim_id" HeaderText="Claim ID" />
                                                <asp:BoundField DataField="card_number" HeaderText="Card No" />
                                                <asp:BoundField DataField="tran_date" HeaderText="Tran Date" />
                                                <asp:BoundField DataField="tran_amount" HeaderText="Tran Amount" />
                                                <asp:BoundField DataField="rrn" HeaderText="Reference No" />
                                                <asp:BoundField DataField="claim_status_desc" HeaderText="Status" />
                                                 <asp:BoundField DataField="sama_claim_status" HeaderText="SAMA Status" />
                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="a" Text="Approve"
                                                    ImageUrl="~/Images/approve.jpg"></asp:ButtonField>
                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="d" Text="Decline"
                                                    ImageUrl="~/Images/reject.jpg"></asp:ButtonField>
                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="r" Text="Reset"
                                                    ImageUrl="~/Images/AR/update.jpg"></asp:ButtonField>
                                                <asp:BoundField DataField="product" HeaderText="" />
                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="i" Text="Investigate"
                                                    ImageUrl="~/Images/document_view.jpg"></asp:ButtonField>
                                                <asp:BoundField DataField="claim_amount" HeaderText="" />
                                                 <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px"  CommandName="p"  Text="Approve & Post"
                                                        ImageUrl="~/Images/AR/cd_out.gif"></asp:ButtonField>
                                                <asp:BoundField DataField="claim_status" HeaderText="" />
                                            </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>
                                <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>
                            <asp:Panel ID="pnlApprove" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Approve Details</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            Suggested Amount
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                                <asp:TextBox ID="txtSugAmt" Enabled="false" runat="server" class="fieldNormal" Width="250"></asp:TextBox>
                                        </td>
                                     </tr>
                                     <tr>   
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:DropDownList Enabled="false" ID="ddlGLtype" runat="server" Width="50%">
                                                <asp:ListItem Value="1">Dr</asp:ListItem>
                                                <asp:ListItem Value="2">Cr</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:Label ID="lblFrom" runat="server" class="fieldNormal" Text="From "></asp:Label> 
                                        </td>
                                        <td class="tdNormal" style="width: 40%">                                       
                                            <asp:DropDownList ID="ddlFromAcct" Enabled="false" runat="server" DataTextField="acct_desc" 
                                                DataValueField="acct" class="fieldNormal"></asp:DropDownList>                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            <asp:Label ID="lblTo" runat="server" class="fieldNormal" Text="To"></asp:Label>    
                                        </td>
                                        <td class="tdNormal" style="width: 40%">                                    
                                            <asp:DropDownList ID="ddlToAcct" Enabled="false" runat="server" DataTextField="acct_desc" 
                                                DataValueField="acct" class="fieldNormal"></asp:DropDownList>
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:DropDownList ID="ddlATMAcc" runat="server" DataTextField="acct_desc" 
                                                DataValueField="acct" class="fieldNormal"></asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancelPost" runat="server" Text="   Cancel   " class="Btn_M_Normal"
                                                CausesValidation="False" OnClick="btnCancelPost_Click" />
                                            <asp:Button ID="btnSavePost" runat="server" Text="   Save   " class="Btn_M_Normal"
                                                OnClick="btnSavePost_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                             <asp:Panel ID="pnlPost" runat="server" Width="100%" Visible="false">
                                <fieldset id="addItem">
                                    <legend id="addItem">Posting Details</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width: 15%">
                                            &nbsp;</td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:Label ID="lblGLType" runat="server" Visible="False"></asp:Label>
                                        </td>
                                        <td class="tdNormal" style="width: 10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width: 15%">
                                            Amount
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtAmount" ReadOnly="true" runat="server" Width="100%" class="fieldNormal"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr><td class="tdNormal" style="width: 15%">
                                            Account Number
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtAccount" ReadOnly="true" runat="server" Width="100%" class="fieldNormal"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>   
                                        <td>
                                            Settlement Account
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtSettlementAcc" ReadOnly="true" runat="server" Width="100%" class="fieldNormal"></asp:TextBox>
                                        </td>                                                                             
                                    </tr>
                                     <tr><td class="tdNormal" style="width: 15%">
                                            Narrative1
                                        </td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtNarrative1" ReadOnly="true" runat="server" Width="100%" 
                                                class="fieldNormal"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>   
                                        <td>
                                            Narrative2
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtNarrative2" ReadOnly="true" runat="server" Width="100%" 
                                                class="fieldNormal"></asp:TextBox>
                                        </td>                                                                             
                                    </tr>
                                     <tr><td class="tdNormal" style="width: 15%">
                                            Narrative3</td>
                                        <td class="tdNormal" style="width: 30%">
                                            <asp:TextBox ID="txtNarrative3" ReadOnly="true" runat="server" Width="100%" 
                                                class="fieldNormal"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>   
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            &nbsp;</td>                                                                             
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="Button1" runat="server" Text="   Cancel   " class="Btn_M_Normal"
                                                CausesValidation="False" OnClick="btnCancel_Click"  />
                                            <asp:Button ID="Button2" runat="server" Text="   Save   " class="Btn_M_Normal"
                                                OnClick="btnPost_Click" OnClientClick ="javascript:disableCancelBtn();" />
                                            
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <!------------------------------------body End2 ----------------------------------------------->
                            <br>
                        </td>
                    </tr>
                </table>
                <!------------------------------------body End2 ----------------------------------------------->
            </td>
        </tr>
    </table>
</asp:Content>