<!--#include file="../../Conn.asp" -->
<!--#include file="../../Comm/Site_Class.asp" -->
<%
PagePath = "../../"

Set Qsite = New Site_Class

Qsite.SiteConfig_Master()
%>
<!--#include file="../Check_Login.asp" -->
<%
Qsite.Check_AdminFlag(arrAdminFlag(1 , 3))

Dim Rs,i
Dim WorkExpId
Dim WorkExpBeginDate,WorkExpEndDate,WorkExpCompanyName,WorkExpCompanyNature,WorkExpCompanyIndustry
Dim WorkExpPost,WorkExpJobs,WorkExpNote,WorkExpLeave

Set Rs = server.CreateObject("ADODB.recordset")

If Request.Form <> "" Then
	WorkExpId = Qsite.chgStr(Trim(Request.Form("WorkExpId")))
	WorkExpBeginDate = Qsite.chgStr(Trim(Request.Form("WorkExpBeginDate")))
	WorkExpEndDate = Qsite.chgStr(Trim(Request.Form("WorkExpEndDate")))
	WorkExpCompanyName = Qsite.chgStr(Trim(Request.Form("WorkExpCompanyName")))
	WorkExpCompanyNature = Qsite.chgStr(Trim(Request.Form("WorkExpCompanyNature")))
	WorkExpCompanyIndustry = Qsite.chgStr(Trim(Request.Form("WorkExpCompanyIndustry")))
	WorkExpPost = Qsite.chgStr(Trim(Request.Form("WorkExpPost")))
	WorkExpJobs = Qsite.chgStr(Trim(Request.Form("WorkExpJobs")))
	WorkExpNote = Qsite.chgStr(Trim(Request.Form("WorkExpNote")))
	WorkExpLeave = Qsite.chgStr(Trim(Request.Form("WorkExpLeave")))
	
	If WorkExpId = "" Or IsNull(WorkExpId) Or Not IsNumeric(WorkExpId) Then WorkExpId = 0
	
	If WorkExpBeginDate = "" Or IsNull(WorkExpBeginDate) Then
		Qsite.ShowMsg "请输入开始时间" , ""
	End If
	If WorkExpEndDate = "" Or IsNull(WorkExpEndDate) Then WorkExpEndDate = "至今"
	If WorkExpCompanyName = "" Or IsNull(WorkExpCompanyName) Then
		Qsite.ShowMsg "请输入公司名称" , ""
	End If
	If WorkExpCompanyNature = "" Or IsNull(WorkExpCompanyNature) Then
		Qsite.ShowMsg "请选择公司性质" , ""
	End If
	If WorkExpCompanyIndustry = "" Or IsNull(WorkExpCompanyIndustry) Then
		Qsite.ShowMsg "请选择所属行业" , ""
	End If
	If WorkExpPost = "" Or IsNull(WorkExpPost) Then 
		Qsite.ShowMsg "请输入所在部门" , ""
	End If
	If WorkExpJobs = "" Or IsNull(WorkExpJobs) Then
		Qsite.ShowMsg "请输入职位名称" , ""
	End If
	
	Conn.Execute("update WorkExpTbl set WorkExpBeginDate = '"& WorkExpBeginDate &"' , WorkExpEndDate = '"& WorkExpEndDate &"' , WorkExpCompanyName = '"& WorkExpCompanyName &"' , WorkExpCompanyNature = '"& WorkExpCompanyNature &"' , WorkExpCompanyIndustry = '"& WorkExpCompanyIndustry &"' , WorkExpPost = '"& WorkExpPost &"' , WorkExpJobs = '"& WorkExpJobs &"' , WorkExpNote = '"& WorkExpNote &"' , WorkExpLeave = '"& WorkExpLeave &"' where WorkExpId = "& WorkExpId)
	
	
	Response.Write("<script language=""javascript"">alert(""修改成功"");opener.location.reload();window.close();</script>")
	Response.End()
	
End If

WorkExpId = Qsite.chgStr(Trim(Request.QueryString("WorkExpId")))

If WorkExpId = "" Or IsNull(WorkExpId) Or Not IsNumeric(WorkExpId) Then WorkExpId = 0

If WorkExpId = 0 Then
	Response.Write("非法参数")
	Response.End()
End If

Rs.Open "select * from WorkExpTbl where WorkExpId = "& WorkExpId , Conn , 1 , 1
If Rs.Eof Then
	WorkExpBeginDate = ""
	WorkExpEndDate = ""
	WorkExpCompanyName = ""
	WorkExpCompanyNature = ""
	WorkExpCompanyIndustry = ""
	WorkExpPost = ""
	WorkExpJobs = ""
	WorkExpNote = ""
	WorkExpLeave = ""
Else
	WorkExpBeginDate = Rs("WorkExpBeginDate")
	WorkExpEndDate = Rs("WorkExpEndDate")
	WorkExpCompanyName = Rs("WorkExpCompanyName")
	WorkExpCompanyNature = Rs("WorkExpCompanyNature")
	WorkExpCompanyIndustry = Rs("WorkExpCompanyIndustry")
	WorkExpPost = Rs("WorkExpPost")
	WorkExpJobs = Rs("WorkExpJobs")
	WorkExpNote = Rs("WorkExpNote")
	WorkExpLeave = Rs("WorkExpLeave")
