<% Option Explicit '*********************************************** ' 说明:37080308通讯录 ' 作者:gwd 2002-11-05 '*********************************************** %> <!--#include file="pub/funcxml.asp"--> <!--#include file="pub/constpub.asp"--> <!--#include file="pub/funcpub.asp"--> <!--#include file="pub/class/clsPerson.asp"--> <% Dim objXml, objPerson Dim strErr Set objXml = Server.CreateObject("MSXML2.DOMDocument") Set objPerson = New Cls_Person ' 生成Cls_Person对象 If Request.Form("btnOk") <> "" Then If LoadXmlDoc(objXml, C_XMLFILE, False, strErr) Then ' 装载XML文件 ' 给相应的属性赋值 objPerson.Name = CheckStrInput(Request.Form("txtName")) objPerson.Nick = CheckStrInput(Request.Form("txtNick")) objPerson.Mobile = CheckStrInput(Request.Form("txtMobile")) objPerson.Tel = CheckStrInput(Request.Form("txtTel")) objPerson.Email = CheckStrInput(Request.Form("txtEmail")) objPerson.QQ = CheckStrInput(Request.Form("txtQQ")) objPerson.Company = CheckStrInput(Request.Form("txtCompany")) If Not objPerson.AddToXml(objXml) Then ' 调用Cls_Person类的AddToXml方法,添加数据 AddErr strErr, objPerson.GetLastError Else AddErr strErr, "添加成功" Response.Write "<script language=""javascript"">opener.location.reload();</script>" End If End If End If Set objXml = Nothing %> <HTML> <HEAD> <TITLE><% = C_TITLE %></TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=GB2312"/> <link rel="stylesheet" href="contact.css" type="text/css"> <script language="javascript"> <!-- function CheckForm() { return true; } //--> </script> </HEAD> <BODY> <% = strErr %> <div class="title">添加联系信息</div> <form name="form1" method="post" action="add.asp" onsubmit="return CheckForm()"> <table align="center" width="100%" cellspacing="1" cellpadding="2" border="0" bgcolor="#666600"> <tr bgcolor="#ffffff"> <td width="25%" bgcolor="#e5e5e5" align="right"><b>姓名:</b></td> <td width="75%"><input type="text" name="txtName" size="25" class="input" value="<%=CheckStrOutput(objPerson.Name)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>英文名:</b></td> <td><input type="text" name="txtNick" size="25" class="input" value="<%=CheckStrOutput(objPerson.Nick)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>手机:</b></td> <td><input type="text" name="txtMobile" size="25" class="input" value="<%=CheckStrOutput(objPerson.Mobile)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>电话:</b></td> <td><input type="text" name="txtTel" size="25" class="input" value="<%=CheckStrOutput(objPerson.Tel)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>Email:</b></td> <td><input type="text" name="txtEmail" size="25" class="input" value="<%=CheckStrOutput(objPerson.Email)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>QQ:</b></td> <td><input type="text" name="txtQQ" size="25" class="input" value="<%=CheckStrOutput(objPerson.QQ)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>所在公司:</b></td> <td><input type="text" name="txtCompany" size="25" class="input" value="<%=CheckStrOutput(objPerson.Company)%>"></td> </tr> </table> <br> <div align="center"> <input type="submit" name="btnOk" value="提交"> <input type="button" name="btnClose" value="关闭" onclick="javascript:return window.close();"> </div> </form> </BODY> </HTML> <% Set objPerson = Nothing %> |