www.pudn.com > manager050315.rar > pcard_e.inc
<%
Function CardForm()
dim sSQL, crs, rs
dim sOwner, sCardGroup, sIsPublic, sName, sGender, sPost, sCName, sCAddr, sCZip, sCPhone, sHAddr, sHZip, sHPhone
dim sFax, sBeep, sMobile, sEmail, sMemo
dim sActionLinks
'' 如果是更新操作,则根据通讯录的序列号获取详细信息
if sAction = "modify" then
sSQL = "select * from t_personalcard where serial = " & iCardSerial & " and emp_serial = " & iEmpSerial
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
'' 居然找不到通讯录信息的记录,那肯定是个莫名的错误
if rs.EOF then
Server.Transfer("../common/error.asp")
Response.end
end if
'' 获取任务信息的各种数据
sOwner = crs.GetValue("emp_serial") '' 名片属主
sCardGroup = crs.GetValue("card_group")
sIsPublic = crs.GetValue("ispublic")
sName = crs.GetValue("name")
sGender = crs.GetValue("gender")
sPost = crs.GetValue("post")
sCName = crs.GetValue("company_name")
sCAddr = crs.GetValue("company_addr")
sCZip = crs.GetValue("company_zip")
sCPhone = crs.GetValue("company_phone")
sHAddr = crs.GetValue("home_addr")
sHZip = crs.GetValue("home_zip")
sHPhone = crs.GetValue("home_phone")
sFax = crs.GetValue("fax")
sBeep = crs.GetValue("beep")
sMobile = crs.GetValue("mobile")
sEmail = crs.GetValue("email")
sMemo = crs.GetValue("memo")
crs.Close()
end if
'' 新建时,sOwner肯定为空,和iEmpSerial不可能相等,因此下面这句判断肯定是针对修改名片信息而言
if sAction = "modify" then '' 是我自己的名片,有修改和删除的权限,因此显示修改和删除的链接
sActionLinks = _
"" & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" | " & vbLF & _
"
" & vbLF
else
sActionLinks = _
"" & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" " & vbLF & _
" | " & vbLF & _
"
" & vbLF
end if
'' TableTitle函数定义在../common/commonpage.inc
CardForm = _
"" & vbLF & _
"" & _
"
"
End Function
Function TableLink()
TableLink = _
"" & vbLF & _
"" & vbLF & _
" ![]() | " & vbLF & _
"
" & vbLF & _
"" & _
" " & vbLF & _
" 通讯录类别管理" & vbLF & _
" " & vbLF & _
" 通讯录信息查询" & vbLF & _
" " & vbLF & _
" 单位名录信息查询 | " & vbLF & _
"
" & _
"
"
End Function
Function AddCard()
dim sSQL
dim sName, sGender, sCardGroup, sIsPublic, sPost, sCName, sCAddr, sCZip, sCPhone, sFax
dim sHAddr, sHZip, sHPhone, sMobile, sBeep, sEmail, sMemo
sName = GetParam("name")
sGender = GetParam("gender")
sCardGroup = GetParam("card_group")
sIspublic = GetParam("ispublic")
sPost = GetParam("post")
sCName = GetParam("company_name")
sCAddr = GetParam("company_addr")
sCZip = GetParam("company_zip")
sCPhone = GetParam("company_phone")
sHAddr = GetParam("home_addr")
sHZip = GetParam("home_zip")
sHPhone = GetParam("home_phone")
sMobile = GetParam("mobile")
sBeep = GetParam("beep")
sFax = GetParam("fax")
sEmail = GetParam("email")
sMemo = GetParam("memo")
if CStr(sIsPublic) = "on" then sIsPublic = "1" else sIsPublic = "0"
sSQL = "insert into t_personalcard(emp_serial, name, gender, card_group, ispublic, post," & _
" company_name, company_addr, company_zip, company_phone," & _
" home_addr, home_zip, home_phone, mobile, beep, fax, email, memo)" & _
" values(" & ToSQL(iEmpSerial, "Number") & ", " & ToSQL(sName,"Text") & ", " & ToSQL(sGender, "Number") & _
", " & ToSQL(sCardGroup, "Number") & _
", " & ToSQL(sIsPublic, "Number") & ", " & ToSQL(sPost, "Text") & ", " & ToSQL(sCName, "Name") & _
", " & ToSQL(sCAddr, "Text") & ", " & ToSQL(sCZip, "Text") & ", " & ToSQL(sCPhone, "Text") & _
", " & ToSQL(sHAddr, "Text") & ", " & ToSQL(sHZip, "Text") & ", " & ToSQL(sHPhone, "Text") & _
", " & ToSQL(sMobile, "Text") & ", " & ToSQL(sBeep, "Text") & ", " & ToSQL(sFax, "Text") & _
", " & ToSQL(sEmail, "Text") & ", " & ToSQL(sMemo, "Text") & ")"
call ExecuteSQL(dbLocal, sSQL)
iCardSerial = DLookUp(dbLocal, "t_personalcard", "max(serial)", "emp_serial=" & iEmpSerial)
Response.Redirect "pcard_p.asp?serial=" & iCardSerial & "&"
Response.end
End Function
Function UpdateCard()
dim sSQL
dim sSerial, sName, sGender, sCardGroup, sIsPublic, sPost, sCName, sCAddr, sCZip, sCPhone, sFax
dim sHAddr, sHZip, sHPhone, sMobile, sBeep, sEmail, sMemo
sSerial = GetParam("serial")
sName = GetParam("name")
sGender = GetParam("gender")
sCardGroup = GetParam("card_group")
sIsPublic = GetParam("ispublic")
sPost = GetParam("post")
sCName = GetParam("company_name")
sCAddr = GetParam("company_addr")
sCZip = GetParam("company_zip")
sCPhone = GetParam("company_phone")
sHAddr = GetParam("home_addr")
sHZip = GetParam("home_zip")
sHPhone = GetParam("home_phone")
sMobile = GetParam("mobile")
sBeep = GetParam("beep")
sFax = GetParam("fax")
sEmail = GetParam("email")
sMemo = GetParam("memo")
if CStr(sIsPublic) = "on" then sIsPublic = "1" else sIsPublic = "0"
sSQL = "update t_personalcard" & _
" set name = " & ToSQL(sName, "Text") & _
", gender = " & ToSQL(sGender, "Number") & _
", card_group = " & ToSQL(sCardGroup, "Number") & _
", ispublic = " & ToSQL(sIsPublic, "Number") & _
", post = " & ToSQL(sPost, "Text") & _
", company_name = " & ToSQL(sCName, "Text") & _
", company_addr = " & ToSQL(sCAddr, "Text") & _
", company_zip = " & ToSQL(sCZip, "Text") & _
", company_phone = " & ToSQL(sCPhone, "Text") & _
", home_addr = " & ToSQL(sHAddr, "Text") & _
", home_zip = " & ToSQL(sHZip, "Text") & _
", home_phone = " & ToSQL(sHPhone, "Text") & _
", mobile = " & ToSQL(sMobile, "Text") & _
", beep = " & ToSQL(sBeep, "Text") & _
", fax = " & ToSQL(sFax, "Text") & _
", email = " & ToSQL(sEmail, "Text") & _
", memo = " & ToSQL(sMemo, "Text") & _
" where serial = " & ToSQL(sSerial, "Number")
call ExecuteSQL(dbLocal, sSQL)
Response.Redirect "pcard_p.asp?serial=" & sSerial & "&"
Response.end
End Function
%>