<%@ Page Language="C#" EnableEventValidation="false" MasterPageFile="~/CITAD.Master"
    AutoEventWireup="true" Codebehind="frmLetterMsgApprove_List.aspx.cs" Inherits="CITAD.Modules.KiemSoatLenhTraSoat.Web.frmLetterMsgApprove_List"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" Title="Kiểm soát yêu cầu tra soát" %>

<%@ 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 type="text/javascript">
	    //window.document.onkeydown=KeyDown;
    </script>

    <script language="javascript" type="text/javascript">
	    //Cài đặt sự kiện phím tắt
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
            if(event.ctrlKey)
            {
                switch (event.keyCode)
                {
                    case 49://Ctrl + 1
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuApprove');
                        break;
                    case 50://Ctrl + 2
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuOpen');
                        break;
                    case 52://Ctrl + 4
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuQuery');
                        break;
                    case 69://Ctrl + E
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuClose');
                        break;
                }
            }
            if(event.keyCode == 13)
            {    
                var tablet = document.getElementById('eventSRC');                
                if(tablet.contains(event.srcElement)){
                    __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuQuery');                    
                }                
            }
        }
    </script>

    <cc1:ToolkitScriptManager runat="Server" ID="ScriptManager1" EnableScriptGlobalization="True"
        EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="true" />
    <div style="width: 770px;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="chkTRX_Date" EventName="CheckedChanged" />
                <asp:AsyncPostBackTrigger ControlID="Menu1" EventName="MenuItemClick" />
            </Triggers>
            <ContentTemplate>
                <table class="citad-toolbar" cellpadding="0" cellspacing="0" width="100%">
                    <tr valign="middle">
                        <td class="citad-toolbar-tdleft">
                        </td>
                        <td class="citad-toolbar-tdmain" align="left">
                            <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"
                                TabIndex="8">
                                <Items>
                                    <asp:MenuItem Text="Tho&#225;t" Value="mnuClose" ImageUrl="~/Images/Menu/home.gif"
                                        meta:resourcekey="MenuItemResource1" ToolTip="Ctrl + E" SeparatorImageUrl="~/Images/Menu/separator_h.gif">
                                    </asp:MenuItem>
                                    <asp:MenuItem Text="Duyệt" Value="mnuApprove" ImageUrl="~/Images/Menu/approve.gif"
                                        meta:resourcekey="MenuItemResource4" ToolTip="Ctrl + 1"></asp:MenuItem>
                                    <asp:MenuItem Text="Chọn mở" Value="mnuOpen" ImageUrl="~/Images/Menu/open.gif" meta:resourcekey="MenuItemResource3"
                                        ToolTip="Ctrl + 2"></asp:MenuItem>
                                    <asp:MenuItem Text="Truy vấn" Value="mnuQuery" ImageUrl="~/Images/Menu/search.gif"
                                        meta:resourcekey="MenuItemResource5" ToolTip="Ctrl + 4"></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>
                <fieldset style="margin-bottom: 5px; margin-top: 5px;">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="eventSRC">
                        <tr>
                            <td>
                                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblSerialNo" runat="server" Text="Số bút toán" 
                                                onpropertychange="Upper()" meta:resourcekey="lblSerialNoResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtSerialNo" runat="server" meta:resourcekey="txtSerialNoResource1"
                                                Width="80px" MaxLength="40" CssClass="citad-txt"></asp:TextBox></td>
                                        <td>
                                            <asp:Label ID="lblReceiveBank" runat="server" Text="Ngân hàng nhận" meta:resourcekey="lblReceiveBankResource1"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBankB" runat="server" meta:resourcekey="txtBankBResource1" Width="80px"
                                                MaxLength="12" CssClass="citad-txt"></asp:TextBox></td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td style="width: 80px" align="right">
                                            <asp:Label ID="lblTrxStatus" runat="server" Text="Tình trạng" meta:resourcekey="lblTrxStatusResource1"></asp:Label></td>
                                        <td>
                                            <asp:DropDownList ID="cboTrxStatus" runat="server" Width="230px" meta:resourcekey="cboTrxStatusResource1">
                                            </asp:DropDownList></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <fieldset class="fieldset">
                                    <legend>
                                        <asp:Label ID="lblTrxType" runat="server" Text="Loại giao dịch" meta:resourcekey="lblTrxTypeResource1"></asp:Label></legend>
                                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="height: 19px">
                                                <asp:RadioButton ID="rdbLV" runat="server" Text="Giá trị thấp" GroupName="grpLoaDichVu"
                                                    meta:resourcekey="rdbLVResource1" /></td>
                                            <td style="height: 19px">
                                                <asp:RadioButton ID="rdbHV" runat="server" Text="Giá trị cao" GroupName="grpLoaDichVu"
                                                    meta:resourcekey="rdbHVResource1" /></td>
                                            <td style="height: 19px">
                                                <asp:RadioButton ID="rdbAll" runat="server" Text="Tất cả" GroupName="grpLoaDichVu"
                                                    meta:resourcekey="rdbAllResource1" /></td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </td>
                            <td align="left">
                                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td align="right">
                                            <asp:CheckBox ID="chkTRX_Date" runat="server" Text="Ngày tạo" AutoPostBack="True"
                                                meta:resourcekey="chkTRX_DateResource1" OnCheckedChanged="chkTRX_Date_CheckedChanged" /></td>
                                        <td align="left" style="width: 127px">
                                            <asp:TextBox ID="dtpTRX_Date" runat="server" meta:resourcekey="dtpTRX_DateResource1"
                                                Width="80px" MaxLength="8" CssClass="citad-txt"></asp:TextBox>
                                            <asp:ImageButton ID="imgCalendar" runat="server" ImageUrl="~/Images/Calendar.png"
                                                meta:resourcekey="imgCalendarResource1" /></td>
                                        <td>
                                            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True"
                                                Format="dd/MM/yyyy" PopupButtonID="imgCalendar" TargetControlID="dtpTRX_Date">
                                            </ajaxToolkit:CalendarExtender>
                                            <cc1:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="dtpTRX_Date"
                                                Mask="99/99/9999" MaskType="Date" AcceptNegative="Left" ErrorTooltipEnabled="True"
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat=""
                                                CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
                                                CultureTimePlaceholder="" Enabled="True" />
                                            <cc1:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender5"
                                                ControlToValidate="dtpTRX_Date" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
                                                Display="Dynamic" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" ValidationGroup="MKE"
                                                ErrorMessage="MaskedEditValidator5" meta:resourcekey="MaskedEditValidator5Resource1" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td align="right">
                                <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>
                <asp:GridView DataKeyNames="ID,MAC" ID="grvTrxList" runat="server" 
                    CellPadding="1"
                    AllowPaging="True" 
                    AutoGenerateColumns="False" 
                    OnPageIndexChanging="grvTrxList_PageIndexChanging"
                    OnRowDataBound="grvTrxList_RowDataBound" 
                    meta:resourcekey="grvTrxListResource1"
                    OnSelectedIndexChanged="grvTrxList_SelectedIndexChanged" 
                    CssClass="grid" 
                    AllowSorting="True" 
                    OnSorting="grvTrxList_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">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkCheckAll" runat="server" onclick="return CheckAll(this,'chkOne');"
                                    meta:resourcekey="chkCheckAllResource2" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="chkOne" type="checkbox" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="STT" meta:resourcekey="BoundFieldResourceSTT">
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Số b&#250;t to&#225;n" DataField="RELATION_NO" meta:resourcekey="BoundFieldResource1" SortExpression="RELATION_NO" >
                            <ItemStyle HorizontalAlign="Left" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>                        
                        <asp:TemplateField HeaderText="Số hiệu giao dịch" meta:resourcekey="BoundFieldResource2" SortExpression="SERIAL_NO">
                            <HeaderStyle HorizontalAlign="Center" Width="80px" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtSERIAL_NO" runat="server" CommandName="Select" Text='<%# Bind("SERIAL_NO") %>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Loại giao dịch" DataField="TRX_STATUS" meta:resourcekey="BoundFieldResource3" >
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Nợ/C&#243;" meta:resourcekey="BoundFieldResource8">
                            <HeaderStyle Width="100px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Số tiền" DataField="AMOUNT" meta:resourcekey="BoundFieldResource4" SortExpression="AMOUNT">
                            <ItemStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="T&#236;nh trạng" DataField="TRX_STATUS" meta:resourcekey="BoundFieldResource5" >
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Ng&#226;n h&#224;ng nhận" DataField="CI_CODE" meta:resourcekey="BoundFieldResource6" SortExpression="CI_CODE">
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <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="lblGrdMsgEmpty" runat="server" meta:resourcekey="lblGrdMsgEmptyResource1"></asp:Label>
                    </EmptyDataTemplate>
                </asp:GridView>
                <uc1:MessageBox ID="MessageBox1" runat="server"></uc1:MessageBox>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
