<% Option Explicit %>
<!--#include file="../../../FS_Inc/Const.asp" -->
<!--#include file="../../../FS_Inc/Function.asp"-->
<!--#include file="../../../FS_InterFace/MF_Function.asp" -->
<!--#include file="../../../FS_InterFace/MS_Function.asp" -->
<%
	Dim Conn,strShowErr
	MF_Default_Conn
	'session判断
	MF_Session_TF 
	if not MF_Check_Pop_TF("MS_Param") then Err_Show
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>邮寄资料</title>
<link href="../../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript" src="../lib/UserJS.js" type="text/JavaScript"></script>

<body>
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  <tr class="hback"> 
    <td class="xingmu">栏目管理<a href="../../../help?Lable=NS_Class_add" target="_blank" style="cursor:help;'" class="sd"><img src="../../Images/_help.gif" width="50" height="17" border="0"></a></td>
  </tr>
  <tr> 
    <td height="18" class="hback"><div align="left"><a href="Help_Mail_Infor.asp">管理首页</a> 
        | <a href="../Sys_Para_Set.asp">参数设置</a> | &nbsp;<a href="Help_Mail_Infor.asp">邮寄资料</a> |&nbsp;<a href="Help_Express_Infor.asp">配送须知</a> 
        | <a href="Help_Bank_Infor.asp">银行资料</a> | <a href="../../help?Lable=MS_Help_Mail_Infor" target="_blank" style="cursor:help;'" class="sd"><img src="../../Images/_help.gif" width="50" height="17" border="0"></a></div></td>
  </tr>
</table>
<table width="98%" height="189" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  <form name="form1" method="post" action="">
    <%
   Dim obj_mail_rs,str_Address,str_PostCode,lng_id,str_UserName
	Set obj_mail_rs = server.CreateObject(G_FS_RS)
	obj_mail_rs.open "select top 1 Address,PostCode,id,UserName From FS_MS_PayMethod",Conn,1,1
	if not obj_mail_rs.eof then
		str_Address = obj_mail_rs(0)
		str_PostCode = obj_mail_rs(1)
		lng_id =  obj_mail_rs(2)
		str_UserName =  obj_mail_rs(3)
	Else
		str_Address = ""
		str_PostCode = ""
		lng_id = ""
		str_UserName = ""
	End if
	obj_mail_rs.close:set obj_mail_rs = nothing
  %>
    <tr> 
      <td height="23" colspan="2" class="xingmu">邮寄资料</td>
    </tr>
    <tr class="hback"> 
      <td width="15%" height="33" class="hback"> 
        <div align="right">地址</div></td>
      <td width="85%" class="hback"><input name="Address" type="text" id="Address" style="width:80%" value="<% = str_Address %>"><span id="Address_Alert"></span></td>

    </tr>
    <tr class="hback">
      <td height="42" class="hback"> 
        <div align="right">收件人</div></td>
      <td class="hback"><input name="UserName" type="text" id="UserName" style="width:80%" value="<% = str_UserName %>"><span id="UserName_Alert"></span></td>
    </tr>
    <tr class="hback"> 
      <td class="hback"><div align="right">邮政编码</div></td>
      <td class="hback"><input name="PostCode" type="text" id="PostCode" value="<% = str_PostCode %>" maxlength="6" onKeyUp="if(isNaN(value)||event.keyCode==32)execCommand('undo')"  onafterpaste="if(isNaN(value)||event.keyCode==32)execCommand('undo')">
      <span id="PostCode_Alert"></span></td>
    </tr>
    <tr class="hback"> 
      <td height="31" class="hback">
</td>
      <td class="hback"><input type="submit" name="Submit" value="更新邮寄资料"> <input type="reset" name="Submit2" value="重置"> 
        <input name="Action" type="hidden" id="Action" value="Save"> <input name="ID" type="hidden" id="ID" value="<%=lng_id%>"></td>
    </tr>
  </form>
</table>
</body>
</html>
<%
if Request.Form("Action") = "Save" then
	if Request.Form("Address") = "" or Request.Form("PostCode")="" or Request.Form("UserName")="" or len(Request.Form("UserName"))>20 then
		strShowErr = "<li>信息不完整，或你的收件人字数太长</li>"
		Response.Redirect("../lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
		Response.end
	Else
		IF Len(Trim(Request.Form("Address"))) >= 200 Then
			strShowErr = "<li>您输入的地址太长了</li>"
			Response.Redirect("../lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
			Response.end
		End If
		IF Len(Trim(Request.Form("PostCode"))) <> 6 Or Not IsNumeric(Trim(Request.Form("PostCode"))) Then
			strShowErr = "<li>您输入的邮政编码不合规范</li>"
			Response.Redirect("../lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
			Response.end
		End If
		if trim(lng_id) = "" then
			dim obj_mail_rs_1
			Set obj_mail_rs_1 = server.CreateObject(G_FS_RS)
			obj_mail_rs_1.open "select * From FS_MS_PayMethod",Conn,1,3
			obj_mail_rs_1.addnew
			obj_mail_rs_1("address") = NoSqlHack(Trim(Request.Form("Address")))
			obj_mail_rs_1("PostCode") = NoSqlHack(Trim(Request.Form("PostCode")))
			obj_mail_rs_1("UserName") = NoSqlHack(Trim(Request.Form("UserName")))
			obj_mail_rs_1.update
			obj_mail_rs_1.close:set obj_mail_rs_1 = nothing
		Else
			Conn.execute("Update FS_MS_PayMethod set address='"& NoSqlHack(Request.Form("Address")) &"',PostCode='"& NoSqlHack(Request.Form("PostCode")) &"',UserName='"& NoSqlHack(Request.Form("UserName")) &"'")
		End if
		strShowErr = "<li>更新邮寄资料成功</li>"
		Response.Redirect("../lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
		Response.end
	End if
End if
%>





