Error :- Nullable object must have a value.
-----------------------------------------------
Full Error:- at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable`1.get_Value() at System.Nullable`1.op_Explicit(Nullable`1 value) at Sharenote.UI.snCenter.GetNotes()
------------------GetNote()-----------------------------
Private Sub GetNotes()
Try
Dim staffID As Integer = CInt(ViewState("staffID"))
Dim locID As Integer = CInt(ViewState("locID"))
Dim startDate As Date = CDate(pickStartDate.SelectedDate).ToShortDateString
Dim endDate As Date = CDate(pickEndDate.SelectedDate).ToShortDateString & " 22:59:59"
Dim clientIDs As String = "0"
Dim staffIDs As String = "0"
Dim serviceIDs As String = "0"
Dim billingStatusIDs As String = "0"
Dim noteStatusIDs As String = "0"
Dim fundingSourceIDs As String = "0"
Dim caseLoadIDs As String = "0"
Dim locIDs As String = "0"
Dim snUser As ShareNoteUser = CType(ViewState("ShareNoteUser"), ShareNoteUser)
If Not snUser.Clients = "0" Then
caseLoadIDs = snUser.Clients.Replace(",", " ")
End If
If Not snUser.Locations = "0" Then
locIDs = snUser.Locations.Replace(",", " ")
End If
Dim ss As New NoteSearchSettings
If cbShowMulti.Checked = True Then
ss.SelectMulti = True
For Each li As ListItem In lbxClients.Items
If li.Selected = True Then
clientIDs = clientIDs & " " & li.Value
End If
Next
ss.ClientID = 0
For Each li As ListItem In lbxStaff.Items
If li.Selected = True Then
staffIDs = staffIDs & " " & li.Value
End If
Next
ss.StaffID = 0
For Each li As ListItem In lbxServices.Items
If li.Selected = True Then
serviceIDs = serviceIDs & " " & li.Value
End If
Next
ss.ServiceID = 0
For Each li As ListItem In lbxBillingStatuses.Items
If li.Selected = True Then
billingStatusIDs = billingStatusIDs & " " & li.Value
End If
Next
ss.BillingStatusID = 0
For Each li As ListItem In lbxNoteStatuses.Items
If li.Selected = True Then
noteStatusIDs = noteStatusIDs & " " & li.Value
End If
Next
ss.NoteStatusID = 0
For Each li As ListItem In lbxFundingSources.Items
If li.Selected = True Then
fundingSourceIDs = fundingSourceIDs & " " & li.Value
End If
Next
ss.FundSourceID = 0
Else
ss.SelectMulti = False
ss.BillingStatusID = ddlBillingStatuses.SelectedValue
ss.NoteStatusID = ddlNoteStatuses.SelectedValue
ss.FundSourceID = ddlFundSources.SelectedValue
If Not ddlServices.SelectedIndex = 0 And Not ddlServices.SelectedIndex = -1 Then
ss.ServiceID = ddlServices.SelectedValue
Else
ss.ServiceID = 0
ddlServices.SelectedIndex = 0
End If
If Not ddlStaffFilter.SelectedIndex = 0 And Not ddlStaffFilter.SelectedIndex = 1 Then
ss.StaffID = ddlStaffFilter.SelectedValue
Else
ss.StaffID = 0
End If
If Not ddlFilterClients.SelectedIndex = 0 And Not ddlFilterClients.SelectedIndex = 1 Then
ss.ClientID = ddlFilterClients.SelectedValue
Else
ss.ClientID = 0
End If
End If
ss.LocID = locID
ss.StartDate = startDate
ss.EndDate = endDate
ss.ItemsPerPage = ddlItemsPerPage.SelectedValue
ss.Locked = ddlFilterLocked.SelectedValue
ss.isGlobal = cbGlobal.Checked
ss.Trashed = cbTrashed.Checked
ss.Printed = ddlFilterPrinted.SelectedValue
ss.LocationIDs = locIDs
ss.CaseLoadIDs = caseLoadIDs
ss.isQAQI = snUser.isQAQI
ss.ClientIDs = clientIDs
ss.StaffIDs = staffIDs
ss.ServiceIDs = serviceIDs
ss.FundingSourceIDs = fundingSourceIDs
ss.BillingStatusIDs = billingStatusIDs
ss.NoteStatusIDs = noteStatusIDs
Session("NoteSearchSettings") = ss
Try
pieNotes = DAL.GetPIENotesAndActivity(ss.StaffID, _
ss.StaffIDs, _
ss.ClientID, _
ss.ClientIDs, _
ss.StartDate, _
ss.EndDate, _
CInt(ViewState("locID")), _
staffID, _
ss.Trashed, _
ss.ServiceID, _
ss.ServiceIDs, _
ss.NoteStatusID, _
ss.NoteStatusIDs, _
ss.BillingStatusID, _
ss.BillingStatusIDs, _
ss.FundSourceID, _
ss.FundingSourceIDs, _
ss.Locked, _
ss.Printed, _
ss.isGlobal, _
ss.isQAQI, _
ss.CaseLoadIDs, _
ss.LocationIDs, _
CInt(ViewState("providerID")))
If pieNotes.Rows.Count > 250 Then
Cache.Insert(staffID.ToString, pieNotes, Nothing, Now.AddMinutes(5), TimeSpan.Zero)
Else
If Not Cache.Get(ViewState("staffID")) Is Nothing Then
Cache.Remove(ViewState("staffID"))
End If
End If
Catch ex As SqlException
lblMarquee.Text = ex.ToString
End Try
Catch ex As System.Exception
Response.Redirect(DAL.ErrorReport(Request.Url.AbsoluteUri.ToString, ex.Message.ToString(), DateTime.Now().ToString, ViewState("staffID"), ex.StackTrace.ToString(),
Request.Browser.Browser & " " & Request.Browser.Version, Request.Browser.Platform, Request.ServerVariables("REMOTE_ADDR")), False)
End Try
End Sub