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

📄 scheduleaddsave.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini"-->
<!--#include file="../commfunction.inc" -->
<%
date1=request("date")
time1=request("time")
time2=request("endtime")
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open Connstring
Set RSEVENTS = Server.CreateObject("ADODB.Recordset")

RSEVENTS.Open "Schedule", Conn, 2, 2

user = Split(Request("bowner"), ",")
for i =0 to ubound(user)

		RSEVENTS.addnew

		RSEVENTS("AssignedTo") = trim(user(i))
		RSEVENTS("Creator") = Session("loginid")
		RSEVENTS("Createdate") = now()
		RSEVENTS("Schedule") = request("Event_Name")
		RSEVENTS("relativetype") = request("relativetype")
		if request("relativetype")="其他" then
		    RSEVENTS("TaskType") = request("TaskType2")
		elseif request("relativetype")="客户" then
		    RSEVENTS("TaskType") = request("TaskType1")
		end if
		if request("account")<>"" then
			RSEVENTS("account") = request("account")
		else
			RSEVENTS("account") = -1
		end if
		RSEVENTS("Description") = request("Description")
		RSEVENTS("result") = request("result")

		eventDate = date1 + " " + time1
		RSEVENTS("ScheduleDate") = date1
		RSEVENTS("ScheduleTime") = time1
		RSEVENTS("endtime") = time2
		RSEVENTS("Closed") = 0
		If (request("Location") = "") Then
			RSEVENTS("Location") = Null
		Else
			RSEVENTS("Location") = request("Location")
		End If
		if request("Continued")="0" then
			RSEVENTS("Continued") = 0
		else
			RSEVENTS("Continued") = 1
			if request("ContinuedDate")="1" then
				RSEVENTS("NextDate") = dateadd("ww",1,date1)
			elseif request("ContinuedDate")="2" then
				RSEVENTS("NextDate") = dateadd("ww",2,date1)
			elseif request("ContinuedDate")="3" then
				RSEVENTS("NextDate") = dateadd("m",1,date1)
			elseif request("ContinuedDate")="4" then
				RSEVENTS("NextDate") = dateadd("m",2,date1)
			elseif request("ContinuedDate")="5" then
				RSEVENTS("NextDate") = request("CustDate")
			end if	
		end if
		RSEVENTS.update
		
		'发送系统消息
		if trim(user(i))<>session("loginid") then
			conn.Execute("insert into messenger(consignee,sender,description,subject)values('"&trim(user(i))&"','system','"&Session("username")&"为你创建了一条工作日程:"& request("Event_Name")&",开始时间:"&eventDate&"','"&now()&",系统消息:')") 
		end if
		
		dim rstCheck
		set rstCheck= Server.CreateObject("ADODB.RecordSet")
		rstCheck.Open "select max(id) as id  from Schedule",Conn,2,3,1

		dim Attendant,Attendants,intcounter1
		dim rstAttendant
		set rstAttendant= Server.CreateObject("ADODB.RecordSet")
		rstAttendant.Open "select * from attendant",Conn,2,3,1
		Attendant=request("attendant")
		if Attendant<>"" then
			Attendant=left(Attendant,len(Attendant)-1)
			Attendants=split(Attendant,",")
			for intcounter1=0 to ubound(Attendants)
				rstAttendant.addnew
				rstAttendant("scheduleid")=rstCheck("id")
				rstAttendant("UserId")=Attendants(intcounter1)
				rstAttendant("Agree")=false
				rstAttendant("Attendant")=false
				rstAttendant.update
			next
		end if
		rstCheck.close

next
		RSEVENTS.close
		set RSEVENTS = nothing
set rstCheck=nothing
rstAttendant.close
set rstAttendant=nothing
Conn.close
set Conn=nothing
Response.Redirect "main.asp"
%>

⌨️ 快捷键说明

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