New programmer needs some help....

jhunsi

Newcomer
Joined
Aug 31, 2012
Messages
2
Hey guys i'm new to the forum here and pretty new to programming so go easy on me.

I run a sharepoint site for the company I work for and we ran into an issue this morning. Currently using SP2010 and VS2010 for the coding. We are only running into problems with this one site. Everything else is running fine. Any help or suggestions on this would be grealy appreciated.

Jeff

Location / Description:
5 MScorlib Thread was being aborted.
Code:
Imports System
Imports System.Data
Imports Microsoft.SharePoint
Public Class TSHome
    Inherits System.Web.UI.Page
    Protected WithEvents gvAnnouncementLibrary As GridView
    Protected WithEvents gvPolicies As GridView
    Protected WithEvents gvProcedures As GridView
    Protected WithEvents gvBreaks As GridView
    Protected WithEvents gvSuperstars As GridView
    Protected WithEvents imgAnnouncementSearch As ImageButton
    Protected pnlDocuments As Panel
    Protected hylEmail As HyperLink
    Protected hylShift As HyperLink
    Protected WithEvents ibtnBreak As ImageButton
    Protected WithEvents ibtnHoliday As ImageButton
    Protected WithEvents ibtnLunch As ImageButton
    Protected WithEvents ibtnSchedule As ImageButton
    Protected WithEvents ibtnShifts As ImageButton
    Protected lblBreaksheet As Label
    Protected pnlBreak As Panel
    Protected WithEvents drpBreak As DropDownList
    Protected pnlLunch As Panel
    Protected lblLunch As Label
    Protected WithEvents btnHideLunch As Button
    Protected WithEvents btnHideBreaks As Button
    Protected WithEvents btnAllAnnouncements As Button
    Protected WithEvents txtAnnouncementSearch As TextBox
    Protected imgSuperStar As Image
    Protected imgSuperStar2 As Image
    Protected pnlDayOff As Panel
    Protected WithEvents btnHideTorf As Button
    Protected lblTorfMessage As Label
    Protected lblOffCount As Label
    'Protected lblSuperstar As Label
    Protected imgSuperStar3 As Image
    Protected imgShifts As Image
    Protected WithEvents btnSSPosting As Button

    Protected pnlShifts As Panel
    Protected WithEvents btnAccept As Button
    Protected WithEvents gvMyShifts As GridView
    Protected lblShiftName As Label
    Protected imgShift As Image
    Protected imgECG As Image
    Protected hylECG As HyperLink
    '// Production Site Address //
    Private sSite As String = "http://mednet-spoint/" & "TechnicalServices/"
    Private sStaffSite As String = "http://mednet-spoint/"
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Me.IsPostBack = False Then
            Try
                imgSuperStar.ImageUrl = sSite & "Icons/SuperStar.jpg"
                imgSuperStar2.ImageUrl = sSite & "Icons/SuperStars.png"
                imgShifts.ImageUrl = sStaffSite & "Icons/ExtraCash.jpg"
                imgShift.ImageUrl = sStaffSite & "Icons/Remember.gif"
                imgECG.ImageUrl = sStaffSite & "Icons/CCT.png"
                AddPolicyImage(sSite & "Icons/Document1.gif")
                hylEmail.ImageUrl = sSite & "Icons/myEmail2.gif"
                hylEmail.NavigateUrl = sSite & "SitePages/myEmail.aspx"
                hylEmail.Target = "_parent"
                '//
                hylShift.NavigateUrl = sSite & "Shared%20Documents/Shifts.mht"
                hylShift.Target = "_search"
                '//
                hylECG.NavigateUrl = "/_layouts/MednetSPSub/Strips.aspx"
                hylECG.Target = "_search"
                '//
                ibtnBreak.ImageUrl = sSite & "Icons/Pen2.gif"
                ibtnHoliday.ImageUrl = sSite & "Icons/Calendar3.gif"
                ibtnSchedule.ImageUrl = sSite & "Icons/Clock.gif"
                ibtnLunch.ImageUrl = sSite & "Icons/Lunch2.gif"
                ibtnShifts.ImageUrl = sStaffSite & "Icons/Payroll.gif"
                LoadTimes(drpBreak)
                ShowPolicies()
                ShowProcedures()
                pnlBreak.Visible = False
                pnlLunch.Visible = False
                pnlDayOff.Visible = False
                imgAnnouncementSearch.ImageUrl = sSite & "Icons/View.gif"
                AddAnnouncementImage(sSite & "Icons/Process.gif")
                LoadAnnouncementLibrary()
                AddSuperstarImage(sSite & "Icons/Star1.gif")
                LoadSuperstars()
                'SuperstarMessage()
                CheckNewSSPosting()
                pnlShifts.Visible = False
                CheckForShifts()
            Catch ex As Exception
                Dim EMessage As String = "Location / Description:"
                Dim ELocation As String = Err.Number & " " & Err.Source & " " & Err.Description
                Response.Redirect("/_layouts/MednetSPSub/ReportError.aspx?EMessage=" & EMessage & "&ELocation=" & ELocation & "")
            End Try
        End If
    End Sub
    Private Sub CheckForShifts()
        Try
            Dim mySite = New SPSite(sSite)
            Dim myWeb As SPWeb = mySite.OpenWeb()
            Dim myList As SPList
            Dim dtTable As DataTable
            Dim myView As DataView

            myList = myWeb.Lists("ExtraShifts")
            If myList.ItemCount > 0 Then
                dtTable = myList.Items.GetDataTable
                myView = dtTable.DefaultView
                myView.RowFilter = "Status = 'Processed' And AckStatus = 'No' And ShiftStart >= '" & Today & "' And SignupId = '" & Replace(myWeb.CurrentUser.LoginName, "MEDNETHEALTH\", "") & "'"
                myView.Sort = "ShiftStart"
                If myView.Count > 0 Then
                    gvMyShifts.DataSource = myView
                    gvMyShifts.DataBind()
                    lblShiftName.Text = myView.Item(0)("SignupName").ToString
                    pnlShifts.Visible = True
                    Me.ViewState("USERID") = Replace(myWeb.CurrentUser.LoginName, "MEDNETHEALTH\", "")
                Else
                    pnlShifts.Visible = False
                End If
            End If
            '// TEST ERROR //
            'Err.Raise(911)
        Catch ex As Exception
            Dim EMessage As String = "Location / Description:"
            Dim ELocation As String = Err.Number & " " & Err.Source & " " & Err.Description
            Response.Redirect("/_layouts/MednetSPSub/ReportError.aspx?EMessage=" & EMessage & "&ELocation=" & ELocation & "")
        End Try
    End Sub
    Private Sub CheckNewSSPosting()
        Try
            Dim DocSite = New SPSite(sSite)
            Dim DocWeb As SPWeb = DocSite.OpenWeb()
            Dim DocList As SPList
            Dim DocTable As DataTable
            DocList = DocWeb.Lists("Superstars")
            DocTable = DocList.Items.GetDataTable
            DocTable.DefaultView.Sort = "Modified Desc, ID Desc"
            If DocTable.DefaultView.Item(0)("Splash") = "Yes" And DocTable.DefaultView.Item(0)("Modified") >= Today Then
                Me.ViewState("SSId") = DocTable.DefaultView.Item(0)("ID").ToString
                Select Case DocTable.DefaultView.Item(0)("Popup")
                    Case "YouDaTech"
                        imgSuperStar.ImageUrl = sSite & "Icons/SSSplash1.gif"
                        imgSuperStar3.ImageUrl = sSite & "Icons/SSSplash2.gif"
                    Case "Applause"
                        imgSuperStar.ImageUrl = sSite & "Icons/SSSplash3.gif"
                        imgSuperStar3.ImageUrl = sSite & "Icons/SSSplash4.gif"
                    Case "GoTeam"
                        imgSuperStar.ImageUrl = sSite & "Icons/SSSplash5.gif"
                        imgSuperStar3.ImageUrl = sSite & "Icons/SSSplash6.gif"
                    Case Else
                        imgSuperStar.ImageUrl = sSite & "Icons/SuperStar.jpg"
                        imgSuperStar3.Visible = False
                        btnSSPosting.Visible = False
                End Select
            Else
                imgSuperStar.ImageUrl = sSite & "Icons/SuperStar.jpg"
                imgSuperStar3.Visible = False
                btnSSPosting.Visible = False
            End If
        Catch ex As Exception
            Dim EMessage As String = "Location / Description:"
            Dim ELocation As String = Err.Number & " " & Err.Source & " " & Err.Description
            Response.Redirect("/_layouts/MednetSPSub/ReportError.aspx?EMessage=" & EMessage & "&ELocation=" & ELocation & "")
        End Try
    End Sub
 
Last edited by a moderator:
Back
Top