A real Mess
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
That's terrible! I mean...VB? X|
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Wow, what a beast. My deepest condolences.
A dogged, arrogant belief in self and the childlike idealism that comes with not knowing my limits. This is my greatest blessing, my priceless attribute.
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
"Swiss made" implies elgance in design, using the least amount of parts in a well-thought out fashion. This is more German made, where the engineering uses the most amount of parts possible to do the simplest of jobs. The breech of a certain German artillery piece (can't remember which) was made with 192 parts. The equivilent artillery piece on the U.S. side used 48. The Swiss probably could have done it in 20.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
"Swiss made" implies elgance in design, using the least amount of parts in a well-thought out fashion. This is more German made, where the engineering uses the most amount of parts possible to do the simplest of jobs. The breech of a certain German artillery piece (can't remember which) was made with 192 parts. The equivilent artillery piece on the U.S. side used 48. The Swiss probably could have done it in 20.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Well this code has been made in Switzerland...
-
Wow, what a beast. My deepest condolences.
A dogged, arrogant belief in self and the childlike idealism that comes with not knowing my limits. This is my greatest blessing, my priceless attribute.
Any donation is welcome.
-
"Swiss made" implies elgance in design, using the least amount of parts in a well-thought out fashion. This is more German made, where the engineering uses the most amount of parts possible to do the simplest of jobs. The breech of a certain German artillery piece (can't remember which) was made with 192 parts. The equivilent artillery piece on the U.S. side used 48. The Swiss probably could have done it in 20.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008What's your problem with Germans? There are idiots as well as geniuses and everything in between everywhere in the world... Maybe you should not care that much about weapons... :suss: Regards Thomas
www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software. -
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Yeah, so it's long and wide, some methods have to be; what have you replaced it with?
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
:rolleyes:
Don't attribute to stupidity what can be equally well explained by buerocracy.
My latest article | Linkify!| FoldWithUs! | sighist -
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
So what? As far as I've seen it, all the magic numbers are commented (not totally sure, somewhere in the middle my eyes began to bleed)... :laugh: Regards Thomas
www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software. -
Yeah, so it's long and wide, some methods have to be; what have you replaced it with?
Nothing yet, the problem is the whole application is badly design, so from my point of view it is better to build a new application from scratch.
-
What's your problem with Germans? There are idiots as well as geniuses and everything in between everywhere in the world... Maybe you should not care that much about weapons... :suss: Regards Thomas
www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.:WTF: is your problem?? All I did was bring up something I saw in a documentery about artillery and it's reliablilty and maintainability, and you think I'm picking on the Germans? Dude, back then, during the war, they tended to over-engineer their weapons. That's all I'm saying...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Well, that code brings me back to the 90's. Typical "journeyman programmer" production. The journeyman programmer doesn't care about software engineering or improving the skills in their trade, just hack away until it works... eventually they work up their way to be project manager and leave the crap to someone else to maintain X|. Don't let it get to you too much the first 20 years are the worse :laugh:
-
Well, that code brings me back to the 90's. Typical "journeyman programmer" production. The journeyman programmer doesn't care about software engineering or improving the skills in their trade, just hack away until it works... eventually they work up their way to be project manager and leave the crap to someone else to maintain X|. Don't let it get to you too much the first 20 years are the worse :laugh:
Very well put :) I wouldn't even use the word 'programmer' in the same sense as VB, more like 'user'. VB - curse of many bad project implementations.
Software Kinetics (requires SL3 beta) - Moving software
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Hoorray! I fixed it!!!! Well when the procedure found a time over 4 hours for a day it used to skip the next records for that day :doh: I am so proud that I can not resist to post the fixed method :-D
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.V
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
-
Very well put :) I wouldn't even use the word 'programmer' in the same sense as VB, more like 'user'. VB - curse of many bad project implementations.
Software Kinetics (requires SL3 beta) - Moving software
In fairness, a lot of bad implementations are done in other languages, I dare say there are as many shocking apps developed in C# as there are VB.Net.
-
:WTF: is your problem?? All I did was bring up something I saw in a documentery about artillery and it's reliablilty and maintainability, and you think I'm picking on the Germans? Dude, back then, during the war, they tended to over-engineer their weapons. That's all I'm saying...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I agree with you ;) And what's about an italian like me? Would you like me to speak about spaghetti code? :laugh: Luckly italian people does not always write spaghetti as they eat!! :P
-
Well, that code brings me back to the 90's. Typical "journeyman programmer" production. The journeyman programmer doesn't care about software engineering or improving the skills in their trade, just hack away until it works... eventually they work up their way to be project manager and leave the crap to someone else to maintain X|. Don't let it get to you too much the first 20 years are the worse :laugh:
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Did the author die? ;P
GSoC 2009 student for SMW! --- My little forums: http://code.bn2vs.com --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!