以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]代码转换  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=63435)

--  作者:anxue
--  发布时间:2015/1/21 9:33:00
--  [求助]代码转换
a
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:课程表.rar


 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:课程表开发版121.rar



1、试用版做的课程表,把代码放到开发版下,不好用了呢
2、打开课程表开发版的窗口目录树 (目录树不好用)

--  作者:有点甜
--  发布时间:2015/1/21 9:46:00
--  
 功能一样啊,相同数据一样的效果啊。
--  作者:anxue
--  发布时间:2015/1/21 9:53:00
--  
目录树控制 有问题
--  作者:有点甜
--  发布时间:2015/1/21 9:54:00
--  

 关键是你要做什么啊,红色代码自己好好想一想

 

Dim drr As DataRow
Dim filter As String = ""
Select Case e.Node.Level
    Case 0
        filter = "教师姓名 =\'" & e.Node.Name & "\'"
    Case 1
        filter = "课程名称 =\'" & e.Node.Name & "\'"
       
    Case 2
        filter = "上课形式 =\'" & e.Node.Name & "\'"
    Case 3
        filter = "学员姓名 =\'" & e.Node.Name & "\'"
End Select

drr=DataTables("排课明细").Find(filter)
Dim dtp As Date
dtp=drr("日期")
Dim wday As Integer = dtp.DayOfWeek
Dim wdays() As Integer={wday-1,wday-2,wday-3,wday-4,wday-5,wday-6,wday-7}
Dim dweek() As String={"星期一","星期二","星期三","星期四","星期五","星期六","星期日"}
Dim classTime() As String={"8:00-9:00","9:00-10:00"}
Dim dt As DataTable
dt=DataTables("表A")
For i As Integer=0 To dt.DataRows.Count-1
    For j As Integer=0 To dweek.length-1
        dt.DataRows(i)(dweek(j))=Nothing
    Next
Next
For i As Integer=0 To 6
    dt.DataCols(dweek(i)).Caption=dweek(i) & "_" & dtp.AddDays(-wdays(i))
    For j As Integer =0 To classTime.length-1
        Dim drlist As List(of DataRow) = DataTables("排课明细").Select("日期 = #" & dtp.AddDays(-wdays(i)) & "# and 上课时间 = \'" & classTime(j) & "\' and " & filter)
        If not drlist Is Nothing Then
            For k As Integer = 0 To drlist.Count-1
                If k=0 Then
                    dt.DataRows(j)(dweek(i))=drlist(k)("课程名称")
                Else
                    dt.DataRows(j)(dweek(i))=dt.DataRows(j)(dweek(i)) & "," & drlist(k)("课程名称")
                End If
            Next
        End If
       
    Next
Next
dt.BuildHeader()