📄 meetdb.inc
字号:
else
getMeetingContentById = adoRS("content")
end if
set adoRS = nothing
end function
public function getMeetingRecordById(id)
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where id=" & id
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
if adoRS.EOF then
getMeetingRecordById = ""
else
getMeetingRecordById = adoRS("record")
end if
set adoRS = nothing
end function
public function getMeetingOrganizeNoteById(id)
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where id=" & id
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
if adoRS.EOF then
getMeetingOrganizeNoteById = ""
else
getMeetingOrganizeNoteById = adoRS("organizenote")
end if
set adoRS = nothing
end function
public sub writeMeetingPersonOption(id)
checkSession
dim strPerson
dim intCount
dim personArray
strPerson = getMeetingPersonById(id)
personArray = split(strPerson,"#")
for intCount = 0 to UBound(personArray)
writeOption personArray(intCount),"",personArray(intCount)
Next
end sub
public sub writeNotMeetingPersonOption(id)
checkSession
dim adoRS
dim strQuery
strQuery="select * from userinfo"
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
while not adoRS.EOF
if isPersonOfMeeting(id,adoRS("userid"))=0 then
WriteOption adoRS("userid"),"",adoRS("userid")
end if
adoRS.MoveNext
Wend
set adoRS = Nothing
end sub
public sub addMeetingPerson(id,username)
checkSession
if "" & username = "" then
raiseErr "您没有选择用户"
end if
if getMeetingBuilderById(id) <> getUser() then
raiseErr "您无权对该会议增加与会人员"
end if
if getMeetingAttrById(id) <> 0 then
raiseErr "会议当前的状态不允许增加与会人员"
end if
dim adoRS
dim strPerson
dim strUpdatePerson
dim strUpdate
set adoRS = getMeetingRSById(id)
if checkMeetingConflictByPerson(username,adoRS("begintime"),adoRS("endtime"))=1 then
raiseErr "添加的用户在会议时间段内已有会议"
end if
strUpdatePerson = ""
strPerson = getMeetingPersonById(id)
strUpdatePerson = strPerson & "#" & username
strUpdate = "update meeting set person='" & strUpdatePerson & "' where id=" & id
getConnection().Execute strUpdate
addlog "add meeting person " & username & " to " & id,"meeting"
end sub
public sub removeMeetingPerson(id,username)
checkSession
if "" & username = "" then
raiseErr "您没有选择用户"
end if
if getMeetingBuilderById(id) <> getUser() then
raiseErr "您无权对该会议删除与会人员"
end if
if getMeetingBuilderById(id) = username then
raiseErr "不能删除会议的创建者"
end if
if getMeetingAttrById(id) <> 0 then
raiseErr "会议当前的状态不允许删除与会人员"
end if
dim strPerson
dim personArray
dim intCount
dim strUpdatePerson
dim strUpdate
strUpdatePerson = ""
strPerson = getMeetingPersonById(id)
personArray = split(strPerson,"#")
for intCount = 0 to UBound(personArray)
if personArray(intCount) <> username then
strUpdatePerson = strUpdatePerson & "#" & personArray(intCount)
end if
Next
if strUpdatePerson <> "" then
strUpdatePerson = Right(strUpdatePerson,Len(strUpdatePerson)-1)
end if
strUpdate = "update meeting set person='" & strUpdatePerson & "' where id=" & id
getConnection().Execute strUpdate
addlog "remove meeting person " & username & " to " & id,"meeting"
end sub
public sub setMeetingContent(id,content)
if getMeetingAttrById(id) <> 0 then
raiseErr "会议当前的状态不允许修改会议内容"
end if
if getMeetingBuilderById(id) <> getUser() then
raiseErr "您无权修改该会议的内容"
end if
dim strUpdate
strUpdate = "update meeting set content='" & content & "' where id=" & id
getConnection().Execute strUpdate
addlog "update meeting content " & content & " to " & id,"meeting"
end sub
public sub setMeetingOrganizer(id,organizer)
if getMeetingAttrById(id) <> 1 then
raiseErr "会议当前的状态不允许设置会务安排人"
end if
if getUserRank() <> 1 then
raiseErr "您无权设置会务安排人"
end if
dim strUpdate
strUpdate = "update meeting set organizer='" & organizer & "' where id=" & id
getConnection().Execute strUpdate
addlog "update meeting organizer " & organizer & " to " & id,"meeting"
addmsg organizer,"您被指定为会务安排人,请安排会议<a href=meetinginfo.asp?id=" & id & ">" & getMeetingNameById(id) & "</a>"
end sub
public sub setMeetingOrganizeNote(id,note)
if getMeetingAttrById(id) <> 1 then
raiseErr "会议当前的状态不允许修改会务安排说明"
end if
if getMeetingOrganizerById(id) = "" then
raiseErr "请先指定会务安排人"
end if
if getUserRank() <> 1 then
raiseErr "您无权修改会务安排说明"
end if
dim strUpdate
strUpdate = "update meeting set organizenote='" & note & "' where id=" & id
getConnection().Execute strUpdate
addlog "update meeting organizenote " & note & " to " & id,"meeting"
addmsg getMeetingOrganizerById(id),"请察看会议<a href=meetinginfo.asp?id=" & id & ">" & getMeetingNameById(id) & "</a>的会务安排说明"
end sub
public sub setMeetingRecord(id,record)
if getMeetingAttrById(id) <> 1 then
raiseErr "会议当前的状态不允许填写会议记录"
end if
if getMeetingBuilderById(id) <> getUser() then
raiseErr "您无权填写会议记录"
end if
dim strUpdate
strUpdate = "update meeting set record='" & record & "' where id=" & id
getConnection().Execute strUpdate
addlog "update meeting record " & record & " to " & id,"meeting"
end sub
public sub setMeetingAttr(id,attr)
if getUserRank() <> 1 then
raiseErr "您无权设置会议状态"
end if
if CInt(getMeetingAttrById(id)) >= CInt(attr) then
raiseErr "状态设置不正确"
end if
dim strUpdate
strUpdate = "update meeting set attr=" & CInt(attr) & " where id=" & id
getConnection().Execute strUpdate
addlog "update meeting attr " & attr & " to " & id,"meeting"
if attr = 1 then
addmsg getMeetingBuilderById(id),"您创建的<a href=meetinginfo.asp?id=" & id & ">" & getMeetingNameById(id) & "</a>被批准了"
strPerson = getMeetingPersonById(id)
personArray = split(strPerson,"#")
for intCount = 0 to UBound(personArray)
addmsg personArray(intCount),"请参加会议<a href=meetinginfo.asp?id=" & id & ">" & getMeetingNameById(id) & "</a>"
Next
end if
end sub
public sub removeMeeting(id)
if getMeetingAttrById(id) <> 0 then
raiseErr "会议当前的状态不允许删除"
end if
if getMeetingBuilderById(id) <> getUser() then
raiseErr "您无权删除该会议"
end if
dim strUpdate
strUpdate = "delete from meeting where id=" & id
getConnection().Execute strUpdate
addlog "delete meeting " & id,"meeting"
end sub
public function isPersonOfMeeting(id,username)
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where id=" & id & " and person like '%" & username & "%'"
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
if adoRS.EOF then
isPersonOfMeeting = 0
else
isPersonOfMeeting = 1
end if
set adoRS = nothing
end function
public function getMeetingAttrStr(intAttr)
if intAttr = 0 then
getMeetingAttrStr = "未审批通过"
elseif intAttr = 1 then
getMeetingAttrStr = "已审批通过"
elseif intAttr = 2 then
getMeetingAttrStr = "已完成"
else
getMeetingAttrStr = "未知状态"
end if
end function
public function getMyMeetingRSByBuilder()
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where builder='" & getUser() & "'"
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
set getMyMeetingRSByBuilder = adoRS
end function
public function getMyMeetingRSByOrganizer()
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where organizer='" & getUser() & "' and attr=1"
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
set getMyMeetingRSByOrganizer = adoRS
end function
public function getMyMeetingRSByPerson()
checkSession
dim adoRS
dim strQuery
strQuery="select * from meeting where attr=1 and person like '%" & getUser() & "%'"
set adoRS=server.createobject("ADODB.Recordset")
adoRS.Open strQuery, getConnection(), , , adCmdText
set getMyMeetingRSByPerson = adoRS
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -