⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim ObjDB,StrSQL
Dim C
Dim IntID
Dim ObjRS

IntID = Request.QueryString("ID")
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
Set ObjRS = C.View("Select * From v_Hrms_Employees_UsersRemark Where ID = " & IntID)
	dim DutyClass,InState,AClass,AState,Username
	Username=ObjRS("UserName")
	Aclass=ObjRS("DutyClass")
	AState=ObjRS("InState")
	if ObjRS("DutyClass")= 1 then
		DutyClass="普通职务"	
	else if ObjRS("DutyClass")=2 then
				DutyClass="一级职务"
			else
				DutyClass="二级职务"
			end if
	end if
	if ObjRS("InState")= 1 then
		InState="试用在职"
	end if
	if ObjRS("InState")= 2 then
		InState="正式在职"
	end if
	if ObjRS("InState")= 3 then
		InState="正常离职"
	end if
	if ObjRS("InState")= 4 then
		InState="辞职"
	end if
	if ObjRS("InState")= 5 then
		InState="辞退"
	end if
	if ObjRS("InState")= 6 then
		InState="除名"
	end if
	if ObjRS("InState")= 7 then
		InState="开除"
	end if


If Request.Form.Count > 0 Then
'档案是否在公司
if request("IsFilesIn")="" then 
	%>
	<script language=javascript>
		alert("档案是否在公司不能为空!");
		history.go(-1);
	</script>		
	<%
	response.End()
end if

'是否有担保
if request("IsAssure")="" then 
	%>
	<script language=javascript>
		alert("是否有担保不能为空!");
		history.go(-1);
	</script>		
	<%
	response.End()
end if

'合同签订类型
dim WorkTime
WorkTime=request("ContractType")
if not ISNumeric(WorkTime) then 
	%>
	<script language=javascript>
		alert("合同签订类型必须为数字!");
		history.go(-1);
	</script>		
	<%
		response.End()
	else if WorkTime<0 or WorkTime>=100 then
	 %>
	<script language=javascript>
		alert("合同签订类型必须为0到100的整数!");
		history.go(-1);
	</script>		
	<%
		response.End()
	end if
	
