|
Imports System Imports System.IO Imports System.Data Imports System.Web.UI Imports System.Web.UI.WebControls ' .---. ' /
. \ ' |\_/|
| ' (C)2000
for Colliers Jardine by Riley T. Perry | | /| ' .----------------------------------------------------------------'
| ' / .-. | ' | / \ Valuations Common Classes | ' | |\_. |
~~~~~~~~~~~~~~~~~~~~~~~~~ | ' |\| | /| | ' | `---' | This set of classes encapsulates all of the
common UI | ' | | functionality
for the Valuations system. | ' | | / ' | |----------------------------------------------------------' ' \ |
' \ /
' `---' Namespace Valuations.Common ' ,
, ' /
\/ \ ' (/
//_ \_ ' .-._ \|| . \ ' \ '-._
_,:__.-"/---\_ \ '
______/___ '. .--------------------'~-'--.)__( , )\ \ '`'--.___ _\ /
| Colors ,' \)|\ `\| ' /_.-' _\ \ _:,_ ~~~~~~ "
|| ( ' .'__ _.' \'-/,`-~` Colors for all pages.
|/ ' '. ___.> /=,| | ' / .-'/_ ) '---------------------------------' ' )' (
/(/ Riley_Perry@hotmail.com ' \\ " ' '==' ' Public
Class ColorValues Public
Shared HEADINGBACKCOLOR_Red As Integer Public
Shared HEADINGBACKCOLOR_Green As Integer Public
Shared HEADINGBACKCOLOR_Blue As Integer Public
Shared HEADINGFORECOLOR_Red As Integer Public
Shared HEADINGFORECOLOR_Green As Integer Public
Shared HEADINGFORECOLOR_Blue As Integer Public
Shared NORMALJOBBACKCOLOR_Red As Integer Public
Shared NORMALJOBBACKCOLOR_Green As Integer Public
Shared NORMALJOBBACKCOLOR_Blue As Integer Public
Shared NORMALJOBFORECOLOR_Red As Integer Public
Shared NORMALJOBFORECOLOR_Green As Integer Public
Shared NORMALJOBFORECOLOR_Blue As Integer Public
Shared ACTIONBACKCOLOR_Red As Integer Public
Shared ACTIONBACKCOLOR_Green As Integer Public
Shared ACTIONBACKCOLOR_Blue As Integer Public
Shared ACTIONFORECOLOR_Red As Integer Public
Shared ACTIONFORECOLOR_Green As Integer Public
Shared ACTIONFORECOLOR_Blue As Integer Public
Shared OLDBACKCOLOR_Red As Integer Public
Shared OLDBACKCOLOR_Green As Integer Public
Shared OLDBACKCOLOR_Blue As Integer Public
Shared OLDFORECOLOR_Red As Integer Public
Shared OLDFORECOLOR_Green As Integer Public
Shared OLDFORECOLOR_Blue As Integer Public
Shared UNASSIGNEDBACKCOLOR_Red As Integer Public
Shared UNASSIGNEDBACKCOLOR_Green As Integer Public
Shared UNASSIGNEDBACKCOLOR_Blue As Integer Public
Shared UNASSIGNEDFORECOLOR_Red As Integer Public
Shared UNASSIGNEDFORECOLOR_Green As Integer Public
Shared UNASSIGNEDFORECOLOR_Blue As Integer Public
Shared GENERALINFORMATIONBACKCOLOR_Red
As Integer Public
Shared GENERALINFORMATIONBACKCOLOR_Green
As Integer Public
Shared GENERALINFORMATIONBACKCOLOR_Blue
As Integer Public
Shared GENERALINFORMATIONFORECOLOR_Red
As Integer Public
Shared GENERALINFORMATIONFORECOLOR_Green
As Integer Public
Shared GENERALINFORMATIONFORECOLOR_Blue
As Integer Public
Shared GENERALTITLEBACKCOLOR_Red As Integer Public
Shared GENERALTITLEBACKCOLOR_Green As Integer Public
Shared GENERALTITLEBACKCOLOR_Blue As Integer Public
Shared GENERALTITLEFORECOLOR_Red As Integer Public
Shared GENERALTITLEFORECOLOR_Green As Integer Public
Shared GENERALTITLEFORECOLOR_Blue As Integer Public
Shared HIGHLIGHTEDBACKCOLOR_Red As Integer Public
Shared HIGHLIGHTEDBACKCOLOR_Green As Integer Public
Shared HIGHLIGHTEDBACKCOLOR_Blue As Integer Public
Shared HIGHLIGHTEDFORECOLOR_Red As Integer Public
Shared HIGHLIGHTEDFORECOLOR_Green As Integer Public
Shared HIGHLIGHTEDFORECOLOR_Blue As Integer Shared
HasConstructorExecuted As String '****
Instance of data tier object **** Shared
DBHelper As Valuations.DBTier.DBHelper Shared
ColorFunctions As New
COMMON_Functions.DataTier.COMMON_DataAccess(DBHelper.ConnectionString) '*----------------------------------------------* '* Colors Constructor * '* ~~~~~~~~~~~~~~~~~~ * '*
Sets up initial colors by pulling them from
* '*
the data tier.
* '*----------------------------------------------* Sub
New() '*-------------------------------* '* Only fill values if necessary * '*-------------------------------* If HasConstructorExecuted = "" Then Try '**** init. Dataset and fill with db values Dim ds As New DataSet() ds = ColorFunctions.GetColors() '**** init. rows Dim DR As DataRow '*--------------------------------------------* '* Add colors, by iterating through row is ds * '*--------------------------------------------* For Each DR In ds.Tables("Colors").Rows Select Case (Trim(DR.Item(0).ToString)) Case "HEADINGBACKCOLOR_Red" HEADINGBACKCOLOR_Red
= CInt(DR.Item(1)) Case "HEADINGBACKCOLOR_Green" HEADINGBACKCOLOR_Green
= CInt(DR.Item(1)) Case "HEADINGBACKCOLOR_Blue" HEADINGBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "HEADINGFORECOLOR_Red" HEADINGFORECOLOR_Red
= CInt(DR.Item(1)) Case "HEADINGFORECOLOR_Green" HEADINGFORECOLOR_Green
= CInt(DR.Item(1)) Case "HEADINGFORECOLOR_Blue" HEADINGFORECOLOR_Blue
= CInt(DR.Item(1)) Case "NORMALJOBBACKCOLOR_Red" NORMALJOBBACKCOLOR_Red
= CInt(DR.Item(1)) Case "NORMALJOBBACKCOLOR_Green" NORMALJOBBACKCOLOR_Green
= CInt(DR.Item(1)) Case "NORMALJOBBACKCOLOR_Blue" NORMALJOBBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "NORMALJOBFORECOLOR_Red" NORMALJOBFORECOLOR_Red
= CInt(DR.Item(1)) Case "NORMALJOBFORECOLOR_Green" NORMALJOBFORECOLOR_Green
= CInt(DR.Item(1)) Case "NORMALJOBFORECOLOR_Blue" NORMALJOBFORECOLOR_Blue = CInt(DR.Item(1)) Case "ACTIONBACKCOLOR_Red" ACTIONBACKCOLOR_Red
= CInt(DR.Item(1)) Case "ACTIONBACKCOLOR_Green" ACTIONBACKCOLOR_Green = CInt(DR.Item(1)) Case "ACTIONBACKCOLOR_Blue" ACTIONBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "ACTIONFORECOLOR_Red" ACTIONFORECOLOR_Red
= CInt(DR.Item(1)) Case "ACTIONFORECOLOR_Green" ACTIONFORECOLOR_Green
= CInt(DR.Item(1)) Case "ACTIONFORECOLOR_Blue" ACTIONFORECOLOR_Blue
= CInt(DR.Item(1)) Case "OLDBACKCOLOR_Red" OLDBACKCOLOR_Red
= CInt(DR.Item(1)) Case "OLDBACKCOLOR_Green" OLDBACKCOLOR_Green = CInt(DR.Item(1)) Case "OLDBACKCOLOR_Blue" OLDBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "OLDFORECOLOR_Red" OLDFORECOLOR_Red = CInt(DR.Item(1)) Case "OLDFORECOLOR_Green" OLDFORECOLOR_Green
= CInt(DR.Item(1)) Case "OLDFORECOLOR_Blue" OLDFORECOLOR_Blue
= CInt(DR.Item(1)) Case "UNASSIGNEDBACKCOLOR_Red" UNASSIGNEDBACKCOLOR_Red
= CInt(DR.Item(1)) Case "UNASSIGNEDBACKCOLOR_Green" UNASSIGNEDBACKCOLOR_Green
= CInt(DR.Item(1)) Case "UNASSIGNEDBACKCOLOR_Blue" UNASSIGNEDBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "UNASSIGNEDFORECOLOR_Red" UNASSIGNEDFORECOLOR_Red
= CInt(DR.Item(1)) Case "UNASSIGNEDFORECOLOR_Green" UNASSIGNEDFORECOLOR_Green
= CInt(DR.Item(1)) Case
"UNASSIGNEDFORECOLOR_Blue" UNASSIGNEDFORECOLOR_Blue
= CInt(DR.Item(1)) Case "GENERALINFORMATIONBACKCOLOR_Red" GENERALINFORMATIONBACKCOLOR_Red
= CInt(DR.Item(1)) Case "GENERALINFORMATIONBACKCOLOR_Green" GENERALINFORMATIONBACKCOLOR_Green
= CInt(DR.Item(1)) Case
"GENERALINFORMATIONBACKCOLOR_Blue" GENERALINFORMATIONBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "GENERALINFORMATIONFORECOLOR_Red" GENERALINFORMATIONFORECOLOR_Red
= CInt(DR.Item(1)) Case "GENERALINFORMATIONFORECOLOR_Green" GENERALINFORMATIONFORECOLOR_Green
= CInt(DR.Item(1)) Case "GENERALINFORMATIONFORECOLOR_Blue" GENERALINFORMATIONFORECOLOR_Blue
= CInt(DR.Item(1)) Case "GENERALTITLEBACKCOLOR_Red" GENERALTITLEBACKCOLOR_Red
= CInt(DR.Item(1)) Case "GENERALTITLEBACKCOLOR_Green" GENERALTITLEBACKCOLOR_Green
= CInt(DR.Item(1)) Case "GENERALTITLEBACKCOLOR_Blue" GENERALTITLEBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "GENERALTITLEFORECOLOR_Red" GENERALTITLEFORECOLOR_Red
= CInt(DR.Item(1)) Case "GENERALTITLEFORECOLOR_Green" GENERALTITLEFORECOLOR_Green
= CInt(DR.Item(1)) Case "GENERALTITLEFORECOLOR_Blue" GENERALTITLEFORECOLOR_Blue
= CInt(DR.Item(1)) Case "HIGHLIGHTEDBACKCOLOR_Red" HIGHLIGHTEDBACKCOLOR_Red = CInt(DR.Item(1)) Case "HIGHLIGHTEDBACKCOLOR_Green" HIGHLIGHTEDBACKCOLOR_Green
= CInt(DR.Item(1)) Case "HIGHLIGHTEDEBACKCOLOR_Blue" HIGHLIGHTEDBACKCOLOR_Blue
= CInt(DR.Item(1)) Case "HIGHLIGHTEDFORECOLOR_Red" HIGHLIGHTEDFORECOLOR_Red
= CInt(DR.Item(1)) Case
"HIGHLIGHTEDFORECOLOR_Green" HIGHLIGHTEDFORECOLOR_Green
= CInt(DR.Item(1)) Case "HIGHLIGHTEDFORECOLOR_Blue" HIGHLIGHTEDFORECOLOR_Blue
= CInt(DR.Item(1)) End Select Next HasConstructorExecuted
= "True" Catch e As Exception Throw e End Try End If End
Sub End
Class ' ,
, ' /
\/ \ ' (/
//_ \_ ' .-._ \|| . \ ' \ '-._
_,:__.-"/---\_ \ '
______/___ '. .--------------------'~-'--.)__( , )\ \ '`'--.___ _\ /
| Common ,' \)|\ `\| ' /_.-' _\ \ _:,_ ~~~~~~ "
|| ( ' .'__ _.' \'-/,`-~` Common to all pages.
|/ ' '. ___.> /=,| | ' / .-'/_ ) '---------------------------------' ' )' (
/(/ Riley_Perry@hotmail.com ' \\ " ' '==' ' Public
Class AllPages Inherits
System.Web.UI.Page '****
Common Values **** Protected
Shared Colors As
New Valuations.Common.ColorValues() Protected
Shared WIDTH_Textbox As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_Textbox2buttons As New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_Button As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_TitleCell As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_InformationCell As New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_TitleCellFillSpace As New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_InformationCellFillSpace
As New System.Web.UI.WebControls.Unit() Protected
Shared HEIGHT_Button As
New System.Web.UI.WebControls.Unit() Protected
Shared HEIGHT_Cell As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column1 As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column2 As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column3 As
New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column1Long As New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column2Long As New System.Web.UI.WebControls.Unit() Protected
Shared WIDTH_3Column3Long As New System.Web.UI.WebControls.Unit() Protected
Shared SPACE_FillSpace As
String Protected Shared TEXTBOX_NeedsSearch As
String Protected
Shared TEXTBOX_Search As
String Protected
Shared TEXTBOX_SearchPerson As String Private
Shared HasConstructorExecuted As String '*----------------------------------------------* '* Common.New * '* ~~~~~~~~~~ * '*
Constructor, initialise values.
* '*----------------------------------------------* Sub New() '*---------------* '* Common values * '*---------------* If Not HasConstructorExecuted
= "UniqueValue" Then WIDTH_Textbox =
System.Web.UI.WebControls.Unit.Pixel(602 - 65) WIDTH_Textbox2buttons
= System.Web.UI.WebControls.Unit.Pixel(602 - 65 - 65) WIDTH_Button = System.Web.UI.WebControls.Unit.Pixel(65) HEIGHT_Button =
System.Web.UI.WebControls.Unit.Pixel(22) HEIGHT_Cell = System.Web.UI.WebControls.Unit.Pixel(24) WIDTH_TitleCell
= System.Web.UI.WebControls.Unit.Pixel(139) WIDTH_TitleCellFillSpace
= System.Web.UI.WebControls.Unit.Pixel(139 + 8) WIDTH_InformationCell
= System.Web.UI.WebControls.Unit.Pixel(602) WIDTH_InformationCellFillSpace
= System.Web.UI.WebControls.Unit.Pixel(602 + 8) WIDTH_3Column1 =
System.Web.UI.WebControls.Unit.Pixel(292) WIDTH_3Column2 =
System.Web.UI.WebControls.Unit.Pixel(292) WIDTH_3Column3 =
System.Web.UI.WebControls.Unit.Pixel(148) WIDTH_3Column1Long
= System.Web.UI.WebControls.Unit.Pixel(300) WIDTH_3Column2Long
= System.Web.UI.WebControls.Unit.Pixel(300) WIDTH_3Column3Long
= System.Web.UI.WebControls.Unit.Pixel(156) SPACE_FillSpace
= "<font class='basicfont'> </font>" TEXTBOX_NeedsSearch
= "No value, please use the search function. (Mandatory)" TEXTBOX_Search =
"No value, please use the search function." TEXTBOX_SearchPerson
= "If you do not search then hours will be added to your tally" HasConstructorExecuted
= "UniqueValue" End If End
Sub '*----------------------------------------------* '* Common.CheckLoggedIn * '* ~~~~~~~~~~~~~~~~~~~~ * '*
Check that there is a user logged in
* '*----------------------------------------------* Public
Sub CheckLoggedIn() '*------------------------* '* Check session variable * '*------------------------* 'hack 'Session("UserID") = 5470 If Not IsNumeric(Session("UserID"))
Then '**** User is not logged in - back to login **** 'Page.SmartNavigation = False Response.Redirect("PAGE_Login.aspx") End If End Sub '*----------------------------------------------* '* Common.IsManager * '* ~~~~~~~~~~~~~~~~ * '*
Redirect to login if no access, return
* '*
True or false otherwise
* '*----------------------------------------------* Public
Function IsManager(ByVal
ValuationID As Integer)
As Boolean '**** Instance of data tier object **** Dim DbTier As New Valuations.DBTier.ValuationsDB() '*------------------------------* '* check if the user has access * '*------------------------------* If Not DbTier.CheckIfPersonCanAccessValuation(ValuationID,
CInt(Session("UserID"))) Then Response.Redirect("PAGE_Login.aspx?Error=NoAccess") End If If DbTier.CheckIfPersonManagesValuation(ValuationID,
CInt(Session("UserID"))) Then IsManager = True Else IsManager = False End If End
Function '*----------------------------------------------* '* Common.BasicHeading * '* ~~~~~~~~~~~~~~~~~~~ * '*
A Basic Heading (1 Column)
* '*----------------------------------------------* Sub
BasicHeading(ByVal Title As String, ByVal ColumnSpan As
Integer, ByVal RowNumber
As Integer,
ByVal Table As Table) '*-----------------* '* Add Heading row * '*-----------------* Table.Rows(RowNumber).Cells(0).BackColor
= System.Drawing.Color.FromArgb(255, Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green,
Colors.HEADINGBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(0).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green,
Colors.HEADINGFORECOLOR_Blue) Table.Rows(RowNumber).Cells(0).Text
= "<div align=center><b>" & Title & "</b></div>" Table.Rows(RowNumber).Cells(0).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(0).ColumnSpan
= 2 Table.Rows(RowNumber).Cells(0).Height
= HEIGHT_Cell Table.Rows(RowNumber).Cells(0).VerticalAlign
= VerticalAlign.Middle End
Sub '*----------------------------------------------* '* Common.BasicRow * '* ~~~~~~~~~~~~~~~ * '*
A Basic Row (2 Columns)
* '*----------------------------------------------* Sub
BasicRow(ByVal Title As
String, ByVal
RowText As String,
ByVal RowNumber As
Integer, ByVal
Table As Table) '*---------* '* Add Row * '*---------* Table.Rows(RowNumber).Cells(0).BackColor =
System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEBACKCOLOR_Red,
Colors.GENERALTITLEBACKCOLOR_Green, Colors.GENERALTITLEBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(0).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEFORECOLOR_Red,
Colors.GENERALTITLEFORECOLOR_Green, Colors.GENERALTITLEFORECOLOR_Blue) Table.Rows(RowNumber).Cells(0).Text
= "<b>" & Title & "</b>" Table.Rows(RowNumber).Cells(0).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(0).Width
= WIDTH_TitleCell Table.Rows(RowNumber).Cells(0).Height
= HEIGHT_Cell Table.Rows(RowNumber).Cells(1).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONBACKCOLOR_Red,
Colors.GENERALINFORMATIONBACKCOLOR_Green, Colors.GENERALINFORMATIONBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(1).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONFORECOLOR_Red,
Colors.GENERALINFORMATIONFORECOLOR_Green, Colors.GENERALINFORMATIONFORECOLOR_Blue) Table.Rows(RowNumber).Cells(1).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(1).Width
= WIDTH_InformationCell Table.Rows(RowNumber).Cells(1).Text = RowText End
Sub '*----------------------------------------------* '* Common.BasicRow1Column * '* ~~~~~~~~~~~~~~~~~~~~~~ * '*
A Basic Row (1 Column)
* '*----------------------------------------------* Sub
BasicRow1Column(ByVal RowText As String, ByVal RowNumber As Integer, ByVal Table
As Table) '*---------* '* Add Row * '*---------* Table.Rows(RowNumber).Cells(0).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONBACKCOLOR_Red,
Colors.GENERALINFORMATIONBACKCOLOR_Green, Colors.GENERALINFORMATIONBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(0).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONFORECOLOR_Red,
Colors.GENERALINFORMATIONFORECOLOR_Green, Colors.GENERALINFORMATIONFORECOLOR_Blue) Table.Rows(RowNumber).Cells(0).Text
= RowText Table.Rows(RowNumber).Cells(0).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(0).Height
= HEIGHT_Cell End
Sub '*----------------------------------------------* '* Common.BasicRowWithFillSpace * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Basic Row (1 Column)
* '*----------------------------------------------* Sub
BasicRowWithFillSpace(ByVal Title As String, ByVal RowText As String, ByVal RowNumber
As Integer,
ByVal Table As
Table) '*---------* '* Add Row * '*---------* Table.Rows(RowNumber).Cells(0).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEBACKCOLOR_Red,
Colors.GENERALTITLEBACKCOLOR_Green, Colors.GENERALTITLEBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(0).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEFORECOLOR_Red,
Colors.GENERALTITLEFORECOLOR_Green, Colors.GENERALTITLEFORECOLOR_Blue) Table.Rows(RowNumber).Cells(0).Text
= SPACE_FillSpace & "<b>" & Title & "</b>" Table.Rows(RowNumber).Cells(0).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(0).Width
= WIDTH_TitleCellFillSpace Table.Rows(RowNumber).Cells(0).Height
= HEIGHT_Cell Table.Rows(RowNumber).Cells(1).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONBACKCOLOR_Red,
Colors.GENERALINFORMATIONBACKCOLOR_Green, Colors.GENERALINFORMATIONBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(1).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONFORECOLOR_Red,
Colors.GENERALINFORMATIONFORECOLOR_Green, Colors.GENERALINFORMATIONFORECOLOR_Blue) Table.Rows(RowNumber).Cells(1).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(1).Width
= WIDTH_InformationCellFillSpace Table.Rows(RowNumber).Cells(1).Text
= SPACE_FillSpace & RowText End
Sub '*----------------------------------------------* '* Common.BasicRowWithFillSpaceControl * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Basic Row (1 Column) with a control
* '*----------------------------------------------* Sub
BasicRowWithFillSpaceControl(ByVal Title
As String, ByVal RowNumber As Integer, ByVal Table
As Table) '*---------* '* Add Row * '*---------* Table.Rows(RowNumber).Cells(0).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEBACKCOLOR_Red,
Colors.GENERALTITLEBACKCOLOR_Green, Colors.GENERALTITLEBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(0).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEFORECOLOR_Red,
Colors.GENERALTITLEFORECOLOR_Green, Colors.GENERALTITLEFORECOLOR_Blue) Table.Rows(RowNumber).Cells(0).Text
= SPACE_FillSpace & "<b>" & Title & "</b>" Table.Rows(RowNumber).Cells(0).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(0).Width
= WIDTH_TitleCellFillSpace Table.Rows(RowNumber).Cells(0).Height
= HEIGHT_Cell Table.Rows(RowNumber).Cells(1).BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONBACKCOLOR_Red,
Colors.GENERALINFORMATIONBACKCOLOR_Green, Colors.GENERALINFORMATIONBACKCOLOR_Blue) Table.Rows(RowNumber).Cells(1).ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONFORECOLOR_Red,
Colors.GENERALINFORMATIONFORECOLOR_Green, Colors.GENERALINFORMATIONFORECOLOR_Blue) Table.Rows(RowNumber).Cells(1).BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Table.Rows(RowNumber).Cells(1).Width
= WIDTH_InformationCellFillSpace End
Sub '*----------------------------------------------* '* Common.HeadingRowDynamic * '* ~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Basic Dynamic Heading (1 Column)
* '*----------------------------------------------* Sub
HeadingRowDynamic(ByVal Title As String, ByVal Table As Table) '*-----------------* '* Add Heading Row * '*-----------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & Title & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.ColumnSpan = 2 Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.BasicRowDynamic * '* ~~~~~~~~~~~~~~~~~~~~~~ * '*
A Basic Dynamic Row (2 Columns)
* '*----------------------------------------------* Sub
BasicRowDynamic(ByVal Title As String, ByVal RowText As String, ByVal Table
As Table) '*---------* '* Add Row * '*---------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALTITLEBACKCOLOR_Red, Colors.GENERALTITLEBACKCOLOR_Green,
Colors.GENERALTITLEBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALTITLEFORECOLOR_Red, Colors.GENERALTITLEFORECOLOR_Green,
Colors.GENERALTITLEFORECOLOR_Blue) Cell1.Text = "<b>"
& Title & "</b>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Width = WIDTH_TitleCell Cell1.Height = HEIGHT_Cell Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = RowText Cell1.Width = WIDTH_InformationCell Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.HeadingRowDynamic3Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Heading (3 Column)
* '*----------------------------------------------* Sub
HeadingRowDynamic3Column(ByVal TitleColumn1
As String, ByVal TitleColumn2 As
String, ByVal
TitleColumn3 As String,
ByVal Table As
Table) '*-----------------* '* Add Heading Row * '*-----------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn1 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Cell1.Width = WIDTH_3Column1 Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn2 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column2 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn3 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column3 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.HeadingRowDynamic3ColumnLeftAlign * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Heading (3 Column) lift aligned
* '*----------------------------------------------* Sub
HeadingRowDynamic3ColumnLeftAlign(ByVal
TitleColumn1 As String,
ByVal TitleColumn2 As
String, ByVal
TitleColumn3 As String,
ByVal Table As
Table) '*-----------------* '* Add Heading Row * '*-----------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=left><b>" & TitleColumn1 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Cell1.Width = WIDTH_3Column1 Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=left><b>" & TitleColumn2 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column2 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=lefy><b>" & TitleColumn3 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column3 Cell1.VerticalAlign = VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.HeadingRowDynamic3ColumnLong * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Heading (3 Column)
* '*----------------------------------------------* Sub
HeadingRowDynamic3ColumnLong(ByVal TitleColumn1
As String,
ByVal TitleColumn2 As
String, ByVal
TitleColumn3 As String,
ByVal Table As
Table) '*-----------------* '* Add Heading Row * '*-----------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn1 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign = VerticalAlign.Middle Cell1.Width = WIDTH_3Column1Long Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn2 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column2Long Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn3 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column3Long Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.RowDynamic3Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Row (3 Column)
* '*----------------------------------------------* Sub
RowDynamic3Column(ByVal TextColumn1
As String, ByVal TextColumn2 As
String, ByVal TextColumn3
As String,
ByVal Table As
Table) '*----------* '* Add Row * '*----------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = TextColumn1 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Cell1.Width = WIDTH_3Column1 Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = TextColumn2 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column2 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = TextColumn3 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column3 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.RowDynamic1Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Row (1 Column)
* '*----------------------------------------------* Sub
RowDynamic1Column(ByVal Text As String, ByVal ColumnSpan As
Integer, ByVal Table
As Table) '*---------* '* Add Row * '*---------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = "<div
align=center>" & Text & "</div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.ColumnSpan = 3 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.RowTotalDynamic2Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Total Row (2 Column)
* '*----------------------------------------------* Sub
RowTotalDynamic1Column(ByVal TotalTitle
As String, ByVal TotalAmount As
String, ByVal ColumnSpan
As Integer,
ByVal Table As
Table) '*---------------* '* Add Total Row * '*---------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALTITLEBACKCOLOR_Red, Colors.GENERALTITLEBACKCOLOR_Green,
Colors.GENERALTITLEBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255, Colors.GENERALTITLEFORECOLOR_Red,
Colors.GENERALTITLEFORECOLOR_Green, Colors.GENERALTITLEFORECOLOR_Blue) Cell1.Text = "<b>"
& TotalTitle & "</b>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.ColumnSpan = ColumnSpan Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALTITLEBACKCOLOR_Red, Colors.GENERALTITLEBACKCOLOR_Green,
Colors.GENERALTITLEBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALTITLEFORECOLOR_Red, Colors.GENERALTITLEFORECOLOR_Green,
Colors.GENERALTITLEFORECOLOR_Blue) Cell1.Text = TotalAmount Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.HeadingDynamic2Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Row (2 Column)
* '*----------------------------------------------* Sub
HeadingDynamic2Column(ByVal TitleColumn1
As String, ByVal TitleColumn2 As
String, ByVal
ColumnSpan As Integer,
ByVal Table As
Table) '*-----------------* '* Add Heading Row * '*-----------------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn1 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.ColumnSpan = ColumnSpan Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<div
align=center><b>" & TitleColumn2 & "</b></div>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.RowDynamic2Column * '* ~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Row (2 Column)
* '*----------------------------------------------* Sub
RowDynamic2Column(ByVal TextColumn1
As String, ByVal TextColumn2 As
String, ByVal ColumnSpan
As Integer,
ByVal Table As
Table) '*---------* '* Add Row * '*---------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = TextColumn1 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.ColumnSpan = ColumnSpan Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONBACKCOLOR_Red, Colors.GENERALINFORMATIONBACKCOLOR_Green,
Colors.GENERALINFORMATIONBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.GENERALINFORMATIONFORECOLOR_Red, Colors.GENERALINFORMATIONFORECOLOR_Green,
Colors.GENERALINFORMATIONFORECOLOR_Blue) Cell1.Text = TextColumn2 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.RowDynamic3ColumnWithColors * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
A Dynamic Row (3 Column) with colors
* '*----------------------------------------------* Sub
RowDynamic3ColumnWithColors(ByVal TextColumn1
As String, ByVal TextColumn2 As
String, ByVal TextColumn3
As String,
ByVal Table As
Table, ByVal BackColor As
System.Drawing.Color, ByVal ForeColor
As System.Drawing.Color) '*---------* '* Add Row * '*---------* Dim Row1 As New TableRow() Dim Cell1 As New TableCell() Cell1.BackColor = BackColor Cell1.ForeColor = ForeColor Cell1.Text = TextColumn1 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.VerticalAlign
= VerticalAlign.Middle Cell1.Width = WIDTH_3Column1 Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = BackColor Cell1.ForeColor = ForeColor Cell1.Text = TextColumn2 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column2 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Cell1 = New TableCell() Cell1.BackColor = BackColor Cell1.ForeColor = ForeColor Cell1.Text = TextColumn3 Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Cell1.Width = WIDTH_3Column3 Cell1.VerticalAlign
= VerticalAlign.Middle Row1.Cells.Add(Cell1) Table.Rows.Add(Row1) End
Sub '*----------------------------------------------* '* Common.SetDataGridColors * '* ~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Set datagrid colors
* '*----------------------------------------------* Sub
SetDataGridColors(ByVal DataGrid As DataGrid) '*---------------------* '* set datagrid colors * '*---------------------* DataGrid.HeaderStyle.BackColor
= System.Drawing.Color.FromArgb(255, Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green,
Colors.HEADINGBACKCOLOR_Blue) DataGrid.HeaderStyle.ForeColor
= System.Drawing.Color.FromArgb(255, Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green,
Colors.HEADINGFORECOLOR_Blue) DataGrid.ItemStyle.BackColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONBACKCOLOR_Red,
Colors.GENERALINFORMATIONBACKCOLOR_Green, Colors.GENERALINFORMATIONBACKCOLOR_Blue) DataGrid.ItemStyle.ForeColor
= System.Drawing.Color.FromArgb(255, Colors.GENERALINFORMATIONFORECOLOR_Red,
Colors.GENERALINFORMATIONFORECOLOR_Green, Colors.GENERALINFORMATIONFORECOLOR_Blue) End
Sub '*----------------------------------------------* '* Common.FillTable * '* ~~~~~~~~~~~~~~~~ * '*
fill table rows with particular row types
* '*----------------------------------------------* Sub
FillTable(ByRef Rows As
DataRowCollection, ByRef Columns As DataColumnCollection, ByRef
DbTier As Valuations.DbTier.ValuationsDB,
ByVal FORE_Red As Integer, ByVal FORE_Green
As Integer,
ByVal FORE_Blue As
Integer, ByVal
BACK_Red As Integer,
ByVal BACK_Green As
Integer, ByVal
BACK_Blue As Integer,
ByRef Table As
Table) '**** Instances of table and data elements and image string
**** Dim DR As DataRow Dim DC As DataColumn Dim Cell1 As TableCell Dim Row1 As TableRow Dim ImageText As String Dim COREds As DataSet '*----------------------------------------------------* '* Add data rows, by iterating through each one is ds * '*----------------------------------------------------* For Each DR In Rows Row1 = New TableRow() '**** Grab Address for CORE Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim CoreDataTier As
New CORE_Functions.DataTier.CORE_DataAccess(VALUATIONS_DBTier.COREConnectionString) COREds = CoreDataTier.GetPropertyAndClientInfo(CInt(DR.Item("PropertyID")),
CInt(DR.Item("Revision")),
CInt(DR.Item("Version")), CInt(DR.Item("ClientLegalEntityID")), CInt(DR.Item("ClientRevision")), CInt(DR.Item("ClientVersion")), CInt(DR.Item("CompanyLegalEntityID")), CInt(DR.Item("CompanyRevision")), CInt(DR.Item("CompanyVersion"))) For Each DC In Columns '*--------------------------------------------------* '* For each column, match and execute the following * '*--------------------------------------------------* Select Case (DC.ColumnName) Case "Address" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= COREds.Tables(0).Rows(0).Item(0).ToString '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Client" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= Trim(COREds.Tables(0).Rows(0).Item(1).ToString) & " - "
& Trim(COREds.Tables(0).Rows(0).Item(2).ToString) '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Due Date" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Width
= System.Web.UI.WebControls.Unit.Pixel(70) Cell1.Text
= ConvertDate(DR.Item(DC)) '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Position" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Width
= System.Web.UI.WebControls.Unit.Pixel(105) Cell1.Text
= DR.Item(DC).ToString '*----------------------------* '* Check if job is unassigned * '*----------------------------* If IsDBNull(DR.Item(DC)) Then Cell1.Text = "<b><i>Unassigned</i><b>" End If '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Job#" Cell1 = New
TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= "<a href ='PAGE_JobInformation.aspx?id=" & DR.Item(DC).ToString
& "'>" & DbTier.GetValuationCode(CInt(DR.Item(DC))) & "</a>" '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Percentage" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) '*-----------------------------* '* Check if % complete is null * '*-----------------------------* Dim Percentage As Integer If IsDBNull(DR.Item(DC)) Then Percentage
= 101 Else Percentage
= CInt(DR.Item(DC)) End If '*------------------------------------------* '* Select image gif depending on % complete * '*------------------------------------------* Select Case (Percentage) Case 0 To 9 ImageText
= "images\PB_0.gif" Case 10 To 19 ImageText
= "images\PB_10.gif" Case
20 To 29 ImageText
= "images\PB_20.gif" Case 30 To 39 ImageText
= "images\PB_30.gif" Case 40 To 49 ImageText
= "images\PB_40.gif" Case 50 To 59 ImageText
= "images\PB_50.gif" Case 60 To 69 ImageText
= "images\PB_60.gif" Case 70 To 79 ImageText
= "images\PB_70.gif" Case 80 To 89 ImageText = "images\PB_80.gif" Case 90 To 99 ImageText
= "images\PB_90.gif" Case 100 ImageText
= "images\PB_100.gif" Case 101 ImageText
= "images\PB_NA.gif" End Select '**** Insert % bar **** If Percentage > 100 Then Cell1.Text
= "<i><b>Not Applicable</b></i>" Else Cell1.Text
= "<image src='" & ImageText & "'> "
& Percentage.ToString & "%" End If Cell1.Width
= System.Web.UI.WebControls.Unit.Pixel(120) '**** Add cell to row **** Row1.Cells.Add(Cell1) End Select Cell1.BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Next '**** Add row to table **** Table.Rows.Add(Row1) Next End
Sub '*----------------------------------------------* '* Common.FillTableNoLink * '* ~~~~~~~~~~~~~~~~~~~~~~ * '*
fill table rows with particular row types
* '*----------------------------------------------* Sub
FillTableNoLink(ByRef Rows As DataRowCollection, ByRef
Columns As DataColumnCollection, ByRef DbTier As Valuations.DbTier.ValuationsDB,
ByVal FORE_Red As Integer, ByVal FORE_Green As
Integer, ByVal FORE_Blue
As Integer,
ByVal BACK_Red As
Integer, ByVal
BACK_Green As Integer,
ByVal BACK_Blue As
Integer, ByRef
Table As Table) '**** Instances of table and data elements and image string
**** Dim DR As DataRow Dim DC As DataColumn Dim Cell1 As TableCell Dim Row1 As TableRow Dim ImageText As String Dim COREds As DataSet '*----------------------------------------------------* '* Add data rows, by iterating through each one is ds * '*----------------------------------------------------* For Each DR In Rows Row1 = New TableRow() '**** Grab Address for CORE Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim CoreDataTier As
New CORE_Functions.DataTier.CORE_DataAccess(VALUATIONS_DBTier.COREConnectionString) COREds = CoreDataTier.GetPropertyAndClientInfo(CInt(DR.Item("PropertyID")),
CInt(DR.Item("Revision")),
CInt(DR.Item("Version")), CInt(DR.Item("ClientLegalEntityID")), CInt(DR.Item("ClientRevision")), CInt(DR.Item("ClientVersion")), CInt(DR.Item("CompanyLegalEntityID")), CInt(DR.Item("CompanyRevision")), CInt(DR.Item("CompanyVersion"))) For Each DC In Columns '*--------------------------------------------------* '* For each column, match and execute the following * '*--------------------------------------------------* Select Case (DC.ColumnName) Case "Address" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= COREds.Tables(0).Rows(0).Item(0).ToString '**** Add cell
to row **** Row1.Cells.Add(Cell1) Case "Client" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= Trim(COREds.Tables(0).Rows(0).Item(1).ToString) & " - "
& Trim(COREds.Tables(0).Rows(0).Item(2).ToString) '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Due Date" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Width = System.Web.UI.WebControls.Unit.Pixel(70) Cell1.Text
= ConvertDate(DR.Item(DC)) '**** Add cell to row **** Row1.Cells.Add(Cell1) Case
"Position" Cell1
= New TableCell() Cell1.BackColor
= System.Drawing.Color.FromArgb(255, BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Width
= System.Web.UI.WebControls.Unit.Pixel(105) Cell1.Text
= DR.Item(DC).ToString '*----------------------------* '* Check if job is unassigned * '*----------------------------* If IsDBNull(DR.Item(DC)) Then Cell1.Text
= "<b><i>Unassigned</i><b>" End If '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Job#" Cell1
= New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
BACK_Red, BACK_Green, BACK_Blue) Cell1.ForeColor
= System.Drawing.Color.FromArgb(255, FORE_Red, FORE_Green, FORE_Blue) Cell1.Text
= DbTier.GetValuationCode(CInt(DR.Item(DC))) '**** Add cell to row **** Row1.Cells.Add(Cell1) Case "Percentage" Cell1
= New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
BACK_Red, BACK_Green, BACK_Blue) '*-----------------------------* '* Check if % complete is null * '*-----------------------------* Dim Percentage As Integer If IsDBNull(DR.Item(DC)) Then Percentage
= 101 Else Percentage
= CInt(DR.Item(DC)) End If '*------------------------------------------* '* Select image gif depending on % complete * '*------------------------------------------* Select Case (Percentage) Case 0 To 9 ImageText
= "images\PB_0.gif" Case
10 To 19 ImageText
= "images\PB_10.gif" Case 20 To 29 ImageText
= "images\PB_20.gif" Case 30 To 39 ImageText
= "images\PB_30.gif" Case 40 To 49 ImageText
= "images\PB_40.gif" Case 50 To 59 ImageText = "images\PB_50.gif" Case 60 To 69 ImageText
= "images\PB_60.gif" Case 70 To 79 ImageText
= "images\PB_70.gif" Case 80 To 89 ImageText
= "images\PB_80.gif" Case 90 To 99 ImageText
= "images\PB_90.gif" Case 100 ImageText
= "images\PB_100.gif" Case 101 ImageText
= "images\PB_NA.gif" End Select '**** Insert % bar **** If Percentage > 100 Then Cell1.Text
= "<i><b>Not Applicable</b></i>" Else Cell1.Text
= "<image src='" & ImageText & "'> "
& Percentage.ToString & "%" End If Cell1.Width
= System.Web.UI.WebControls.Unit.Pixel(120) '**** Add cell to row **** Row1.Cells.Add(Cell1) End Select Cell1.BorderWidth
= System.Web.UI.WebControls.Unit.Pixel(0) Next '**** Add row to table **** Table.Rows.Add(Row1) Next End
Sub '*----------------------------------------------* '* Common.HeadingDynamicCellVariableWidth * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Generate a heading column with var. width
* '*----------------------------------------------* Sub
HeadingDynamicCellVariableWidth(ByVal
Title As String, ByVal Width As Integer, ByRef Row As TableRow) '*-------------* '* Add Heading * '*-------------* Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<b>"
& Title & "</b>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Width = System.Web.UI.WebControls.Unit.Pixel(Width) Cell1.Height = HEIGHT_Cell Row.Cells.Add(Cell1) End
Sub '*----------------------------------------------* '* Common.HeadingDynamicCellNoWidth * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Generate a heading column with var. width
* '*----------------------------------------------* Sub
HeadingDynamicCellNoWidth(ByVal Title
As String, ByRef Row As TableRow) '*-------------* '* Add Heading * '*-------------* Dim Cell1 As New TableCell() Cell1.BackColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGBACKCOLOR_Red, Colors.HEADINGBACKCOLOR_Green, Colors.HEADINGBACKCOLOR_Blue) Cell1.ForeColor = System.Drawing.Color.FromArgb(255,
Colors.HEADINGFORECOLOR_Red, Colors.HEADINGFORECOLOR_Green, Colors.HEADINGFORECOLOR_Blue) Cell1.Text = "<b>"
& Title & "</b>" Cell1.BorderWidth =
System.Web.UI.WebControls.Unit.Pixel(0) Cell1.Height = HEIGHT_Cell Row.Cells.Add(Cell1) End
Sub '*----------------------------------------------* '* Common.ConvertDate * '* ~~~~~~~~~~~~~~~~~~ * '*
convert to dd/mm/yyyy
* '*----------------------------------------------* Function
ConvertDate(ByVal TheDate As Date) As String ConvertDate = Day(TheDate)
& "/" & Month(TheDate) & "/" & Year(TheDate) End
Function '*----------------------------------------------* '* Common.Money * '* ~~~~~~~~~~~~ * '*
convert to $xx.xx
* '*----------------------------------------------* Function Money(ByVal TheValue As String) As String If IsNumeric(TheValue) Then Money = FormatCurrency(TheValue,
2) Else Money = TheValue End If End
Function End
Class ' ,
, ' /
\/ \ ' (/
//_ \_ ' .-._ \|| . \ ' \ '-._
_,:__.-"/---\_ \ '
______/___ '. .--------------------'~-'--.)__( , )\ \ '`'--.___ _\ /
| FillFunctions ,' \)|\ `\| ' /_.-' _\ \ _:,_ ~~~~~~~~~~~~~ "
|| ( ' .'__ _.' \'-/,`-~` Filling Drop Dows, TB's,
etc. |/ ' '. ___.> /=,| | ' / .-'/_ ) '---------------------------------' ' )' (
/(/ Riley_Perry@hotmail.com ' \\ " ' '==' ' Class
FillFunctions '*----------------------------------------------* '* FillFunctions.VALUATIONS_FillMainType
* '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* '*
Fill a main type Drop-Down
* '*----------------------------------------------* Sub
VALUATIONS_FillMainType(ByVal Name As String, ByVal DropDownList As
System.Web.UI.WebControls.DropDownList) Dim ds As New DataSet() '**** Fill Drop Downs **** Dim DataTier As New Valuations.DBTier.ValuationsDB() '*----------------* '* Property/Plant * '*----------------* ds = DataTier.GetMainTypes(Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.VALUATIONS_FillSubType * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* '*
Fill a subtype Drop-Down.
* '*----------------------------------------------* Sub
VALUATIONS_FillSubType(ByVal SelectedItem
As Integer, ByVal Name As String, ByVal DropDownList
As System.Web.UI.WebControls.DropDownList) '**** Fill Drop Downs **** Dim ds As New DataSet() Dim DataTier As New Valuations.DBTier.ValuationsDB() '*----------------* '* Property/Plant * '*----------------* ds = DataTier.GetSubTypes(SelectedItem,
Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items
individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.PEOPLE_FillSubType * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Fill a subtype Drop-Down.
* '*----------------------------------------------* Sub
PEOPLE_FillSubType(ByVal SelectedItem
As Integer, ByVal Name As String, ByVal DropDownList
As System.Web.UI.WebControls.DropDownList) '**** Fill Drop Downs **** Dim ds As New DataSet() '**** Instance of data tier as user id var.**** Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim PEOPLE_DBTier As
New PEOPLE_Functions.DataTier.PEOPLE_DataAccess(VALUATIONS_DBTier.ConnectionString) '*----------------* '* Property/Plant * '*----------------* ds = PEOPLE_DBTier.GetSubTypes(SelectedItem,
Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items
individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.PEOPLE_FillMainType * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Fill a main type Drop-Down
* '*----------------------------------------------* Sub
PEOPLE_FillMainType(ByVal Name As String, ByVal DropDownList As
System.Web.UI.WebControls.DropDownList) Dim ds As New DataSet() '**** Instance of data tier as user id var.**** Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim PEOPLE_DBTier As
New PEOPLE_Functions.DataTier.PEOPLE_DataAccess(VALUATIONS_DBTier.ConnectionString) '**** Fill Drop Downs **** '*----------------* '* Property/Plant * '*----------------* ds = PEOPLE_DBTier.GetMainTypes(Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items individually Dim li
As New
ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.PEOPLE_FillSubTypeWithAny * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Fill a subtype Drop-Down.
* '*----------------------------------------------* Sub
PEOPLE_FillSubTypeWithAny(ByVal SelectedItem
As Integer, ByVal Name As String, ByVal DropDownList
As System.Web.UI.WebControls.DropDownList) '**** Fill Drop Downs **** Dim ds As New DataSet() '**** Instance of data tier as user id var.**** Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim PEOPLE_DBTier As
New PEOPLE_Functions.DataTier.PEOPLE_DataAccess(VALUATIONS_DBTier.ConnectionString) '*----------------* '* Property/Plant * '*----------------* ds = PEOPLE_DBTier.GetSubTypesWithAny(SelectedItem,
Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items
individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.PEOPLE_FillMainTypeWithAny * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Fill a main type Drop-Down
* '*----------------------------------------------* Sub
PEOPLE_FillMainTypeWithAny(ByVal Name
As String, ByVal DropDownList As
System.Web.UI.WebControls.DropDownList) Dim ds As New DataSet() '**** Instance of data tier as user id var.**** Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim PEOPLE_DBTier As
New PEOPLE_Functions.DataTier.PEOPLE_DataAccess(VALUATIONS_DBTier.ConnectionString) '**** Fill Drop Downs **** '*----------------* '* Property/Plant * '*----------------* ds = PEOPLE_DBTier.GetMainTypesWithAny(Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.WORKFLOW_FillMainType * '* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * '*
Fill a main type Drop-Down
* '*----------------------------------------------* Sub
WORKFLOWS_FillMainType(ByVal Name As String, ByVal DropDownList As
System.Web.UI.WebControls.DropDownList) Dim ds As New DataSet() '**** Instance of data tier as user id var.**** Dim VALUATIONS_DBTier As
Valuations.DBTier.DBHelper Dim WORKFLOWS_DBTier As
New WORKFLOWS_Functions.DataTier.WORKFLOWS_DataAccess(VALUATIONS_DBTier.ConnectionString) '**** Fill Drop Downs **** '*----------------* '* Property/Plant * '*----------------* ds = WORKFLOWS_DBTier.GetMainTypes(Name) '**** Remove all entires **** DropDownList.Items.Clear() '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim dr As DataRow For Each dr In ds.Tables(0).Rows '**** Add Items individually Dim li As New ListItem() li.Value = dr.Item(0).ToString li.Text = dr.Item(1).ToString DropDownList.Items.Add(li) Next End
Sub '*----------------------------------------------* '* FillFunctions.RtrnInx * '* ~~~~~~~~~~~~~~~~~~~~~ * '*
return index of a drop down Selected value
* '*----------------------------------------------* Function
ReturnIndex(ByVal Value As Integer, ByVal DropDownList As
System.Web.UI.WebControls.DropDownList) As
Integer '*--------------------------------------------* '* Iterate through and add items individually * '*--------------------------------------------* Dim li As ListItem Dim ReturnValue As Integer = -1 For Each li In DropDownList.Items If Value = li.Value Then ReturnValue
= DropDownList.Items.IndexOf(li) End If Next ReturnIndex = ReturnValue End
Function End
Class End Namespace |