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

📄 xscxdj_query.asp

📁 学生日常管理系统
💻 ASP
📖 第 1 页 / 共 3 页
字号:
          l_kb=trim(rds1.Recordset.fields(5))
          l_kk=rds1.Recordset.fields(6)
          l_cd=rds1.Recordset.fields(7)
          l_zt=rds1.Recordset.fields(8)
          l_sj=rds1.Recordset.fields(9)
          l_bj=rds1.Recordset.fields(10)
          l_bz=rds1.Recordset.fields(11)
                            
          l_date=trim(dateno.value)
          select case  rds1.Recordset.fields(5)
          
             case "早操"
               
              if isnull(l_cd) then
               l_cd_kf=0 
              else 
               l_cd_kf=l_cd*0.5
              end if 
              if isnull(l_zt) then
              else
               l_zt_kf=l_zt*0.5
              end if 
              if isnull(l_kk) then
              else
               l_kk_kf=l_kk*1
              end if 
                     
               if len(classno.value)<>0 then
               msgbox "ok1"
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 班号='"&trim(classno.value)&"' and 扣分项目='扣早操'" 
              msgbox rds2.sql
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               elseif  len(start_no.value)<>0 then
                    msgbox "ok"                                                 
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 学号='"&start_no.value&"' and 扣分项目='扣早操'" 
              msgbox rds2.sql
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               else 
               
                  rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&xm.value&"' and 扣分项目='扣早操'" 
              msgbox rds2.sql
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh
               
               end if             
                 
              case "正课"
              
                if isnull(l_cd) then
                    l_cd_kf=0 
                 else 
                    l_cd_kf=l_cd*1
                end if 
                if isnull(l_zt) then
                else
                 l_zt_kf=l_zt*1
                end if 
                if isnull(l_kk) then
                else
                  l_kk_kf=l_kk*3
                end if 
                                                                     
                 if len(classno.value)<>0 then
               
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 班号='"&classno.value&"' and 扣分项目='扣正课'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               elseif  len(start_no.value)=0 then
                                                                     
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 学号='"&start_no.value&"' and 扣分项目='扣正课'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               else 
               
                  rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&start_no.value&"' and 扣分项目='扣正课'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh
               
               end if             
              case "晚修"
              
                 if isnull(l_cd) then
                    l_cd_kf=0 
                 else 
                    l_cd_kf=l_cd*1
                end if 
                if isnull(l_zt) then
                else
                 l_zt_kf=l_zt*1
                end if 
                if isnull(l_kk) then
                else
                  l_kk_kf=l_kk*3
                end if 
                                                                     
                if len(classno.value)<>0 then
               
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 班号='"&classno.value&"' and 扣分项目='扣晚修'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               elseif  len(start_no.value)=0 then
                                                                     
                 rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 学号='"&start_no.value&"' and 扣分项目='扣晚修'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
               else 
               
                  rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周别='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&start_no.value&"' and 扣分项目='扣晚修'" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh
               
               end if                       
              
          end select 
                    
             
             'msgbox rds1.Recordset.fields(4)  
          
      
      rds1.Recordset.movenext 
   next
 
  

end sub
'=================================
'保存考勤数据录入
'=================================

sub update_click()

   if rds1.Recordset.recordcount<0 then
   
      msgbox "没有数据保存......",,"提示窗口"
      
      exit sub
   
   end if   

   rds1.Recordset.movefirst
   
   for i=0 to rds1.Recordset.recordcount-1
   
      if isnull(rds1.Recordset.fields(6)) and isnull(rds1.Recordset.fields(7)) and isnull(rds1.Recordset.fields(8)) and isnull(rds1.Recordset.fields(9)) and isnull(rds1.Recordset.fields(10)) then
         
      else
        
          l_week=trim(rds1.Recordset.fields(0))
          l_date1=trim(rds1.Recordset.fields(1))
          l_bh=trim(rds1.Recordset.fields(2))
          l_xh=trim(rds1.Recordset.fields(3))
          l_xm=trim(rds1.Recordset.fields(4))
          l_kb=trim(rds1.Recordset.fields(5))
          l_kk=rds1.Recordset.fields(6)
          l_cd=rds1.Recordset.fields(7)
          l_zt=rds1.Recordset.fields(8)
          l_sj=rds1.Recordset.fields(9)
          l_bj=rds1.Recordset.fields(10)
          l_bz=rds1.Recordset.fields(11)
                            
          rds2.SQL="insert into kaoqin(周别,日期,班号,学号,姓名,课别,旷课,迟到,早退,事假,病假,备注) values('"&l_week&"','"&l_date1&"','"&l_bh&"','"&l_xh&"','"&l_xm&"','"&l_kb&"','"&l_kk&"','"&l_cd&"','"&l_zt&"','"&l_sj&"','"&l_bj&"','"&l_bz&"')"
         ' msgbox rds2.sql
          rds2.ExecuteOptions = 1
          rds2.Refresh 
          
          select case  rds1.Recordset.fields(5)
          
             case "早操"
               
              if isnull(l_cd) then
               l_cd_kf=0 
              else 
               l_cd_kf=l_cd*0.5
              end if 
              if isnull(l_zt) then
              else
               l_zt_kf=l_zt*0.5
              end if 
              if isnull(l_kk) then
              else
               l_kk_kf=l_kk*1
              end if 
                                                                     
                 rds2.SQL="insert into xscxdjk(周别,日期,班号,学号,姓名,扣分项目,扣分) values('"&l_week&"','"&l_date1&"','"&l_bh&"','"&l_xh&"','"&l_xm&"','扣早操','"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"')" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
              case "正课"
              
                if isnull(l_cd) then
                    l_cd_kf=0 
                 else 
                    l_cd_kf=l_cd*1
                end if 
                if isnull(l_zt) then
                else
                 l_zt_kf=l_zt*1
                end if 
                if isnull(l_kk) then
                else
                  l_kk_kf=l_kk*3
                end if 
                                                                     
                 rds2.SQL="insert into xscxdjk(周别,日期,班号,学号,姓名,扣分项目,扣分) values('"&l_week&"','"&l_date1&"','"&l_bh&"','"&l_xh&"','"&l_xm&"','扣正课','"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"')" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
              case "晚修"
              
                 if isnull(l_cd) then
                    l_cd_kf=0 
                 else 
                    l_cd_kf=l_cd*1
                end if 
                if isnull(l_zt) then
                else
                 l_zt_kf=l_zt*1
                end if 
                if isnull(l_kk) then
                else
                  l_kk_kf=l_kk*3
                end if 
                                                                     
                 rds2.SQL="insert into xscxdjk(周别,日期,班号,学号,姓名,扣分项目,扣分) values('"&l_week&"','"&l_date1&"','"&l_bh&"','"&l_xh&"','"&l_xm&"','扣晚修','"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"')" 
              
                 rds2.ExecuteOptions =1
                 
                 rds2.Refresh           
              
          end select 
                    
             
             'msgbox rds1.Recordset.fields(4)  
          
      end if
      rds1.Recordset.movenext 
   next
  