end if
	
	IntID = Request.Form("ID")
	Set ObjRS = Server.CreateObject("Adodb.Recordset")
	StrSQL = "Select * From t_Hrms_Employees_UsersRemark Where Id='"&IntID&"'"
	ObjRS.Open StrSQL,ObjDB,1,3
	ObjRS("InState")= Request("InState")
	ObjRS("DutyClass")= Request("DutyClass")
	ObjRS("FilesIn")= Request("IsFilesIn")
	ObjRS("Assure")= Request("IsAssure")
	ObjRS("ContractType")= Request("ContractType")
	if Request("InTime")<>"" then
	ObjRS.Fields("InTime")= Request("InTime")
	end if
	if Request("OfficialTime")<>"" then 
	ObjRS.Fields("OfficialTime")=Request("OfficialTime")
	end if
	if Request("ContractTime")<>"" then
	ObjRS.Fields("ContractTime")= Request("ContractTime")
	end if
	if Request("EndContractTime")<>"" then
	ObjRS.Fields("EndContractTime")= Request("EndContractTime")
	end if
	if Request("OutTime")<>"" then 
	ObjRS.Fields("OutTime")=Request("OutTime")
	end if
	ObjRS("Des")= Request("Des")
	ObjRS("FinalEditTime")= Now()
	ObjRS.Update
	IntID = ObjRS("ID")
	'添加员工绩效考评
	Dim PYear,PMonth,PAchivement
	
    PYear=Request("PYear")
	PMonth=Request("PMonth")
	PAchivement=Request("PAchivement")

    if PYear<>"" and  PMonth<>"" and PAchivement<>""then
	
	if not ISNumeric(PYear) then 
	 call MsgBox("年度必须是数字!","Back","none")
	 response.End()
	 else

	 if InStr(PYear, ".") >0  then
	         
		     call MsgBox("年度中含有非法字符!","Back","none")
	         response.End()
			 end if
	end if
	
	if not ISNumeric(PMonth) then 
	 call MsgBox("季度必须是数字!","Back","none")
	 response.End()
	 else
	 if InStr(PMonth,"." ) > 0  then
		     call MsgBox("季度中含有非法字符!","Back","none")
	         response.End()
			 end if
	end if
	
	IF  cint(PYear)<1  or  cint(PYear)>9999 THEN
		 call MsgBox("年度超出范围!","Back","none")
		 response.End()
 	END IF
	
	IF  cint(PMonth)<1  or  cint(PMonth)>4 THEN
		 call MsgBox("季度请填写1-4之间的数字!","Back","none")
		 response.End()
 	END IF
	
	     ObjDB.Execute("insert into t_Hrms_Employees_UserPerformance (PID,PBasicID,PYear,PMonth,PAchivement) values ('"&IntID&"','"&request("BasicID")&"','"&PYear&"','"&PMonth&"','"&PAchivement&"')")
    end if 
	'绩效结束
	
	
	dim BDutyClass,BInState,BClass,BState
	Bclass=ObjRS("DutyClass")
	BState=ObjRS("InState")
	if ObjRS("DutyClass")= 1 then
		BDutyClass="普通职务"	
	else if ObjRS("DutyClass")=2 then
				BDutyClass="一级职务"
			else
				BDutyClass="二级职务"
			end if
	end if
	if ObjRS("InState")= 1 then
		BInState="试用在职"
	end if
	if ObjRS("InState")= 2 then
		BInState="正式在职"
	end if
	if ObjRS("InState")= 3 then
		BInState="正常离职"
	end if
	if ObjRS("InState")= 4 then
		BInState="辞职"
	end if
	if ObjRS("InState")= 5 then
		BInState="辞退"
	end if
	if ObjRS("InState")= 6 then
		BInState="除名"
	end if
	if ObjRS("InState")= 7 then
		BInState="开除"
	end if
	
	
	'添加日志
	dim FirstMenu,SecondMenu,Opertion,OTime,OName,OIP,ODesc,OChange
	OIP=Request.ServerVariables("REMOTE_ADDR")
	OName= Session("AccountName")
	OChange="修改的员工"&Username
	if AClass<>BClass then
		OChange=OChange&"职务级别由"&DutyClass&"改为"&BDutyClass
	end if
	if AState<>BState then
		OChange=OChange&"在职状态由"&InState&"改为"&BInState
	end if
	if OName="administrator" then
	OName="系统管理员"
	end if
	call AddLog("员工管理","员工详细信息","修改",now(),OName ,OIP,"",OChange,ObjDB)
	
  	ObjDB.Close
 	Set ObjDB = Nothing
  	Response.Redirect "List.asp" 
	 
End If
 
ObjDB.Close
Set ObjDB = Nothing

Sub Main
%>
<script language="JavaScript" type="text/JavaScript">
function AddPerformance(IDs)
	{
		window.open("addperformance.asp?IDs="+IDs,"RoleWin","width=400,height=300,scrollbars=yes")
	}
</script>

