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

📄 edit.asp

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

<%
	Dim ObjDB,ObjRS,C,StrSQL
	Dim IntModuleID,IntRoleID
	Dim StrModuleCName,StrOptionLevel
	Dim ObjModule
	Dim IsEdit
	Dim IntID
	Dim ObjID
		
	IntRoleID = Request.QueryString("RoleID")
	IntModuleID = Request.QueryString("ID")

	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDB ObjDB

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


	If Request.Form.Count > 0 Then
		
		IsEdit = Cint(Request.Form("IsEdit"))
	
		If IsEdit = 0 And Request.Form("_PerLevel")<>"" Then
			Call C.AddNew("_","t_OA_SYS_Role_Permission")
		ElseIf IsEdit<> 0 Then
			If Request.Form("_PerLevel")<>"" Then
				Call C.Edit(Request.Form("IntID"),"_","t_OA_SYS_Role_Permission")
			Else
				Call C.Delete(Request.Form("IntID"),"t_OA_SYS_Role_Permission")
			End If
		End If 

%>
<script language=javascript>
parent.doList()
</script>
<%
		Response.End
	Else

		StrSQL = "Select * From t_OA_SYS_Role_Permission Where RoleID = " & IntRoleID & " And ModuleID = " & IntModuleID
		
		Set ObjRS = C.View(StrSQL)
		
		If ObjRS("ID") = "" Then
			IsEdit = 0
			StrSQL = "Select CName From t_Base_Module Where ID = " & IntModuleID
			Set ObjModule = C.View(StrSQL)
			StrModuleCName = ObjModule("CName")
			StrOptionLevel = GetOption(ObjDB,"Select PerLevel,PerName From t_Base_Module_Permission Where ModuleID = " & IntModuleID & " Order By PerLevel",0)
			ObjDB.Close
			Set ObjDB = Nothing
			

		Else
		
			IsEdit = 1

			StrSQL = "Select CName From t_Base_Module Where ID = " & IntModuleID
			Set ObjModule = C.View(StrSQL)
			StrModuleCName = ObjModule("CName")

			StrOptionLevel = GetOption(ObjDB,"Select PerLevel,PerName From t_Base_Module_Permission Where ModuleID = " & IntModuleID & " Order By PerLevel",Cint(ObjRS("PerLevel")))
					
			StrSQL = "Select ID From t_OA_SYS_Role_Permission Where RoleID = " & IntRoleID & " And ModuleID = " & IntModuleID
			Set ObjID = C.View(StrSQL)
			IntID = ObjID("ID")
			
			ObjDB.Close
			Set ObjDB = Nothing
		
		End If

	End If

%>


<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>

	
	<form action="" method="post" onsubmit="return(CheckForm(this))" id=form1 name=form1>
	<input type=hidden name=IsEdit value=<%=IsEdit%>>
	<input type=hidden name=IntID value=<%=IntID%>>
	<input type=hidden name=_RoleID value="<%=IntRoleID%>">
	<input type=hidden name=_ModuleID value="<%=IntModuleID%>">
	<table class=Ltable cellspacing=1 cellpadding=3>
	<tr class=LHtr>
		<td width="15%">修改角色权限</td>
		<td width="85%"> </td>
	</tr>
	<tr class=Ltr>
		<td>模块名称</td>
		<td><input type="text" class=Input name="CName" readonly value=<%=StrModuleCName%>></td>
	</tr>
	<tr class=Ltr>
		<td>权限</td>
		<td><select name=_PerLevel Check=0 Show="权限" class=Input><option value="">没有权限</option><%=StrOptionLevel%></select></td>
	</tr>
	
	<table cellspacing=1 cellpadding=3>
	<tr>
		<td>
		<input type="submit"  name="Submit" class=Button value="提 交" >
		<input type="button" class=Button value="取 消" onclick="doList()" id=button1 name=button1>
		</td>
		<td>
		</td>
	</tr>
	</table>
	</form>
	


<%'------------------------------------------------------------------%>
<%End Sub%>
<%'==================================================================%>

<!-- #include file="Templet.asp" -->

⌨️ 快捷键说明

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