Structure date controlling part


None.gif
None.gif    Private Sub SetDateWeekDropDownList(ByVal mYearMonth As String)
None.gif        Dim i As Integer 
=   0 , j As Integer  =   0
None.gif        Dim StartDate As String 
=  Format(CDate(mYearMonth  &   " -01 " ), DATE_FORMAT)
None.gif        Dim EndDate As String 
=  Format(DateAdd(DateInterval.Day,  - 1 , DateAdd(DateInterval.Month,  1 , CDate(StartDate))), DATE_FORMAT)
None.gif        Dim mDay As Integer 
=  DateDiff(DateInterval.Day, CDate(StartDate), CDate(EndDate))  +   1
None.gif        Dim mWeek As Integer 
=  Weekday(CDate(StartDate))  -   1
None.gif        Dim tr As TableRow
None.gif        Dim tc As TableCell
None.gif        Dim IntDay As Integer 
=   1
None.gif        Dim IntmDay As Integer 
=   1
None.gif        For i 
=   1  To  6
None.gif            tr 
=  New TableRow
None.gif            For j 
=   0  To  6
None.gif                If mWeek 
<=  j Then
None.gif                    If IntDay 
<=  mDay Then
None.gif                        tc 
=  New TableCell
None.gif                        tc.HorizontalAlign 
=  HorizontalAlign.Center
None.gif                        tc.Text 
=  IntDay
None.gif                        tr.Cells.Add(tc)
None.gif                        IntDay 
=  IntDay  +   1
None.gif                    Else
None.gif                        tc 
=  New TableCell
None.gif                        tc.Text 
=   ""
None.gif                        tr.Cells.Add(tc)
None.gif                    End If
None.gif                Else
None.gif                    tc 
=  New TableCell
None.gif                    tc.Text 
=   ""
None.gif                    tr.Cells.Add(tc)
None.gif                End If
None.gif            Next
None.gif            tableDate.Rows.Add(tr)
None.gif            tr 
=  New TableRow
None.gif            For j 
=   0  To  6
None.gif                If mWeek 
<=  j Then
None.gif                    If IntmDay 
<=  mDay Then
None.gif                        tc 
=  New TableCell
None.gif                        Dim Drp As New DropDownList
None.gif                        Drp.ID 
=   " DropDownList "   &  IntmDay
None.gif
None.gif                        'AddHandler Drp.SelectedIndexChanged, AddressOf DropDownListDate_SelectedIndexChanged
None.gif
None.gif                        SetcboShiftSchedule(Drp)
None.gif                        tc.Controls.Add(Drp)
None.gif                        tr.Cells.Add(tc)
None.gif                        IntmDay 
=  IntmDay  +   1
None.gif                    Else
None.gif                        tc 
=  New TableCell
None.gif                        tc.Text 
=   ""
None.gif                        tr.Cells.Add(tc)
None.gif                    End If
None.gif                Else
None.gif                    tc 
=  New TableCell
None.gif                    tc.Text 
=   ""
None.gif                    tr.Cells.Add(tc)
None.gif                End If
None.gif            Next
None.gif            mWeek 
=   0
None.gif            tableDate.Rows.Add(tr)
None.gif        Next
None.gif    End Sub
None.gif
None.gif    Private Sub SetcboShiftSchedule(ByVal Drp As DropDownList)
None.gif        Dim Item As ListItem
None.gif        Item 
=  New ListItem( " ---All--- " 0 )
None.gif        Drp.Items.Add(Item)
None.gif
None.gif        Item 
=  New ListItem( " AAAAAA " 1 )
None.gif        Drp.Items.Add(Item)
None.gif        Item 
=  New ListItem( " BBBBB " 1 )
None.gif        Drp.Items.Add(Item)
None.gif        Item 
=  New ListItem( " CCCCC " 1 )
None.gif        Drp.Items.Add(Item)
None.gif        Item 
=  New ListItem( " DDDDD " 1 )
None.gif        Drp.Items.Add(Item)
None.gif        Drp.SelectedIndex 
=   0
None.gif    End Sub

转载于:https://www.cnblogs.com/jiemupig/archive/2006/05/30/413062.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值