<form action="" method="post" name=myform>
	<input type=hidden name=ID value="<%=Request.QueryString("ID")%>">
		<input type=hidden name=BasicID value="<%=ObjRS("BasicId")%>">

  <table width="100%" cellpadding=3 cellspacing=1 class=Ltable>
    <tr class=LHtr> 
      <td colspan="4">修改详细员工信息 </td>
    </tr>
    <tr class=Ltr> 
      <td width="13%">姓名:</td>
      <td width="30%" align="left"> 
        <input name="Name" type="text" class=Input value="<%=ObjRS("UserName")%>" readonly> 
      </td>
      <td width="18%">&nbsp;</td>
      <td width="54%">&nbsp;</td>
    </tr>
    <tr class=Ltr> 
      <td width="13%">在职状态:</td>
      <td width="30%" align="left"> 
        <select name="InState" class="SelectWidth" id="select">
          <option value="1"<%if ObjRS("InState")=1 then response.Write("selected")%>>试用在职</option>
          <option value="2"<%if ObjRS("InState")=2 then response.Write("selected")%>>正式在职</option>
          <option value="3"<%if ObjRS("InState")=3 then response.Write("selected")%>>正常离职</option>
          <option value="4"<%if ObjRS("InState")=4 then response.Write("selected")%>>辞职</option>
          <option value="5"<%if ObjRS("InState")=5 then response.Write("selected")%>>辞退</option>
          <option value="6"<%if ObjRS("InState")=6 then response.Write("selected")%>>除名</option>
          <option value="7"<%if ObjRS("InState")=7 then response.Write("selected")%>>开除</option>
        </select></td>
      <td width="20%">档案是否在公司:</td>
      <td width="54%" align="left">
          <input name="IsFilesIn" type="radio" value="1" <%if ObjRS("FilesIn")=1 then response.Write("checked")%>>
          <input type="radio" name="IsFilesIn" value="0" <%if ObjRS("FilesIn")=0 then response.Write("checked")%>>
          不在 </td>
    </tr>
    <tr class=Ltr> 
      <td width="13%">职务级别:</td>
      <td width="30%" align="left"> 
        <select class="SelectWidth" name="DutyClass">
          <option value="1" <%if ObjRS("DutyClass")=1 then response.Write("selected")%>>普通职务</option>
          <option value="2" <%if ObjRS("DutyClass")=2 then response.Write("selected")%>>一级职务</option>
          <option value="3" <%if ObjRS("DutyClass")=3 then response.Write("selected")%>>二级职务</option>
        </select>
	  </td>
      <td width="20%">是否有担保书:</td>
      <td align="left">
          <input name="IsAssure" type="radio" value="1" <%if ObjRS("Assure")=1 then response.Write("checked")%>>
          <input type="radio" name="IsAssure" value="0" <%if ObjRS("Assure")=0 then response.Write("checked")%>>
          没有 
	  </td>
    </tr>
    <tr class=Ltr>
      <td width="13%">上岗时间:</td>
      <td width="30%" align="left"> 
        <input name="InTime" type="text" class=Input id="InTime" onClick="InputDate(this)" value="<%=ObjRS("InTime")%>" readonly></td>
      <td width="20%">签订类型:</td>
      <td align="left">第 
        <input name="ContractType" type="text" id="ContractType" value="<%=ObjRS("ContractType")%>" size="5">
        次 签订</td>
    </tr>
    <tr class=Ltr>
      <td width="13%">转正时间:</td>
      <td width="30%" align="left"> 
        <input name="OfficialTime" type="text" class=Input id="OfficialTime" onClick="InputDate(this)" value="<%=ObjRS("OfficialTime")%>" readonly></td>
      <td width="20%">劳动合同签订起始时间:</td>
      <td align="left">
<input name="ContractTime" type="text" class=Input id="ContractTime" onClick="InputDate(this)" value="<%=ObjRS("ContractTime")%>" readonly></td>
    </tr>
    <tr class=Ltr> 
      <td width="13%">离职时间:</td>
      <td width="30%" align="left"> 
        <input name="OutTime" type="text" class=Input id="OutTime" onClick="InputDate(this)" value="<%=ObjRS("OutTime")%>" readonly></td>
      <td width="20%">劳动合同签订终止时间:</td>
      <td align="left"> 
        <input name="EndContractTime" type="text" class=Input id="EndContractTime" onClick="InputDate(this)" value="<%=ObjRS("EndContractTime")%>" readonly></td>
    </tr>
	<tr class=Ltr> 
      <td width="13%">备注:</td>
      <td colspan="3"><textArea  cols=70 rows=5 class=Textarea Show="备注" name="Des"><%=ObjRS("Des")%></textarea></td>
    </tr>
	</table>
	 <table width="100%" cellpadding=3 cellspacing=1 class=Ltable>
      <tr class=LHtr> 
      <td colspan="4">员工绩效考评信息 </td>
    </tr>
	<tr class=Ltr> 
      <td width="13%">考评期间:</td>
      <td colspan="3"><Input name="PYear" type="text"   id="PYear" size="10" >
        <input name="PMonth" type="text" id="PMonth" size="10">
        季度 (如:2004年第一季度) </td>
    </tr>
    <tr class=Ltr> 
      <td width="13%">考评结果:</td>
      <td colspan="3"><Input name="PAchivement"   class=Textarea id="PAchivement" size="10" >
        (例如:优、良、中、及格、差) <input type="button"  name="Submit22" class=Button value="查看绩效考评情况" onclick="AddPerformance(ID.value)"></td>
    </tr>
    <tr class=Ltr height=100%> 
      <td colspan=4 align="left" valign="top"><input type="submit"  name="Submit" class=Button value="确  定"> 
        <input type="button" class=Button value="取 消"onclick="history.go(-1)" id=button1 name=button1></td>
    </tr>
  </table>
</form>
<%
End Sub
%>
<!-- #include file="Templet.asp" -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -