www.pudn.com > manager050315.rar > ccard_g.inc


<% 
Function ListTableHeader() 
	ListTableHeader = _ 
		"" & _ 
		"" & _ 
		"" & _ 
		"" 
End Function 
 
Function ListTableTailer() 
	ListTableTailer = "
单位名录类别列表
  " & TableHeaderField(sFileName, "group_desp", "类别名称", sFormParams, iSort, iSorted) & "
" End Function Function ListTableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams) dim sTemp : sTemp = "" ' 临时字符串变量 dim j ' 临时循环变量 ' response.write sSQL : response.end '------------------------------------ ' 分页所需的变量定义 '------------------------------------ Dim iCounter : iCounter = 1 Dim iPrevPage, iNextPage '------------------------------------ ' 获取数据库连接 '------------------------------------ dim crs : set crs = New CRecordset dim rs : set rs = crs.open(dbLocal,sSQL) dim iCardGroupId, sCardGroupDesp dim sColor ' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行 if Not rs.EOF then rs.Move (iCurrentPage - 1) * iRecordsPerPage end if while not rs.EOF and iCounter <= iRecordsPerPage iCardGroupId = crs.GetValue("group_id") sCardGroupDesp = crs.GetValue("group_desp") if sCardGroupDesp = sGroupDesp then '' 如果是选中的纪录,显示不同的颜色,这里指定红色 sColor = "red" else sColor = "black" end if sTemp = sTemp & "" & _ "  " & Bref(sCardGroupDesp,18) & " " & _ "" iCounter = iCounter + 1 rs.movenext wend crs.Close() ' 填补空白行 sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage) ' 首页、前页、后页、尾页等分页信息 sTemp = sTemp & "" & _ Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _ " " ListTableRecords = sTemp End Function Function FormTable() dim sTitle, sActionLinks if IsEmpty(pGroupId) then sTitle = "新增单位名录类别" '' 显示新增、取消的链接 sActionLinks = _ "" & vbLF & _ " " & vbLF & _ " " & vbLF & _ "     " & vbLF & _ " " & vbLF & _ " " & vbLF & _ "" & vbLF else sTitle = "重命名单位名录类别" '' 显示修改、删除、取消的链接 sActionLinks = _ "" & vbLF & _ " " & vbLF & _ " " & vbLF & _ "     " & vbLF & _ " " & vbLF & _ "     " & vbLF & _ " " & vbLF & _ " " & vbLF & _ "" & vbLF end if FormTable = _ "" & vbLF & _ "" & vbLF & _ "" & vbLF & _ "" & vbLF & _ "" & vbLF & _ " " & vbLF & _ "" & vbLF & _ "" & vbLF & _ " " & _ " " & vbLF & _ sActionLinks & vbLF & _ "" & vbLF & _ "" & _ "
" & sTitle & "
类别名称:
" & vbLF & _ "" End Function Function TableLink() TableLink = _ "" & _ "" & _ " " & _ "" & _ "" & _ " " & _ "" & _ "
 " & _ "  新增单位名录类别" & _ "  " & _ "  新建单位名录" & _ "  " & _ "  单位名录查询" & _ "  " & _ "  我的个人通讯录
" End Function sub AddGroup() dim sSQL, iRows sGroupDesp = Trim(sGroupDesp) '' 类别名称不能为空 if sGroupDesp = "" then Response.Write _ "" & vbLF exit sub end if '' 检查是否存在重复的类别名称 iRows = DLookUp(dbLocal, "t_customercardgroup", "count(*)", "group_desp =" & ToSQL(sGroupDesp, "Text")) if iRows > 0 then Response.Write _ "" & vbLF exit sub end if sSQL = "insert into t_customercardgroup(group_desp) values(" & ToSQL(sGroupDesp, "Text") & ")" call ExecuteSQL(dbLocal, sSQL) pGroupId = empty '' 重新置成新增状态 sGroupDesp = "" end sub sub UpdateGroup() dim sSQL, iRows sGroupDesp = Trim(sGroupDesp) '' 类别名称不能为空 if sGroupDesp = "" then Response.Write _ "" & vbLF exit sub end if '' 检查是否存在重复的类别名称 iRows = DLookUp(dbLocal, "t_customercardgroup", "count(*)", "group_desp=" & ToSQL(sGroupDesp, "Text") & " and group_id<>" & ToSQL(pGroupId,"Number")) if iRows > 0 then Response.Write _ "" & vbLF exit sub end if sSQL = "update t_customercardgroup set group_desp = " & ToSQL(sGroupDesp, "Text") & " where group_id = " & ToSQL(pGroupId, "Number") call ExecuteSQL(dbLocal, sSQL) pGroupId = empty sGroupDesp = "" end sub sub DeleteGroup() dim sSQL, iRows '' 检查是否存在重复的类别名称 iRows = DLookUp(dbLocal, "t_customercard", "count(*)", "card_group =" & ToSQL(pGroupId, "Number")) if iRows > 0 then Response.Write _ "" & vbLF exit sub end if sSQL = "delete from t_customercardgroup where group_id = " & ToSQL(pGroupId, "Number") call ExecuteSQL(dbLocal, sSQL) pGroupId = empty '' 重新置成新增状态 sGroupDesp = "" end sub %>