<%@ Page language="c#" Codebehind="MyRefund.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.MyRefund" ValidateRequest="false" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="MemberMenu" Src="Modules/MemberMenu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!--#include file="../../inc/encoding.inc"-->
		<title>退款申请</title>
		<!--#include file="../../inc/head.inc"-->
	    <script src="inc/jquery.validate.js" type="text/javascript"></script>
	    <script src="inc/messages_cn.js" type="text/javascript"></script>
	    <link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/member.css" rel="stylesheet" type="text/css"/>
		<script type="text/javascript">
		    $(document).ready(function(){
		        $('#btnSubmit').click(function(){
		        });
                HideBankInfo();
                $('[@name=rblRefundType][@value=2]').click(function(){
                    $('.bankInfo').show();
                })
                $('[@name=rblRefundType][@value!=2]').click(function(){
                    HideBankInfo();
                }) 		        

                function HideBankInfo(){
                    $('.bankInfo').hide();
                    $('#txtBankName').val('');
                    $('#txtBankAccount').val('');
                    $('#txtAccountName').val('');
                }
                
                $("#Form1").validate({
		            event: "keyup",
		            rules: {
			            txtOrderNo: {
				            required:true,
				            maxlength:200
			            },
		                txtApplicant: {
			                required:true,
				            maxlength:50
                        },
                        txtBankName: {
			                required:function(){
                                if($('#txtBankName').parent().parent().is(":hidden"))
                                return false
                                else
                                return true
				             },
				            maxlength:50
                        },
	                    txtBankAccount: {
			                required:function(){
                                if($('#txtBankAccount').parent().parent().is(":hidden"))
                                return false
                                else
                                return true
				             },
				            maxlength:50
				         
                        },
			            txtBankAccount2: {
			                required:function(){
                                if($('#txtBankAccount2').parent().parent().is(":hidden"))
                                return false
                                else
                                return true
				             },
				            maxlength:50,
				            equalTo:"#txtBankAccount"
                        },
                        txtAccountName: {
			                required:function(){
                                if($('#txtAccountName').parent().parent().is(":hidden"))
                                return false
                                else
                                return true
				             },
				            maxlength:50
                        }                                                
		            },		
		            messages: {
			            txtOrderNo: {
				            required: "退款的订单编号必填",
				            maxlength: "最大长度只能在(20个字符)以内"
				            
			            },
			            txtApplicant: {
				            required: "申请人必填",
				            maxlength: "最大长度只能在(50个字符)以内"
				            
			            },
			            txtBankName: {
                            required: "退款银行必填",
				            maxlength: "最大长度只能在(50个字符)以内"
			            },
			            txtBankAccount: {
                            required: "退款银行账户必填",
				            maxlength: "最大长度只能在(50个字符)以内"
			            },
                        txtBankAccount2: {
                            required: "再次输入银行账户",
				            maxlength: "最大长度只能在(50个字符)以内",
				            equalTo:"两次输入的账号名不同"
			            },
			            txtAccountName: {
                            required: "退款银行账户名必填",
				            maxlength: "最大长度只能在(50个字符)以内"
			            }		            
		            },	            
		            debug:"false",
		            submitHandler:function(form){
			            form.submit();
		            }
	            });             
		    });                
	    
		</script>
		
		<style type="text/css">
		    table{border:1px #e6e6e6 solid;}
		    .table tr td{ text-align:left; font-size:12px; padding-left:10px; padding-bottom:5px; padding-top:5px; border-bottom:1px #e6e6e6 dotted;}
		    .table .left{width:15%;text-align:right}
		</style>
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-qgw clear">
		    <!--位置导航开始-->
            <div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<a href="<%=webSite %>Center.<%=config.html %>"><%=GetResourceString("MemberCenter")%></a>&nbsp;&gt;&nbsp;退款申请</div>
            <!--位置导航结束-->
			<div class="member_left">
				<!--会员中心导航开始-->
				<uc1:MemberMenu id="MemberMenu1" runat="server"></uc1:MemberMenu>
				<!--会员中心导航结束-->
			</div>
			<div class="member_middle_right">
			    <form id="Form1" method="post" runat="server">
				    <div class="mframe">
			            <div class="tl"></div>
			            <div class="tr"></div>
			            <div class="tm">我的退款 </div>
			            <div class="ml"></div>
			            <div class="mr"></div>
			            <div class="mm">
	                        <asp:datagrid id="dgList" CssClass="dgborder" runat="server"
						        AutoGenerateColumns="False" DataKeyField="aid" Width="100%" HorizontalAlign="Center" BorderWidth="1"
						        BorderColor="#d6d6d6">
						        <ItemStyle BackColor="White"></ItemStyle>
			                    <HeaderStyle BackColor="#fff7d3" Height="20px"></HeaderStyle>
						        <Columns>
						            <asp:TemplateColumn HeaderText="退款方式">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
								        <ItemTemplate>
										        <%# (byte)DataBinder.Eval(Container.DataItem, "refundtype") == 1 ? "退款至账户余额" : "退款至银行卡"%>
								        </ItemTemplate>
							        </asp:TemplateColumn>
							        <asp:TemplateColumn HeaderText="退款金额">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
								        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "refundmoney")%>
								        </ItemTemplate>
							        </asp:TemplateColumn>
							        <asp:TemplateColumn HeaderText="涉及订单">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
								        <ItemTemplate>
										        <%#DataBinder.Eval(Container.DataItem,"OrderNo")%>
								        </ItemTemplate>
							        </asp:TemplateColumn>
							        <asp:BoundColumn DataField="AddTime" HeaderText="申请时间" DataFormatString="{0:yyyy-MM-dd}">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center" Width="15%"></ItemStyle>
							        </asp:BoundColumn>
							        <asp:TemplateColumn HeaderText="处理状态">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center"></ItemStyle>
								        <ItemTemplate>
                                                 <%# GetStatus((int)DataBinder.Eval(Container.DataItem, "IsConfirm"), (bool)DataBinder.Eval(Container.DataItem, "isrefunded"), (bool)DataBinder.Eval(Container.DataItem, "canrefund"))%>
								        </ItemTemplate>
							        </asp:TemplateColumn>
							        <asp:TemplateColumn HeaderText="操作">
								        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								        <ItemStyle HorizontalAlign="Center"></ItemStyle>
								        <ItemTemplate>
									        <a href='MyRefundDetail-<%# DataBinder.Eval(Container.DataItem, "Ano") %>.<%=config.html%>'>查看</a>
								        </ItemTemplate>
							        </asp:TemplateColumn>
						        </Columns>
					        </asp:datagrid>
	                        
	                        <h3 style="padding:10px 0px 0px">退款申请</h3>
				            <hr class="itemhr" />
		                    <table class="table" cellpadding="0" cellspacing="0" border="0" width="100%" >
		                        <tr>
						            <td colspan=2 style="background:#fff7d3; font-weight:bold;">填写申请表</td>
						        </tr>
		                        <tr>
			                        <td class="left required"><em>*</em>订单号码：</td>
			                        <td><asp:TextBox Runat="server" ID="txtOrderNo" Text=""></asp:TextBox>(请输入产生退款的订单号,一次退款申请只能输入一个订单号)
			                        </td>
		                        </tr>
		                        <tr>
			                        <td class="left"><em>*</em>申请人：</td>
                                    <td><asp:TextBox Runat="server" ID="txtApplicant"></asp:TextBox></td>
		                        </tr>		      
		                        <tr>
			                        <td class="left" valign="top">退款方式：</td>
                                     <td>
                                        <asp:RadioButtonList id="rblRefundType" runat="server" RepeatDirection="vertical" RepeatLayout="flow">
					                        <asp:ListItem Value="1" Selected="True">退款至账户余额（推荐，不会收取手续费） </asp:ListItem>
					                        <asp:ListItem Value="2">退款至银行卡（跨行退款需要扣除一定积分用以支付银行手续费）</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
		                        </tr>
		                        <tr class="bankInfo" >
			                        <td class="left"><em>*</em>开 户 行：</td><td><asp:TextBox id="txtBankName" runat="server" ></asp:TextBox></td>
		                        </tr>
		                        <tr class="bankInfo">
			                        <td class="left"><em>*</em>开户人姓名：</td><td><asp:TextBox id="txtAccountName" runat="server"  ></asp:TextBox></td>
		                        </tr>	
                                <tr class="bankInfo">
			                        <td class="left" valign="top"><em>*</em>开户银行账号：</td><td><asp:TextBox id="txtBankAccount" runat="server" ></asp:TextBox><br /><font color="#ff6600">特别提醒：请确认开户人姓名及银行帐号填写正确，否则您的退款资金将有可能无法按时到帐。</font></td>
		                        </tr>
		                        <tr class="bankInfo">
			                        <td class="left"><em>*</em>再次输入账号：</td><td><asp:TextBox id="txtBankAccount2" runat="server" ></asp:TextBox></td>
		                        </tr>

		                        <tr>
			                        <td class="left">申请原因：</td><td><asp:TextBox id="txtReason" runat="server" Columns="50" Rows="5" TextMode="multiLine"></asp:TextBox></td>
		                        </tr>
		                        <tr>
		                            <td></td>
			                        <td colspan="2" style="border-bottom-width:0px">
				                        <asp:Button id="btnSubmit" OnClick="btnSubmit_Click" runat="server" Text="提交"></asp:Button>
				                    </td>
		                        </tr>
	                        </table>
						</div>
			            <div class="bl"></div>
			            <div class="br"></div>
			            <div class="bm"></div>
			        </div>
					  
				</form>
			</div>
			<div style="clear:both;"></div>
		</div>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
	</body>
</html>
