" & dtwidgetDetails.Rows(0)("BodyContent") & " |
Monday, November 21, 2011
Widget Application Part 2
Partial Class Widget
Inherits System.Web.UI.Page
Dim objclsDatabaseLayer As New ALTO.clsDatabaseLayer
Dim stqry As String = String.Empty
Public GroupID As Integer
Public userSelectionList As CheckBoxList
Dim FileContents As String = String.Empty
Private glbName As ALTO.GetNameFunctions
Public BackGroundColorImage As String
Public BackGroundColorImageType As Int32
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AjaxPro.Utility.RegisterTypeForAjax(GetType(CLAS.ClassroomAjaxFunctions))
GroupID = ALTO.Encryption.Utils.DecryptValue(Request.QueryString("GroupId"))
'Set BackGround Color/Image.
Dim dtRecords As DataTable = objclsDatabaseLayer.ExecuteProcedure(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, "DL_GlobalGetAllFields_Condition", "@TableName", "WidgetsHomeBackground", ParameterDirection.Input, "@IDFieldName", "GroupID", ParameterDirection.Input, "@IDFieldValue", ALTO.Encryption.Utils.DecryptValue(Request.QueryString("GroupID")), ParameterDirection.Input, "@OrderBy", "0", ParameterDirection.Input, "@IDFieldCharValue", " ", ParameterDirection.Input)
BackGroundColorImageType = dtRecords.Rows(0).Item("Type")
If IsDBNull(dtRecords.Rows(0).Item("BackGroundColor")) = False Then
BackGroundColorImage = dtRecords.Rows(0).Item("BackGroundColor")
End If
If IsDBNull(dtRecords.Rows(0).Item("BackGroundImagePath")) = False Then
BackGroundColorImage = dtRecords.Rows(0).Item("BackGroundImagePath").ToString().Replace("../", "")
End If
hidWholeColor.Value = dtRecords.Rows(0).Item("WholeBackGroundColor")
LoadCuteDetails()
LoadWidgets()
End Sub
Public Sub LoadCuteDetails()
Dim dtContent As DataTable = objclsDatabaseLayer.ExecuteProcedure(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, _
"DL_GroupHomePageGetContent", _
"@GroupID", GroupID, ParameterDirection.Input)
If dtContent.Rows.Count > 0 Then
FileContents = dtContent.Rows(0)("FileContents").ToString()
'For Documents and Page Hit Report'
Dim objCommonFunction As New ALTO.commonfunction
objCommonFunction.insertDocLog(dtContent.Rows(0)("ContentPageID"), 0, dtContent.Rows(0)("ContentName"), "O", GroupID, "WHP")
'End Here
End If
glbName = New ALTO.GetNameFunctions()
FileContents = Regex.Replace(FileContents, "username", "username", RegexOptions.IgnoreCase)
FileContents = Regex.Replace(FileContents, "firstname", "firstname", RegexOptions.IgnoreCase)
FileContents = Regex.Replace(FileContents, "lastname", "lastname", RegexOptions.IgnoreCase)
FileContents = FileContents.Replace("[username]", glbName.getLoginName(Session("user_id")))
FileContents = FileContents.Replace("[firstname]", glbName.getFirstName(Session("user_id")))
FileContents = FileContents.Replace("[lastname]", glbName.getLastName(Session("user_id")))
divBanner.InnerHtml = FileContents
End Sub
Public Sub LoadWidgets()
Try
Dim stqry As String
stqry = "SELECT DISTINCT ColumnNo FROM Userwidgets WHERE UserId=" & Session("user_id") & " AND GroupId= " & GroupID & " ORDER BY ColumnNo "
Dim dt As DataTable = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, stqry)
Dim strmain As String = String.Empty
Dim i, j As Int32
Dim objDiv As HtmlGenericControl
Dim objDivChild As HtmlGenericControl
'For BackGround Color.
stqry = "SELECT count(*) FROM Userwidgets WHERE IsShow =1 AND UserId=" & Session("user_id") & " AND GroupId= " & GroupID
Dim RecordCount As Int32 = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.ScalerValue, stqry)
For i = 0 To dt.Rows.Count - 1
objDiv = New HtmlGenericControl("div")
objDiv.Attributes.Add("class", "column")
objDiv.ID = dt.Rows(i)("ColumnNo")
If RecordCount > 0 Then
If BackGroundColorImageType = 1 Then
objDiv.Style.Add("background-color", BackGroundColorImage)
tdmain.Style.Add("background-color", BackGroundColorImage)
Else
objDiv.Style.Add("background-color", "transparent")
tdmain.Style.Add("background-image", "url(" & BackGroundColorImage & ")")
End If
Else
divmain.Style.Add("height", "0px")
End If
stqry = "SELECT * FROM Userwidgets WHERE IsShow =1 and ColumnNo ='" & dt.Rows(i)("ColumnNo") & "' AND UserId=" & Session("user_id") & " AND GroupId= " & GroupID & " ORDER BY RowNo "
Dim dtInner As DataTable = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, stqry)
For j = 0 To dtInner.Rows.Count - 1
objDivChild = New HtmlGenericControl("div")
objDivChild.Attributes.Add("class", "dragbox")
objDivChild.ID = dtInner.Rows(j)("Widgetid")
Dim objh2 As New HtmlGenericControl("h2")
Dim objhyp As New HtmlGenericControl("a")
objhyp.InnerHtml = "Edit"
objhyp.Attributes.Add("class", "Edit")
Dim objImg As New System.Web.UI.WebControls.Image
objImg.Attributes.Add("class", "Close")
objImg.Width = 15
objImg.Height = 15
objImg.ImageUrl = "Images/Widgets/wrong_sign.png"
Dim objDivContent As New HtmlGenericControl("div")
objDivContent.Attributes.Add("class", "dragbox-content")
Dim obj As Object
stqry = " Select * FROM widgetDetails WHERE WidgetId=" & dtInner.Rows(j)("WidgetId")
Dim dtwidgetDetails As DataTable = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, stqry)
stqry = " Select FontFamily,FontColor,BackGroundColor,Size,IsBold,IsItalic from widgetstyle"
Dim dtwidgetStyle As DataTable = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, stqry)
If dtInner.Rows(j)("Title") = "My e-Learning Courses" Then
Dim tbl As New HtmlTable()
tbl.Style.Add("width", "306px")
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdEdit As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "261px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
objhyp.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
objcontent_div.Style.Add("display", "none")
obj = TryCast(Page.LoadControl("FunctionWidgets/eLearningTables.ascx"), FunctionWidgets_eLearningTables)
objcontent_div.Controls.Add(obj)
Dim objcontent_div1 As New HtmlGenericControl("div")
obj = TryCast(Page.LoadControl("FunctionWidgets/eLearningCourses.ascx"), FunctionWidgets_eLearningCourses)
objcontent_div1.Controls.Add(obj)
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objhyp.ID = "Edit" & dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objhyp.Style.Add("cursor", "pointer")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdEdit.Controls.Add(objhyp)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdEdit)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDivContent.Controls.Add(objcontent_div1)
objDiv.Controls.Add(objDivChild)
ElseIf dtInner.Rows(j)("Title") = "Media Monitor" Then
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "281px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
obj = TryCast(Page.LoadControl("FunctionWidgets/MediaMonitorControl.ascx"), FunctionWidgets_MediaMonitorControl)
objcontent_div.Controls.Add(obj)
objcontent_div.Style.Add("word-break", "keep-all")
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDiv.Controls.Add(objDivChild)
ElseIf dtInner.Rows(j)("Title") = "Clock" Then
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "281px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
'objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.ID = "clockID"
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
obj = TryCast(Page.LoadControl("FunctionWidgets/Clock.ascx"), FunctionWidgets_Clock)
objcontent_div.Controls.Add(obj)
If BackGroundColorImageType = 1 Then
objcontent_div.Style.Add("background-color", BackGroundColorImage)
Else
objcontent_div.Style.Add("background-image", "url(" & BackGroundColorImage & ")")
End If
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDiv.Controls.Add(objDivChild)
ElseIf dtInner.Rows(j)("Title") = "Forums" Then
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "281px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
obj = TryCast(Page.LoadControl("FunctionWidgets/AccessForumsWidget.ascx"), FunctionWidgets_AccessForumsWidget)
objcontent_div.Controls.Add(obj)
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDiv.Controls.Add(objDivChild)
ElseIf dtInner.Rows(j)("Title") = "Training Events And Programmes" Then
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "281px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
obj = TryCast(Page.LoadControl("FunctionWidgets/TrainingEventsAndProgrammes.ascx"), FunctionWidgets_TrainingEventsAndProgrammes)
objcontent_div.Controls.Add(obj)
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDiv.Controls.Add(objDivChild)
ElseIf dtInner.Rows(j)("Title") = "Compliance Course" Then
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdEdit As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "261px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
objhyp.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.Attributes.Add("class", "content-div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
objcontent_div.Style.Add("display", "none")
obj = TryCast(Page.LoadControl("FunctionWidgets/ComplianceWidgetTables.ascx"), FunctionWidgets_ComplianceWidgetTables_)
objcontent_div.Controls.Add(obj)
Dim objcontent_div1 As New HtmlGenericControl("div")
obj = TryCast(Page.LoadControl("FunctionWidgets/ComplianceWidgetCourses.ascx"), FunctionWidgets_ComplianceWidgetCourses)
objcontent_div1.Controls.Add(obj)
objDivChild.ID = dtInner.Rows(j)("WidgetId")
objhyp.ID = "Edit" & dtInner.Rows(j)("WidgetId")
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objhyp.Style.Add("cursor", "pointer")
objImg.Style.Add("cursor", "pointer")
tdH2.Controls.Add(objh2)
tdEdit.Controls.Add(objhyp)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdEdit)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDivContent.Controls.Add(objcontent_div1)
objDiv.Controls.Add(objDivChild)
Else
Dim tbl As New HtmlTable()
Dim tr As New HtmlTableRow()
Dim tdH2 As New HtmlTableCell()
Dim tdClose As New HtmlTableCell()
'tbl.Style.Add("border-bottom", "1px solid #eee")
tdH2.Style.Add("width", "281px")
tdH2.Style.Add("word-break", "break-all")
tdH2.Style.Add("word-wrap", "break-word")
Dim objcontent_div As New HtmlGenericControl("div")
objcontent_div.ID = "content-div" & dtInner.Rows(j)("WidgetId")
objcontent_div.Attributes.Add("class", "content-div")
'Html Widgets
Dim strHeading As String = String.Empty
Dim strSubHeading As String = String.Empty
Dim strFooter As String = String.Empty
If dtwidgetDetails.Rows(0)("IsHeadingOn") Then
objh2.InnerHtml = dtwidgetDetails.Rows(0)("Heading")
objh2.Style.Add("font-family", dtwidgetStyle.Rows(0)("FontFamily"))
objh2.Style.Add("color", dtwidgetStyle.Rows(0)("FontColor"))
tbl.Style.Add("background-color", dtwidgetStyle.Rows(0)("BackGroundColor"))
objh2.Style.Add("font-size", dtwidgetStyle.Rows(0)("Size"))
If dtwidgetStyle.Rows(0)("IsBold") Then
objh2.Style.Add("font-weight", "Bold")
Else
objh2.Style.Add("font-weight", "normal")
End If
If dtwidgetStyle.Rows(0)("IsItalic") Then
objh2.Style.Add("font-style", "italic")
Else
objh2.Style.Add("font-style", "normal")
End If
Else
objh2.InnerHtml = ""
End If
If dtwidgetDetails.Rows(0)("IsSubHeadingOn") Then
Dim FontWeightStyle As String = String.Empty
If dtwidgetStyle.Rows(1)("IsBold") Then
FontWeightStyle = "font-weight:Bold;"
Else
FontWeightStyle = "font-weight:normal;"
End If
If dtwidgetStyle.Rows(1)("IsItalic") Then
FontWeightStyle = FontWeightStyle & "font-style:italic;"
Else
FontWeightStyle = FontWeightStyle & "font-style:normal;"
End If
strSubHeading = "" & dtwidgetDetails.Rows(0)("SubHeading") & " "
Else
'strSubHeading = " "
End If
If dtwidgetDetails.Rows(0)("IsFooterOn") Then
Dim FontWeightStyle As String = String.Empty
If dtwidgetStyle.Rows(2)("IsBold") Then
FontWeightStyle = "font-weight:Bold;"
Else
FontWeightStyle = "font-weight:normal;"
End If
If dtwidgetStyle.Rows(2)("IsItalic") Then
FontWeightStyle = FontWeightStyle & "font-style:italic;"
Else
FontWeightStyle = FontWeightStyle & "font-style:normal;"
End If
strFooter = "" & dtwidgetDetails.Rows(0)("Footer") & " "
Else
'strFooter = " "
End If
Dim strdtwidgetDetails As String = String.Empty
strdtwidgetDetails = "" & strHeading & strSubHeading & _
"
"
objcontent_div.InnerHtml = strdtwidgetDetails
objcontent_div.Style.Add("word-break", "keep-all")
'End Here.
objImg.ID = "Close" & dtInner.Rows(j)("WidgetId")
objImg.Style.Add("cursor", "pointer")
objDivChild.ID = dtInner.Rows(j)("WidgetId")
tdH2.Controls.Add(objh2)
tdClose.Controls.Add(objImg)
tr.Controls.Add(tdH2)
tr.Controls.Add(tdClose)
tbl.Controls.Add(tr)
objDivChild.Controls.Add(tbl)
objDivChild.Controls.Add(objDivContent)
objDivContent.Controls.Add(objcontent_div)
objDiv.Controls.Add(objDivChild)
End If
Next
divmain.Controls.Add(objDiv)
Next
ShowWidgetStatusTable()
Catch ex As Exception
End Try
End Sub
Private Sub ShowWidgetStatusTable()
Try
Dim i As Integer
stqry = "SELECT Userwidgets.WidgetId,widgetDetails.Heading,Userwidgets.IsShow FROM Userwidgets" & _
" INNER JOIN widgetDetails ON widgetDetails.WidgetId =Userwidgets.WidgetId WHERE UserId=" & Session("user_id") & " AND GroupId= " & GroupID & " AND Userwidgets.widgetid NOT IN (1,2,3) ORDER BY Userwidgets.RowNo ,Userwidgets.ColumnNo "
Dim dtWidget As DataTable = objclsDatabaseLayer.ExecuteSQL(ALTO.clsDatabaseLayer.DbExecutionType.DataTable, stqry)
If dtWidget.Rows.Count > 0 Then
tdResetHomePage.Style.Add("display", "block")
userSelectionList = New CheckBoxList
userSelectionList.ID = "mylist"
userSelectionList.RepeatDirection = RepeatDirection.Horizontal
userSelectionList.CellPadding = 3
userSelectionList.CellSpacing = 10
userSelectionList.RepeatColumns = "3"
userSelectionList.RepeatLayout = RepeatLayout.Table
For i = 0 To dtWidget.Rows.Count - 1
Dim selectedItem As New ListItem(dtWidget.Rows(i)("Heading"), dtWidget.Rows(i)("WidgetId"))
selectedItem.Selected = CType(dtWidget.Rows(i)("IsShow"), Boolean)
selectedItem.Attributes.Add("ID", dtWidget.Rows(i)("WidgetId"))
userSelectionList.Items.Add(selectedItem)
Next
userSelectionList.Attributes.Add("onclick", "SetCheckedUnchecked();")
checkboxContainer.Controls.Add(userSelectionList)
End If
Catch ex As Exception
End Try
End Sub
Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
Response.Redirect("Widget.aspx?GroupId=" & Request.QueryString("GroupId"))
End Sub
End Class
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment