<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" MasterPageFile="~/CITAD.Master"
    Codebehind="frmFundReturnApprove_List.aspx.cs" Inherits="CITAD.Modules.KiemSoatLenhHoanChuyen.Web.frmFundReturnApprove_List"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript">
        //window.document.onkeydown=KeyDown;
        function fcnShowR_CI_List(txtci_id)
        {        
            if (event.keyCode==115) //F4
            {
                if(!document.getElementById(txtci_id).readOnly)
                {
                    rValue = window.showModalDialog('../DanhSachNganHang/frmCIList.aspx' + '?randomNumber=' + Math.random(),"",strCIPopupFeature);
                    if(rValue!=undefined) 
                    {
                        document.getElementById(txtci_id).value = rValue;
                        __doPostBack(txtci_id,'');
                    }
                }
                event.keyCode=9;
            }
        }
    </script>

    <script language="javascript" type="text/javascript">
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
            if(event.ctrlKey)
            {
                if(window.event.keyCode==69)
                {
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuClose');
                }
                if(window.event.keyCode==54)
                {
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuApprove');
                }
                if(window.event.keyCode==50)
                {
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuOpen');
                }
                if(window.event.keyCode==52)
                {
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuIquiry');
                }
            }
            if(event.keyCode == 13)
            {    
                var tablet = document.getElementById('eventSRC');
                if(tablet.contains(event.srcElement)){
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuIquiry');
                }
            }
        }
        function formload()
        {
            document.getElementById('<%=txtRelation_No.ClientID %>').focus();
        }
    </script>

    <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" EnableScriptGlobalization="True"
        EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="true" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <table class="citad-toolbar" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="citad-toolbar-tdleft">
                        </td>
                        <td class="citad-toolbar-tdmain">
                            <asp:Menu ID="Menu1" runat="server" OnMenuItemClick="Menu1_MenuItemClick" Font-Names="Verdana"
                                Font-Size="11px" Orientation="Horizontal" CssClass="citad-menu" StaticSubMenuIndent="10px"
                                meta:resourcekey="Menu1Resource1" StaticHoverStyle-CssClass="citad-menu-hover"
                                StaticMenuStyle-CssClass="citad-menu" StaticSelectedStyle-CssClass="citad-menu-selected"
                                StaticMenuItemStyle-HorizontalPadding="5px" StaticMenuItemStyle-VerticalPadding="2px">
                                <Items>
                                    <asp:MenuItem Text="Tho&#225;t" Value="mnuClose" ImageUrl="~/Images/Menu/home.gif"
                                        NavigateUrl="~/Default.aspx" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif"
                                        meta:resourcekey="MenuItemResource1"></asp:MenuItem>
                                    <asp:MenuItem Text="Duyệt" ImageUrl="~/Images/Menu/approve.gif" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif"
                                        Value="mnuApprove" meta:resourcekey="MenuItemResource3"></asp:MenuItem>
                                    <asp:MenuItem Text="Chọn mở" ImageUrl="~/Images/Menu/open.gif" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif"
                                        Value="mnuOpen" meta:resourcekey="MenuItemResource2"></asp:MenuItem>
                                    <asp:MenuItem Text="Truy vấn" Value="mnuIquiry" ImageUrl="~/Images/Menu/search.gif"
                                        meta:resourcekey="MenuItemResource4"></asp:MenuItem>
                                </Items>
                                <StaticMenuStyle CssClass="citad-menu" />
                                <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                                <StaticSelectedStyle CssClass="citad-menu-selected" />
                                <StaticHoverStyle CssClass="citad-menu-hover" />
                            </asp:Menu>
                        </td>
                    </tr>
                </table>
            </div>
            <table width="770px" style="vertical-align: top;" border="0" cellpadding="0" cellspacing="0">
                <%--<tr>
                    <td colspan="3" class="Header" style ="BACKGROUND-POSITION-Y: top; BACKGROUND-IMAGE: url(../../Images/Menu/header.gif); HEIGHT: 28px;" valign ="top"    >
                        
                    </td>
                </tr>--%>
                <tr>
                    <td colspan="3" valign="top" >
                        <fieldset>
                            <legend>
                                <asp:Label ID="grbTrxType" runat="server" meta:resourcekey="grbTrxTypeResource1">Thông tin truy vấn</asp:Label></legend>
                            <table cellpadding="0" cellspacing="1" id="eventSRC">
                                <tr>
                                    <td style="width: 105px; text-align: right;">
                                        <asp:Label ID="lblRelation_No" runat="server" meta:resourcekey="lblRelation_NoResource1"
                                            Text="Số bút toán"></asp:Label>&nbsp;</td>
                                    <td style="width: 179px;">
                                        <asp:TextBox ID="txtRelation_No" runat="server" CssClass="citad-txt" meta:resourcekey="txtSerial_NoResource1"
                                            onpropertychange="Upper()" Width="97px"></asp:TextBox></td>
                                    <td style="width: 118px; text-align: right;">
                                        <asp:Label ID="lblReceivingBank" runat="server" Text="Ngân hàng nhận"
                                            meta:resourcekey="lblReceivingBankResource1"></asp:Label>&nbsp;</td>
                                    <td colspan="1">
                                        <asp:TextBox ID="txtReceivingBank" runat="server" CssClass="citad-txt" meta:resourcekey="txtReceivingBankResource1"
                                            Width="83px"></asp:TextBox></td>
                                    <td colspan="1" align="right" style="width: 94px;">
                                        <asp:CheckBox ID="chTRX_Date" runat="server" Text="Ngày tạo" meta:resourcekey="chTRX_DateResource1"
                                            AutoPostBack="True" OnCheckedChanged="chTRX_Date_CheckedChanged" />&nbsp;</td>
                                    <td colspan="3" style="width: 200px;">
                                        <asp:TextBox ID="txtTRX_Date" runat="server" CssClass="citad-txt" meta:resourcekey="TextBox1Resource1"
                                            Width="70px"></asp:TextBox>
                                        <asp:ImageButton ID="imgCalendar" runat="server" ImageUrl="~/Images/Calendar.png"
                                            meta:resourcekey="imgCalendarResource1" /></td>
                                </tr>
                                <tr>
                                    <td colspan="2" valign="middle">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label1" runat="server" meta:resourcekey="Label1Resource1">Loại giao dịch</asp:Label></legend>
                                            <asp:RadioButton ID="rdbLV" runat="server" GroupName="TrxType" Text="Giá trị thấp"
                                                CssClass="citad-RadioButton" meta:resourcekey="rdbLVResource1" />
                                            <asp:RadioButton ID="rdbHV" runat="server" GroupName="TrxType" Text="Giá trị cao"
                                                CssClass="citad-RadioButton" meta:resourcekey="rdbHVResource1" />
                                            <asp:RadioButton ID="rdbAll" runat="server" Checked="True" GroupName="TrxType" Text="Tất cả"
                                                CssClass="citad-RadioButton" meta:resourcekey="rdbAllResource1" />
                                        </fieldset>
                                    </td>
                                    <td valign="middle" style="width: 118px; text-align: right">
                                        <asp:Label ID="lblTrxStatus" runat="server" meta:resourcekey="lblTrxStatusResource1"
                                            Text="Tình trạng"></asp:Label></td>
                                    <td colspan="3" style="width: 200px" valign="middle">
                                        &nbsp;<asp:DropDownList ID="cboTrx_Status" runat="server" Width="97%" meta:resourcekey="cboTrx_StatusResource1">
                                        </asp:DropDownList></td>
                                    <td colspan="1" valign="middle">
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="7" valign="middle">
                                        <asp:Label ID="lblTongSo" runat="server" Text="Tổng số: " Font-Bold="True" meta:resourcekey="lblTongSo"></asp:Label>
                                        <asp:Label ID="lblCount" runat="server" Font-Bold="True"></asp:Label></td>
                                </tr>
                            </table>
                        </fieldset>
                    </td>
                </tr>
            </table>
            <div>
                <asp:GridView ID="grvListTrx" CellPadding="2" 
                    CssClass="grid" runat="server" 
                    AutoGenerateColumns="False"
                    DataKeyNames="MSG_KEY,MAC" 
                    AllowPaging="True" 
                    PageSize="10" 
                    OnRowDataBound="grvListTrx_RowDataBound"
                    meta:resourcekey="grvListTrxResource1" 
                    OnPageIndexChanging="grvListTrx_PageIndexChanging"
                    OnSelectedIndexChanged="grvListTrx_SelectedIndexChanged" 
                    AllowSorting="True" 
                    OnSorting="grvListTrx_Sorting">
                    <FooterStyle CssClass="grid-footer" />
                    <RowStyle CssClass="grid-row" />
                    <SelectedRowStyle CssClass="grid-selectedRow" />
                    <PagerStyle HorizontalAlign="Center" CssClass="grid-pager" />
                    <HeaderStyle CssClass="grid-header" />
                    <AlternatingRowStyle CssClass="grid-alternating" />
                    <Columns>
                        <asp:TemplateField
                            meta:resourcekey="TemplateFieldResource1">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkCheckAll" runat="server" onclick="return CheckAll(this,'chkOne');"
                                    meta:resourcekey="chkCheckAllResource1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="chkOne" type="CheckBox" runat="server" />
                            </ItemTemplate>
                            <ItemStyle Width="15px" HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource2">
                            <HeaderTemplate>
                                <asp:Label ID="lblNo" Text="STT" runat="server" meta:resourcekey="lblNoResource1"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("No") %>
                            </ItemTemplate>
                            <ItemStyle Width="25px" HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource3">
                            <HeaderTemplate>
                                <asp:LinkButton runat="server" ID="LinkButton1" Text="Số hiệu bút toán" CommandName="Sort" CommandArgument="RELATION_NO" meta:resourcekey="lblRelation_NoResource1" />                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("RELATION_NO") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource4">
                            <HeaderTemplate>                                
                                <asp:LinkButton runat="server" ID="LinkButton2" Text="Số giao dịch" CommandName="Sort" CommandArgument="FR.SERIAL_NO" meta:resourcekey="lblSerial_NoResource2" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtSERIAL_NO" runat="server" CommandName="Select" Text='<%# Bind("SERIAL_NO") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource5">
                            <HeaderTemplate>
                                <asp:Label ID="lblTrx_type" Text="Loại giao dịch" runat="server" meta:resourcekey="lblTrx_typeResource1"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("LOAIGIAODICH") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource5">
                            <HeaderTemplate>
                                <asp:Label ID="lblNoCo" Text="Nợ/Có" runat="server" meta:resourcekey="lblNoCoResource1"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("NOCO") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource7">
                            <HeaderTemplate>                                
                                <asp:LinkButton runat="server" ID="LinkButton3" Text="Số tiền" CommandName="Sort" CommandArgument="AMOUNT_ORG" meta:resourcekey="lblTrx_AmountResource1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("AMOUNT_ORG") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Right" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource8">
                            <HeaderTemplate>
                                <asp:Label ID="lblTrx_Status" Text="T&#236;nh trạng" runat="server" meta:resourcekey="lblTrx_StatusResource1"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("TINHTRANG") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="TemplateFieldResource9">
                            <HeaderTemplate>                                
                                <asp:LinkButton runat="server" ID="LinkButton4" Text="Ng&#226;n h&#224;ng nhận" CommandName="Sort" CommandArgument="R_CI_CODE" meta:resourcekey="lblR_CI_CODEResource1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("R_CI_CODE") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HiddenField ID="hidESIGN_MESSAGE" runat="server" />
                            </ItemTemplate>
                            <ItemStyle CssClass="invisible" />
                            <HeaderStyle CssClass="invisible" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HiddenField ID="hidESIGN_CONTENT" runat="server" />
                            </ItemTemplate>
                            <ItemStyle CssClass="invisible" />
                            <HeaderStyle CssClass="invisible" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <asp:Label ID="lblGrdMessage" meta:resourcekey="lblGrdMessageResource1" Text="Không có bản ghi nào "
                            runat="server"></asp:Label>
                    </EmptyDataTemplate>
                </asp:GridView>
            </div>
            <uc1:MessageBox ID="MessageBox1" runat="server" />
            <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
                ControlToValidate="txtTRX_Date" Display="Dynamic" EmptyValueBlurredText="*" EmptyValueMessage="Date is required"
                InvalidValueBlurredMessage="*" InvalidValueMessage="Date is invalid" ValidationGroup="MKE"
                ErrorMessage="MaskedEditValidator1" meta:resourcekey="MaskedEditValidator1Resource1" />
            <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" ErrorTooltipEnabled="True"
                Mask="99/99/9999" MaskType="Date" TargetControlID="txtTRX_Date" Enabled="True" />
            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" TargetControlID="txtTRX_Date"
                Enabled="True" PopupButtonID="imgCalendar" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