end sub


'====================根据课程号,查询此课程所有类型成绩信息==============
sub score_allsearch()    
'========================================================================	
coursename = CourseNoArray(0,courseno.selectedIndex-1)
dim coursetype(5)

coursetype(0) = "平时成绩"
coursetype(1) = "期中成绩"
coursetype(2) = "期末成绩"
coursetype(3) = "总评成绩"
coursetype(4) = "补考成绩"	

rds1.SQL = " Execute serach_alltypescore "+ classno.value
rds1.ExecuteOptions =1 
rds1.Refresh 


for typecount = 0 to 4
		rds2.SQL = " select "+coursename+" from score where 成绩类型='"+coursetype(typecount)+"' and 学年='"+yearno.value+"' "&_
				   " and 学期='" +termno.value+"' and 学号 in (select 学号 from student where 班号='"+classno.value+"') "&_
				   " order by 学号"
		rds2.ExecuteOptions = 1
		rds2.Refresh

		if rds2.Recordset.recordcount >0 then 
			rds1.Recordset.Movefirst
			'grid1.row = 0
			rds2.Recordset.Movefirst
			while not rds2.Recordset.eof and not rds1.Recordset.eof
			'for i =0 to rds2.Recordset.recordcount-1
				if isnull(rds2.Recordset.fields(0))=false then
					'msgbox rds2.Recordset.fields(0)
					'msgbox rtrim(cstr(rds2.Recordset.fields(0)))
					'rds1.Recordset.fields(2+typecount).value = rtrim(cstr(rds2.Recordset.fields(0)))
					rds1.Recordset.fields(2+typecount).value = cint(rds2.Recordset.fields(0))
					'grid1.columns.item(2+typecount).value = rtrim(cstr(rds2.Recordset.fields(0)))
				end if
				
				
				rds1.Recordset.Movenext
				'grid1.row = grid1.row + 1
				rds2.Recordset.Movenext
			Wend 
		end if
next
  
search_all = true

end sub


			
'====================根据班号,学号,年级查询成绩====================================
sub score_search(search_type)    
'========================================================================	
	'根据课程名,取得课程代码
	 get_course(search_type)
	 if CourseSelectCount<=0 then
		msgbox("没有输入此学期成绩!请输入成绩或到班级课程设置模块中运行刷新功能")
		exit sub
	 end if
	
	course_sql = "select 学号,姓名,名次,"
	total_score ="("
	select_course = CourseSelectCount
	if rtrim(courseno.value)="所有课程" then
		for i = 0 to courseSelectCount - 1
 			course_sql = course_sql +"'"+rtrim(GetCourseName(i))+"'=str("+courseSelectArray(0,i)+",7,1),"
 	
			total_score = total_score + courseSelectArray(0,i)+"+"
		next
		
    else
			
		for i = 0 to CourseCount -1
			if rtrim(courseArray(0,i)) = rtrim(courseno.value) then
				course_sql = course_sql +"'"+rtrim(courseArray(0,i))+"'=str("+courseNoArray(0,i)+",7,1),"
				total_score = total_score + courseNoArray(0,i)+"+"
				
				exit for
			end if
		next  
		'找出本学期是否开设了此课程,通过计算是否在开设数组中CourseSelectArrary中进行判断
		findOpned = false
		for j = 0 to CourseSelectCount-1
			if courseNoArray(0,i)=CourseSelectArray(0,j) then
	
				findOpend = true
				exit for

⌨️ 快捷键说明

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