End If
Rs.Close
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>工作经历修改</title>
<link href="../skins/css/main.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../Comm/Comm.js"></script>
<script language="javascript">
	function CheckForm()
	{
		if(!checkLength("WorkExpBeginDate" , "开始时间" , 1 , 20))
			return false;
		if(!checkLength("WorkExpEndDate" , "结束时间" , 0 , 20))
			return false;
		if(!checkLength("WorkExpCompanyName" , "公司名称" , 1 , 100))
			return false;
		if(PerForm.WorkExpCompanyNature.value == "")
		{
			alert("请选择公司性质");
			return false;
		}
		if(PerForm.WorkExpCompanyIndustry.value == "")
		{
			alert("请选择所属行业");
			return false;
		}
		if(!checkLength("WorkExpPost" , "所在部门" , 1 , 50))
			return false;
		if(!checkLength("WorkExpJobs" , "职位名称" , 1 , 50))
			return false;
		if(!checkLength("WorkExpNote" , "工作描述" , 0 , 1000))
			return false;
		if(!checkLength("WorkExpLeave" , "离职原因" , 1 , 100))
			return false;
		return true;
	}
</script>
</head>

<body>
<form name="MemForm" method="post" action="Person_EditWorkExp.asp" style="margin:0" onSubmit="return CheckForm();">
<table width="100%" border="0" cellspacing="1" cellpadding="5">
	<tr>
		<td height="25" colspan="2" class="td_title">工作经历修改
			<input name="WorkExpId" type="hidden" id="WorkExpId" value="<%=WorkExpId%>"></td>
	</tr>
	<tr>
		<td width="25%" height="23" class="td_content">时间：</td>
		<td width="75%" class="td_content">从
											<input name="WorkExpBeginDate" type="text" class="input_1" id="WorkExpBeginDate" value="<%=WorkExpBeginDate%>" size="20" />
											到
											<input name="WorkExpEndDate" type="text" class="input_1" id="WorkExpEndDate" value="<%=WorkExpEndDate%>" size="20" /><br>
											(格式：2007-09，后面一项目不填表示至今)</td>
	</tr>
	<tr>
		<td height="23" class="td_content">公司名称：</td>
		<td class="td_content"><input name="WorkExpCompanyName" type="text" class="input_1" id="WorkExpCompanyName" value="<%=WorkExpCompanyName%>" size="50" /></td>
	</tr>
	<tr>
		<td height="23" class="td_content">公司性质：</td>
		<td class="td_content"><select name="WorkExpCompanyNature" class="input_1" id="WorkExpCompanyNature">
											<option value="" <%If WorkExpCompanyNature = "" Then Response.Write("selected")%>>--请选择--</option>
											<%
						Rs.Open "select * from CompanyNatureTbl order by CompanyNatureId asc" , Conn , 1 , 1
						Do While Not Rs.Eof
							Response.Write("<option value="""& Rs("CompanyNatureName") &""" ")
							If Rs("CompanyNatureName") = WorkExpCompanyNature Then Response.Write("selected")
							Response.Write(">"& Rs("CompanyNatureName") &"</option>")
						Rs.MoveNext
						Loop
						Rs.Close
						%>
										</select></td>
	</tr>
	<tr>
		<td height="23" class="td_content">所属行业：</td>
		<td class="td_content"><select name="WorkExpCompanyIndustry" class="input_1" id="WorkExpCompanyIndustry">
											<option value="" selected>--请选择--</option>
											<%
						Rs.Open "select * from PositionTbl where PositionKey = 0 order by PositionId asc" , Conn , 1 , 1
						Do While Not Rs.Eof
							Response.Write("<option value="""& Rs("PositionName") &""" ")
							If Cstr(Rs("PositionName")) = Cstr(WorkExpCompanyIndustry) Then Response.Write("selected")
							Response.Write(">"& Rs("PositionName") &"</option>")
						Rs.MoveNext
						Loop
						Rs.Close
						%>
										</select></td>
	</tr>
	<tr>
		<td height="23" class="td_content">所在部门：</td>
		<td class="td_content"><input name="WorkExpPost" type="text" class="input_1" id="WorkExpPost" value="<%=WorkExpPost%>" size="30" /></td>
	</tr>
	<tr>
		<td height="23" class="td_content">职位名称：</td>
		<td class="td_content"><input name="WorkExpJobs" type="text" class="input_1" id="WorkExpJobs" value="<%=WorkExpJobs%>" size="30" /></td>
	</tr>
	<tr>
		<td height="23" class="td_content">工作描述：</td>
		<td class="td_content"><textarea name="WorkExpNote" cols="50" rows="8" class="input_1"><%=WorkExpNote%></textarea></td>
	</tr>
	<tr>
		<td height="23" class="td_content">离职原因：</td>
		<td class="td_content"><input name="WorkExpLeave" type="text" class="input_1" id="WorkExpLeave" value="<%=WorkExpLeave%>" size="30" /></td>
	</tr>
	<tr>
		<td height="23" class="td_content">&nbsp;</td>
		<td class="td_content"><input name="Submit" type="submit" class="input_1" value=" 确  定 "> <input name="Submit" type="button" class="input_1" value=" 关  闭 " onClick="javascript:window.close();"></td>
	</tr>
</table>
</form>
</body>
</html>
