以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]目录树如何与课程表相连?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=31101)

--  作者:anxue
--  发布时间:2013/4/10 11:08:00
--  [求助]目录树如何与课程表相连?

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目4621 (2).table


点目录树 出现与课程表相对着内容 代码多少?

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:错误.jpg
图片点击可在新窗口打开查看
课程表直接点本周 按钮出现的错误
--  作者:Bin
--  发布时间:2013/4/10 11:12:00
--  
没出错啊?
--  作者:Bin
--  发布时间:2013/4/10 11:26:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目4621 (2).table

双击目录树 显示对应课程表已完成
--  作者:唐尸三摆手
--  发布时间:2013/4/10 11:32:00
--  

\'报错是因为datetimepicker没有值导致的,可以限制下

Dim dtp As WinForm.DateTimePicker
dtp = e.Form.Controls("DateTimePicker1")
If dtp.Value IsNot Nothing Then
    Dim wday As Integer = dtp.Value.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.Value.AddDays(-wdays(i))
        For j As Integer =0 To classTime.length-1
            Dim drlist As List(of DataRow)=DataTables("排课明细").Select("日期 = #" & dtp.Value.AddDays(-wdays(i)) & "# and 上课时间 = \'" & classTime(j) & "\'")
            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()
End If

[此贴子已经被作者于2013-4-10 11:32:17编辑过]

--  作者:Bin
--  发布时间:2013/4/10 11:39:00
--  
原来说的是不选日期直接点报错啊,疏忽了.楼上正解,加个判断即可.