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

📄 edit.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="Include/Page.asp" -->
<!-- #include virtual="Include/SelectValue.asp" -->

<%
Dim ObjDB
Dim C
Dim IntID,IntParentID
Dim ObjRS,rs,sql

IntID       = Request.QueryString("ID")
IntParentID = Request.QueryString("ParentID")
 'response.write "IntID ="&IntID &"IntParentID="&IntParentID
 'response.End()
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB

Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)

If Request.Form.Count > 0 Then
  IntID = Request.Form("PostID")

 Set rs = Server.CreateObject("ADODB.Recordset")
  sql="select *  from T_Hrms_Dep_Account Where ID="&IntID
 
 rs.open sql,ObjDB,3,3
 
 
 rs("Pos")=trim(request("RightC"))
 'response.Write  rs("Pos")
 'response.End()

rs.update

set rs=nothing
ObjDB.Close
Set ObjDB = Nothing
Response.Redirect "list.asp?ParentID="&request("ParentIDA")

End If

Set ObjRS = C.View("Select * From T_Hrms_Dep_Account Where ID = " & IntID)
  


Sub Main
%>
<script language="javascript">
<!--
function addin()
{
	var i = 0;

	for (i; i <document.frmSelect.selectallusers.length; i++)
	{

		if (document.frmSelect.selectallusers[i].selected == true)
		{
			if (isinlist(document.frmSelect.selectallusers[i].value) == false)
			{
				var oOption = document.createElement("OPTION");
				oOption.text = document.frmSelect.selectallusers[i].text;
				oOption.value = document.frmSelect.selectallusers[i].value;
				selectusers.add(oOption);
			}
		}
	}
}

function isinlist(name)
{
	var i = 0;
	for (i; i < selectusers.length; i++)
	{
		if (selectusers[i].value == name)
		{
			return true;
		}
	}
	
	return false;
}

function delout()
{
	var i = 0;
	for (i; i < selectusers.length; i++)
	{
		if (selectusers[i].selected == true)
		{
			selectusers.remove(i);
			i--;
		}
	}
}


function gook()
{
	var str = "";
	var i = 0;
	
	for (i; i < selectusers.length; i++)
	{
	 
		if ( i + 1 == selectusers.length)
			str = str + selectusers[i].value;
		else
			str = str + selectusers[i].value + ",";
			}

	document.frmSelect.RightC.value= str;
	document.frmSelect.PostID.value=document.frmSelect.DepID.value;
   	document.frmSelect.ParentIDA.value=document.frmSelect.ParentID.value;

	
	dep_onchange(frmSelect);
	}
	
	function dep_onchange(frmSelect) {
   frmSelect.submit(); 
}

//-->
</script>

	<form name="frmSelect" method="Post" >
  	 <input type=hidden name=RightC >
    <input type=hidden name=DepID  value="<%=IntID%>">
	 <input type=hidden name=PostID >
	  <input type=hidden name=ParentID value="<%=IntParentID%>" >

	  <input type=hidden name=ParentIDA >

  <table class=Ltable cellspacing=1 cellpadding=3>
  <tr class=LHtr>
    <td width="15%">修改岗位信息</td>
    <td width="85%"></td>
  </tr>
  <tr class=Ltr>
    <td>部门ID</td>
    <td><input type="text" class=Input name="TrueName" readonly value="<%=SelectValueView(ObjDB,"Select ID,DepName from T_Hrms_Dep",CStr(ObjRS("DepID")))%>"></td>
	  </tr>
    <tr class=Ltr>
    <td>职务</td>
    <td>
	<select type="text" class=Input Check=0  name="selectallusers"  style="width: 150;"  size="10">
	<%=SelectValue(objDB,"Select ID,JobName from T_Hrms_Sys_Job")
	%>
	</SELECT></td>
	<td width="35%" align="center">
<input type="button" name="add" value="&lt;&lt; --添加" onClick="return addin()"><br>
<input type="button" name="Submit2" value="&lt;&lt; --删除" class="sbttn" language="javascript" onClick="delout()">
      </td><td> </form>
	<select  name="selectusers" size="10" multiple class=Input  style="width: 150;height:150" type="text" Check=0 >
        <%=SelectValueArray(ObjDB,"Select ID,JobName from T_Hrms_Sys_Job",CStr(ObjRS("Pos")))%> 
      </SELECT>
	</td>
  </tr>
  </tr>
    <tr class=Ltr>
    <td>创建时间</td>
    <td><input type="text" class=Input name="CreateTime" readonly value=<%=ObjRS("CreateTime")%>></td>
  </tr>
  <table cellspacing=1 cellpadding=3>
  <tr>
    <td>
		<input type="button"  name="Submit" class=Button value="提 交" LANGUAGE=javascript onclick="gook()" >
		<input type="button" class=Button value="取 消" LANGUAGE=javascript onclick="javascript:history.back(-1);"  id=button1 name=button1>
    </td>
    <td>
    </td>
  </tr>
  </table>
 
<%
End Sub
%>
<!-- #include file="Templet.asp" -->

⌨️ 快捷键说明

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