<%@ Page Language="C#" 
    EnableEventValidation = "false" 
    AutoEventWireup="true" 
    MasterPageFile="~/CITAD.Master" 
    CodeBehind="frmTrx_FR_C.aspx.cs" 
    Inherits="CITAD.Modules.TaoTraLoiYeuCauHoanChuyenDen.Web.frmTrx_FR_C" 
    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"  >
		function row_ondblclick(row)	    
	    {
	        location.href="frmFR_Create.aspx?strId=" + row.msg_key;
	    }
        function fcnShowO_CI_List(txtci_id)
        {
            var strFeatureMDlg = "dialogHeight:400px;center:yes;dialogWidth:610px;resizable:yes;status:no;scroll:no;";
            if (event.keyCode==115) //F4
            {
                if(!document.getElementById(txtci_id).readOnly)
                {
                    rValue = window.showModalDialog('../DanhSachNganHang/frmCIList.aspx' + '?randomNumber=' + Math.random(),"",strFeatureMDlg);
                    if(rValue!=undefined) 
                    {
                        document.getElementById(txtci_id).value = rValue;
                        __doPostBack(txtci_id,'');
                    }
                }
                event.keyCode=9;
            }
        }
//			function CheckAll(chkBox)
//			{
//				if (chkBox.checked)
//				{
//					for (var i = 0; i < chkBox.form.length; ++i) 
//					{
//						var elem = chkBox.form.elements[i];
//						if (elem.type == 'checkbox')
//						{
//							if (elem.id.indexOf('chk') != -1)
//							{
//									if(!elem.checked)
//									elem.checked = true;
//							}
//						}
//					}		
//				}
//				else
//				{
//					for (var i = 0; i < chkBox.form.length; ++i) 
//					{
//						var elem = chkBox.form.elements[i];
//						if (elem.type == 'checkbox')
//						{
//							if (elem.id.indexOf('chk') != -1)
//							{
//								if(elem.checked)
//								elem.checked = false;
//							}
//						}
//					}						
//				}				
//			}
			
</script>
<script language ="javascript" type ="text/javascript" >
window.document.onkeydown=KeyDown;
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
                if(event.ctrlKey)
                {
//                    if(window.event.keyCode==69)
//                    {
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuClose');
//                    }
//                    if(window.event.keyCode==49)
//                    {
//                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuAdd');
//                    }
                    if(window.event.keyCode==50)
                    {
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuOpen');
                    }
                    if(window.event.keyCode==52)
                    {
                        __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuIquiry');
                    }
                }
                //alert(event.keyCode);
                
                 if(event.keyCode == 13)
                    {    
                        var tablet = document.getElementById('eventSRC');                
                        if(tablet.contains(event.srcElement)){
                            __doPostBack('ctl00$ContentPlaceHolder1$Menu1','mnuQuery');                    
                        }                
                      }	
 
        }
    </script>
      <script language="javascript" type="text/javascript" >
            window.onload = function()
            {
                try
                {
                    document.getElementById('<%=txtSerial_No.ClientID%>').focus();
                }
                catch(e){}
            }
    </script>
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="True"  EnableScriptLocalization="True" ID="ScriptManager1" CombineScripts="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" DynamicHorizontalOffset="2" 
                                Font-Names="Verdana"
                                Font-Size="11px"
                                OnMenuItemClick="Menu1_MenuItemClick"
                                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" meta:resourcekey="MenuItemResource1" NavigateUrl="~/Default.aspx" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif"   ></asp:MenuItem>
                                    <asp:MenuItem Text="Chọn mở" Value="mnuOpen" meta:resourcekey="MenuItemResource2" SeparatorImageUrl="~/Images/toolbar/citad-toolbar-sperator.gif" ImageUrl="~/Images/Menu/open.gif" ></asp:MenuItem>
                                    <asp:MenuItem Text="Truy vấn" Value="mnuIquiry" meta:resourcekey="MenuItemResource4" ImageUrl="~/Images/Menu/search.gif"></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 id="eventSRC" width ="770px" border ="0" cellpadding ="0" cellspacing="0" >
                   
                    <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">
                                    <tr>
                                        <td style="width: 83px; height: 22px;" align="right">
                                            <asp:Label ID="lblSerial_No" runat="server"  Width="96px" meta:resourcekey="lblSerial_NoResource1" Text="Số hiệu giao dịch"></asp:Label></td>
                                        <td style="width: 190px; height: 22px;">
                                            &nbsp;<asp:TextBox ID="txtSerial_No" runat="server" CssClass="citad-txt" meta:resourcekey="txtSerial_NoResource1" Width="98px" TabIndex="1" ></asp:TextBox></td>
                                        <td style="width: 97px; height: 22px;" align="right">
                                            <asp:Label ID="lblSendingBank" runat="server"  Text="Ngân hàng gửi" Width="98px" meta:resourcekey="lblSendingBankResource1"></asp:Label></td>
                                        <td colspan="1" style="height: 22px">
                                            &nbsp;<asp:TextBox ID="txtSendingBank" runat="server" CssClass="citad-txt" meta:resourcekey="txtSendingBankResource1" Width="85px" TabIndex="2" ></asp:TextBox></td>
                                        <td colspan="1" align="right" style="height: 22px">
                                            <asp:CheckBox ID="chTRX_Date" runat="server" Text="Ngày tạo" Width="121px" meta:resourcekey="chTRX_DateResource1" AutoPostBack="True" OnCheckedChanged="chTRX_Date_CheckedChanged" /></td>
                                        <td colspan="3" style="height: 22px">
                                            &nbsp;<asp:TextBox ID="txtTRX_Date" runat="server" CssClass="citad-txt" meta:resourcekey="TextBox1Resource1"
                                                Width="81px" TabIndex="3"></asp:TextBox>
                                            <asp:ImageButton ID="imgCalendar" runat="server" ImageUrl="~/Images/Calendar.png"
                                                meta:resourcekey="imgCalendarResource1" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="height: 44px" 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" TabIndex="4" />
                                                <asp:RadioButton ID="rdbHV" runat="server" GroupName="TrxType"
                                                    Text="Giá trị cao" CssClass="citad-RadioButton" meta:resourcekey="rdbHVResource1" TabIndex="5" />
                                                <asp:RadioButton ID="rdbAll" runat="server" Checked="True" GroupName="TrxType"
                                                     Text="Tất cả" CssClass="citad-RadioButton" meta:resourcekey="rdbAllResource1" TabIndex="6" />
                                            </fieldset>
                                        </td>
                                        <td style="width: 97px; height: 44px" valign="middle" align="right">
                                            <asp:Label ID="lblTrxStatus" runat="server" meta:resourcekey="lblTrxStatusResource1">Trạng thái</asp:Label></td>
                                        <td colspan="2" style="height: 44px" valign="middle">
                                            &nbsp;<asp:DropDownList ID="cboTrx_Status" runat="server" 
                                                Width="98%" meta:resourcekey="cboTrx_StatusResource1" TabIndex="7">
                                            </asp:DropDownList></td>
                                        <td style="width: 125px; height: 44px" valign="middle">
                                            </td>
                                    </tr>
                                </table>
                            </fieldset>
                            </td>
                    </tr>
                </table>
                <div>
                    <table width="100%">
                        <tr>
                            <td align="right">
                                <asp:Label ID="lblTongSo" runat="server" meta:resourcekey="lblTongSoResource1" Text="Tổng số"></asp:Label>
                                <asp:Label ID="lblCount" runat="server"></asp:Label></td>
                        </tr>
                    </table>
                    <asp:GridView ID="grvListTrx" CellPadding="2" 
                        CssClass="grid" runat="server" 
                        AutoGenerateColumns="False"  
                        DataKeyNames ="MSG_KEY" 
                        AllowPaging="True" 
                        Style="width: 100%" 
                        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="TemplateFieldResource4"    >
                                        <HeaderTemplate>                                            
                                            <asp:LinkButton runat="server" ID="lblSerial_No" Text="Số hiệu giao dịch" CommandName="Sort" CommandArgument="FR.SERIAL_NO" meta:resourcekey="lblSerial_NoResource2" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbtRELATION_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="TemplateFieldResource7"   >
                                        <HeaderTemplate>                                            
                                             <asp:LinkButton runat="server" ID="lblTrx_Amount" 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="lblO_CI_CODE" Text="Ngân hàng gửi" CommandName="Sort" CommandArgument="CI_CODE" meta:resourcekey="lblO_CI_CODEResource1" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <%# Eval("CI_CODE")%>
                                        </ItemTemplate> 
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    
                                </Columns>
                                
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblGrdMessage" meta:resourcekey="lblGrdMessageResource1" Text ="Kh&#244;ng c&#243; bản ghi n&#224;o " runat ="server" ></asp:Label>
                                </EmptyDataTemplate>
                            </asp:GridView>
                 <uc1:MessageBox ID="MessageBox1" runat="server" />
                 <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" Format="dd/MM/yyyy"
                        TargetControlID="txtTRX_Date" PopupButtonID="imgCalendar">
                </cc1:CalendarExtender>
                <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Enabled="True"
                    Mask="99/99/9999" MaskType="Date" TargetControlID="txtTRX_Date">
                </ajaxToolkit:MaskedEditExtender>
                </div>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID ="Menu1" EventName ="MenuItemClick" />
    </Triggers>  
</asp:UpdatePanel>
</asp:Content>