Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.Utils
Module HTMLModule
Public Function CreateHTMLEvents(_Question As Question, _Session As DevExpress.Xpo.Session) As String
Dim _Events_Collection As New XPCollection(Of Events)(PersistentCriteriaEvaluationBehavior.InTransaction, _
_Session, CriteriaOperator.Parse("Question.Oid=?", _Question.Oid))
Dim _Events As Events
Dim s As String = ""
's = " "
If _Events_Collection IsNot Nothing Then
_Events_Collection.Sorting.Add(New SortProperty("ObjectCreated", DB.SortingDirection.Ascending))
For Each _Events In _Events_Collection
If _Events.EventDirection = eEventDirection.eIn Then
s += "
"
s += ""
s += "| "
s += " | "
s += ""
s += " "
s += " | "
s += ""
s += _Events.UserCreated.LastName & " " & _Events.UserCreated.FirstName & " írta (" & CaptionHelper.GetLocalizedText("Enums\Nuvolar.Module.eQuestionStatus", _Events.QuestionStatus.ToString) & ")"
s += " | "
s += ""
s += Format(_Events.ObjectCreated, "yyyy/MM/dd HH:mm")
s += " | "
s += ""
s += " | "
s += "
"
s += "
"
s += ""
s += ""
s += " | "
s += ""
If _Events.Attachment IsNot Nothing Then
s += "Csatolmány: " & _Events.Attachment.FileName & " (" & _Events.Attachment.Size & " bytes)
"
End If
s += _Events.Description
s += " | "
s += "
"
s += "
"
s += "
"
End If
If _Events.EventDirection = eEventDirection.eOut Then
s += ""
s += ""
s += "| "
s += " | "
s += ""
s += " "
s += " | "
s += ""
s += _Events.UserCreated.LastName & " " & _Events.UserCreated.FirstName & " válaszolta (" & CaptionHelper.GetLocalizedText("Enums\Nuvolar.Module.eQuestionStatus", _Events.QuestionStatus.ToString) & ")"
s += " | "
s += ""
s += Format(_Events.ObjectCreated, "yyyy/MM/dd HH:mm")
s += " | "
s += ""
s += " | "
s += "
"
s += "
"
s += ""
s += ""
If LTrim(RTrim(_Events.Description)) <> "" Then
s += " | "
s += ""
If _Events.Attachment IsNot Nothing Then
s += "Csatolmány: " & _Events.Attachment.FileName & " (" & _Events.Attachment.Size & " bytes)
"
End If
s += _Events.Description
s += " | "
s += "
"
s += "
"
s += "
"
End If
End If
Next
End If
s = Replace(s, "'", """")
s = Replace(s, "&&", "#")
Return s
End Function
Public Function CreateHTMLEventsMail(_Question As Question, _Session As DevExpress.Xpo.Session) As String
Dim _Events_Collection As New XPCollection(Of Events)(PersistentCriteriaEvaluationBehavior.InTransaction, _
_Session, CriteriaOperator.Parse("Question.Oid=?", _Question.Oid))
Dim _Events As Events
Dim s As String = ""
's = " "
If _Events_Collection IsNot Nothing Then
_Events_Collection.Sorting.Add(New SortProperty("ObjectCreated", DB.SortingDirection.Ascending))
For Each _Events In _Events_Collection
If _Events.EventDirection = eEventDirection.eIn Then
s += ""
s += ""
s += "| "
s += " | "
s += ""
s += " "
s += " | "
s += ""
s += _Events.UserCreated.LastName & " " & _Events.UserCreated.FirstName & " írta (" & CaptionHelper.GetLocalizedText("Enums\Nuvolar.Module.eQuestionStatus", _Events.QuestionStatus.ToString) & ")"
s += " | "
s += ""
s += Format(_Events.ObjectCreated, "yyyy/MM/dd HH:mm")
s += " | "
s += ""
s += " | "
s += "
"
s += "
"
s += ""
s += ""
s += " | "
s += ""
s += _Events.Description
s += " | "
s += "
"
s += "
"
s += "
"
End If
If _Events.EventDirection = eEventDirection.eOut Then
s += ""
s += ""
s += "| "
s += " | "
s += ""
s += " "
s += " | "
s += ""
s += _Events.UserCreated.LastName & " " & _Events.UserCreated.FirstName & " válaszolta (" & CaptionHelper.GetLocalizedText("Enums\Nuvolar.Module.eQuestionStatus", _Events.QuestionStatus.ToString) & ")"
s += " | "
s += ""
s += Format(_Events.ObjectCreated, "yyyy/MM/dd HH:mm")
s += " | "
s += ""
s += " | "
s += "
"
s += "
"
s += ""
s += ""
If LTrim(RTrim(_Events.Description)) <> "" Then
s += " | "
s += ""
s += _Events.Description
s += " | "
s += "
"
s += "
"
s += "
"
End If
End If
Next
End If
s = Replace(s, "'", """")
s = Replace(s, "&&", "#")
Return s
End Function
End Module