📄 empladd.aspx
字号:
<%@ Page Language="VB" ContentType="text/html" debug="true" %>
<%@ Import Namespace="system.data" %>
<%@ Import Namespace="system.data.oledb" %>
<!--#include file="../../webmaster/ckqx.aspx" -->
<html>
<head>
<title>员工信息添加</title>
<link href="../../CSS.CSS" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC">
<form runat="server" enctype="multipart/form-data">
<table width="549" height="22" border="0" cellpadding="0" cellspacing="0" background="../../pic/002.png">
<tr>
<td><font color="#FFFFFF"><strong> 员工信息添加</strong></font></td>
</tr>
</table>
<table width="549" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="163" height="25" align="right"><font color="#000000">姓名:</font></td>
<td width="386" height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zname" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zname" Display="Dynamic" ErrorMessage="姓名" ID="rname" runat="server" Text="*" /> </font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">出生年月:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zbirthday" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zbirthday" Display="Dynamic" ErrorMessage="出生年月" ID="rbirthday" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">性别:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zsex" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zsex" Display="Dynamic" ErrorMessage="性别" ID="rsex" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">民族:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="znation" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="znation" Display="Dynamic" ErrorMessage="民族" ID="rnation" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">工作时间:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zworktime" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zworktime" Display="Dynamic" ErrorMessage="工作时间" ID="rworktime" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">政治面貌:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zpolitics" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zpolitics" Display="Dynamic" ErrorMessage="政治面貌" ID="rpolitics" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">家庭住址:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zhomeaddress" runat="server" TextMode="SingleLine" Columns="50" />
<asp:requiredfieldvalidator ControlToValidate="zhomeaddress" Display="Dynamic" ErrorMessage="家庭住址" ID="rhomeaddress" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">联系电话:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="ztelephone" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="ztelephone" Display="Dynamic" ErrorMessage="联系电话" ID="rtelephone" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">婚姻状况:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zmarriage" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zmarriage" Display="Dynamic" ErrorMessage="婚姻状况" ID="rmarrige" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">学历:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zeducation" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zeducation" Display="Dynamic" ErrorMessage="学历" ID="reducation" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">所学专业:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zspecialty" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zspecialty" Display="Dynamic" ErrorMessage="所学专业" ID="rspecialty" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">工作部门:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zbranch" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zbranch" Display="Dynamic" ErrorMessage="工作部门" ID="rbranch" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">职务:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zbusiness" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zbusiness" Display="Dynamic" ErrorMessage="职务" ID="rbusiness" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">工种:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zworktype" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="zworktype" Display="Dynamic" ErrorMessage="工种" ID="rworktype" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">技术职称:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="ztechnology" runat="server" TextMode="SingleLine" />
<asp:requiredfieldvalidator ControlToValidate="ztechnology" Display="Dynamic" ErrorMessage="技术职称" ID="rtechnology" runat="server" Text="*" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">计算机水平:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zcomputer" runat="server" TextMode="SingleLine" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">外文水平:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zlanguageS" runat="server" TextMode="SingleLine" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">爱好特长:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zcharacterS" runat="server" TextMode="SingleLine" Columns="50" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">备注:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" ID="zremark" runat="server" TextMode="SingleLine" Columns="50" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">个人简历:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" Columns="55" ID="zresume" Rows="6" runat="server" TextMode="MultiLine" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">家庭社会关系:</font></td>
<td height="25"><font color="#000000">
<asp:textbox BorderStyle="solid" BorderWidth="1" Font-Size="10" Columns="55" ID="zfamily" Rows="6" runat="server" TextMode="MultiLine" />
</font></td>
</tr>
<tr>
<td height="25" align="right"><font color="#000000">照片:</font></td>
<td height="25"><font color="#000000">
<input type="file" id="myfile" runat="server" size="50" style="border-width:1px;border-style:Solid;font-size:10pt;" name="file">
</font></td>
</tr>
<tr align="center">
<td height="25" colspan="2"><font color="#000000"> </font><font color="#000000">
<asp:button ID="zsave" runat="server" Font-Size="10" Text="确定添加" OnClick="zscsave" />
<asp:validationsummary HeaderText="请填入必填项目:" ID="rerror" runat="server" ShowMessageBox="true" ShowSummary="false" /> </font></td>
</tr>
</table>
</form>
</body>
</html>
<script language="VB" runat="server">
sub page_load(s as object,e as eventargs)
if not (checkqx("b")) then response.redirect("../../webmaster/error.aspx")
end sub
sub zscsave(s as object,e as eventargs)
dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("../../office.mdb"))
conn.open()
dim objcmd as new oledbcommand()
objcmd.connection=conn
objcmd.commandtext="insert into personinf (name,birthday,sex,nation,worktime,politics," & _
"homeaddress,telephone,marriage,education,specialty,branch,business," & _
"worktype,technology,computer,languageS,characterS,remark,resume,family,imageS)" & _
"values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
objcmd.parameters.add("@name",oledbtype.char).value=zname.text
objcmd.parameters.add("@birthday",oledbtype.char).value=zbirthday.text
objcmd.parameters.add("@sex",oledbtype.char).value=zsex.text
objcmd.parameters.add("@nation",oledbtype.char).value=znation.text
objcmd.parameters.add("@worktime",oledbtype.char).value=zworktime.text
objcmd.parameters.add("@politics",oledbtype.char).value=zpolitics.text
objcmd.parameters.add("@homeaddress",oledbtype.char).value=zhomeaddress.text
objcmd.parameters.add("@telephone",oledbtype.char).value=ztelephone.text
objcmd.parameters.add("@marriage",oledbtype.char).value=zmarriage.text
objcmd.parameters.add("@education",oledbtype.char).value=zeducation.text
objcmd.parameters.add("@specialty",oledbtype.char).value=zspecialty.text
objcmd.parameters.add("@branch",oledbtype.char).value=zbranch.text
objcmd.parameters.add("@business",oledbtype.char).value=zbusiness.text
objcmd.parameters.add("@worktype",oledbtype.char).value=zworktype.text
objcmd.parameters.add("@technology",oledbtype.char).value=ztechnology.text
objcmd.parameters.add("@computer",oledbtype.char).value=zcomputer.text
objcmd.parameters.add("@languageS",oledbtype.char).value=zlanguageS.text
objcmd.parameters.add("@characterS",oledbtype.char).value=zcharacterS.text
objcmd.parameters.add("@remark",oledbtype.char).value=zremark.text
objcmd.parameters.add("@resume",oledbtype.char).value=zresume.text
objcmd.parameters.add("@family",oledbtype.char).value=zfamily.text
if myfile.postedfile.contentlength<>0 then
dim lsfile as object
lsfile=myfile.postedfile
dim lsname() as string=split(lsfile.filename,".")
dim lsnm as string=lsname(lsname.length-1)
dim lstime=now()
dim lsyear,lsmonth,lsday,lshour,lsminute,lssecond,lsfilename as string
lsyear=year(lstime)
lsmonth=right("0" & month(lstime),2)
lsday=right("0" & day(lstime),2)
lshour=right("0" & hour(lstime),2)
lsminute=right("0" & minute(lstime),2)
lssecond=right("0" & second(lstime),2)
dim lsrd as string
randomize
lsrd=cstr(int(100*rnd())+1)
lsfilename=lsyear & lsmonth & lsday & lshour & lsminute & lssecond & "-" & lsrd & "." & lsnm
'得到以当前日期及时间为前缀的新文件名,只保留原文档的护展名(防止文件出现重名现象、防止中文文件名)
dim lspath as string
lspath=server.mappath(".") & "\photo\" & lsfilename
lsfile.saveas(lspath)
objcmd.parameters.add("@imageS",oledbtype.char).value=lsfilename
else
objcmd.parameters.add("@imageS",oledbtype.char).value=""
end if
objcmd.executenonquery()
conn.close()
response.redirect("../../webmaster/administrator.aspx")
end sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -