Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Re Hi everyoneRe Hi everyone
Previous
 
Next
New Post
7/20/2007 11:05 AM
 

Hi everyone

I am working on a project and have run into some issues. I am creating a monthly report that automatically fills in the hours that an individual works for a month depending on the Employee Type. All the user has to do is pick the month and his employee type and the time **** for that month come up. My problem is I want to have Sunday and Saturday automatically be set to "OFF" and just can't get this to work. Can some please help. How can I get my IsWorkDay function work in my PrintDays function

Here are my functions

Public

Function IsWorkDay(ByVal currentDay As Date) As Boolean

 

 

 

 

 

 

 

Dim bSpecialDay As Boolean = Me.SpecialDays.Contains(ConvertDateToInt(currentDay))Select Case currentDay.DayOfWeekCase DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.FridayReturn Not bSpecialDayCase DayOfWeek.Saturday, DayOfWeek.SundayReturn bSpecialDayEnd Select

 

 

End Function

 

 

 

 

Public Shared Function ConvertDateToInt(ByVal dt As Date) As Int32Return dt.Year * 10000 + dt.Month * 100 + dt.DayEnd Function

 

Private Function CheckLeap(ByVal year As Integer) As Boolean

 

If (year Mod 4 = 0) And (year Mod 100 <> 0) Or (year Mod 400 = 0) Then

 

Return True

 

Else

 

Return False

 

End If

 

End Function

 

Public Function PrintDays(ByVal month As Integer, ByVal year As Integer, ByVal EmpType As String, ByVal sStartDate As Date) As Integer

 

d = System.DateTime.Today

 

Dim d As DateTimeDim i As Integer

 

month = DDList1.SelectedValue

EmpType = DDList2.SelectedValue

 

 

Dim AlDays As New ArrayListDim Civilian As String = "1"

 

 

Dim iCivilian As Integer = Integer.Parse(Civilian)Dim Uniform As String = "2"

 

 

Dim iUniform As Integer = Integer.Parse(Uniform)Dim CommSpec As String = "3"

 

 

Dim iONDD As Integer = Integer.Parse(CommSpec)Dim Schedule As String = "4"

 

 

Dim iShift As Integer = Integer.Parse(Schedule)Dim January As String = "1"

 

 

Dim M1 As Integer = Integer.Parse(January)'dl = New DropDownList

dt =

 

New DataTable'Adding Columns to GridView

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

dt.Columns.Add(

 

 

 

 

 

 

 

dr = dt.NewRow()

 

New DataColumn("Date", GetType(Integer)))New DataColumn("Hours On Duty", GetType(Double)))New DataColumn("Unpaid O.T", GetType(Double)))New DataColumn("Paid O.T", GetType(Double)))New DataColumn("Admin", GetType(Double)))New DataColumn("Court", GetType(Double)))New DataColumn("INSTR", GetType(Double)))New DataColumn("STDNT", GetType(Double)))New DataColumn("COMM SERV", GetType(Double)))New DataColumn("VICT SERV", GetType(Double)))New DataColumn("Remarks", GetType(String)))Select Case monthCase 1, 3, 5, 7, 8, 10, 12For i = 1 To 31If DDList2.SelectedValue = Uniform Then

                    dr(1) = 10.0

                  dr(4) = 10.0

 

Else

 

                  If DDList2.SelectedValue = Civilian Then

                         dr(1) = 7.5

                         dr(4) = 7.5

 

Else

 

                    If DDList2.SelectedValue = CommSpec Then

                              dr(1) = 10.0

                           dr(4) = 10.0

 

Else

 

                  If DDList2.SelectedValue = Schedule Then

                       dr(1) = 9.5

                      dr(4) = 9.5

 

                 End If

 

             End If

 

           End If

 

End If

dt.Rows.Add(dr)

 

Next

 

 

Case 2         If CheckLeap(year) Then

 

                               dr = dt.NewRow()

                                          dr(0) = i

                                         dr(1) = 0.0

 

                      For i = 1 To 28                               If DDList2.SelectedValue = Uniform Then

                                           dr(1) = 10.0

                                         dr(4) = 10.0

 

         Else

 

                         If DDList2.SelectedValue = Civilian Then

                                      dr(1) = 7.5

                                    dr(4) = 7.5

 

      Else

 

                        If DDList2.SelectedValue = CommSpec Then

                                  dr(1) = 10.0

                                  dr(4) = 10.0

 

   Else

 

                    If DDList2.SelectedValue = Schedule Then

                                   dr(1) = 9.5

                                  dr(4) = 9.5

 

                    End If

 

              End If

 

       End If

 

End If

dt.Rows.Add(dr)

 

Next

 

Else

 

                         dr = dt.NewRow()

                                   dr(0) = i

                                   dr(1) = 0.0

 

                  For i = 1 To 29                     If DDList2.SelectedValue = Uniform Then

                                 dr(1) = 10.0

                                 dr(4) = 10.0

 

Else

 

                    If DDList2.SelectedValue = Civilian Then

                               dr(1) = 7.5

                             dr(4) = 7.5

 

         Else

 

                       If DDList2.SelectedValue = CommSpec Then

                                       dr(1) = 10.0

                                       dr(4) = 10.0

 

        Else

 

                         If DDList2.SelectedValue = Schedule Then

                                      dr(1) = 9.5

                                     dr(4) = 9.5

 

                   End If

 

               End If

 

           End If

 

End If

dt.Rows.Add(dr)

 

Next

 

End If

 

 

                                  dr = dt.NewRow()

                      

 

Case 4, 6, 9, 11                         For i = 1 To 30                       If DDList2.SelectedValue = Uniform Then

                                             dr(1) = 10.0

                                          dr(4) = 10.0

 

             Else

 

                                   If DDList2.SelectedValue = Civilian Then

                                           dr(1) = 7.5

                                          dr(4) = 7.5

 

            Else

 

                              If DDList2.SelectedValue = CommSpec Then

                                            dr(1) = 10.0

                                           dr(4) = 10.0

 

         Else

 

                             If DDList2.SelectedValue = Schedule Then

                                      dr(1) = 9.5

                                       dr(4) = 9.5

 

                             End If

 

                    End If

 

            End If

 

End If

dt.Rows.Add(dr)

 

Next

 

End Select

GridView1.DataSource =

GridView1.DataBind()

 

New DataView(dt)End Function

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Re Hi everyoneRe Hi everyone


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out