MS Bisl design und Funktionalität
This commit is contained in:
@@ -230,13 +230,18 @@ Public Class frmMain
|
||||
End Sub
|
||||
Private Sub bbtnitmEB_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitmEB.ItemClick
|
||||
Try
|
||||
If ViewEnvelopes.FocusedRowHandle < 0 Then
|
||||
If IsNothing(ViewEnvelopes.FocusedRowHandle) Then
|
||||
bsitmInfo.Caption = "No row selected"
|
||||
Exit Sub
|
||||
End If
|
||||
bsitmInfo.Caption = ""
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim oEnvelope As Envelope = ViewCompleted.GetRow(ViewCompleted.FocusedRowHandle)
|
||||
GetResRepFileStreamByte(oEnvelope.Id)
|
||||
Dim oTempFolder = TempFiles.TempPath
|
||||
If Not Directory.Exists(oTempFolder) Then
|
||||
Directory.CreateDirectory(oTempFolder)
|
||||
End If
|
||||
Dim oFilename = "ViewEnvResReport"
|
||||
Dim oVersion As Integer = 0
|
||||
Dim oTempFilename = String.Concat(oTempFolder, "\", $"{oFilename}_{oEnvelope.Id}.pdf")
|
||||
@@ -244,19 +249,6 @@ Public Class frmMain
|
||||
oVersion += 1
|
||||
oTempFilename = String.Concat(oTempFolder, "\", $"{oFilename}_{oEnvelope.Id}_", oVersion.ToString, ".pdf")
|
||||
Loop
|
||||
'If File.Exists(oTempFilename) Then
|
||||
' oVersion += 1
|
||||
' oTempFilename = String.Concat(oTempFolder, "\", $"ViewEnvResReport_{oEnvelope.Id}_", oVersion.ToString, ".pdf")
|
||||
' Try
|
||||
' File.OpenWrite(oTempFilename)
|
||||
' Catch ex As Exception
|
||||
' MsgBox("File might already be open?", MsgBoxStyle.Exclamation)
|
||||
' Exit Sub
|
||||
' End Try
|
||||
|
||||
|
||||
' File.Delete(oTempFilename)
|
||||
'End If
|
||||
downloadResFile(oTempFilename)
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -410,10 +402,12 @@ Public Class frmMain
|
||||
If Not fileData Is Nothing Then
|
||||
myResFileData = fileData
|
||||
Else
|
||||
bsitmInfo.Caption = "FileStream 1 is nothing - check data!"
|
||||
myResFileData = Nothing
|
||||
End If
|
||||
Else
|
||||
myResFileData = Nothing
|
||||
bsitmInfo.Caption = "FileStream 2 is nothing - check data!"
|
||||
End If
|
||||
|
||||
|
||||
@@ -445,6 +439,7 @@ Public Class frmMain
|
||||
Private Sub downloadResFile(ByVal sFileName As String)
|
||||
Try
|
||||
If Not myResFileData Is Nothing Then
|
||||
Logger.Debug("working myResFileData in downloadResFile")
|
||||
'Read image data into a file stream
|
||||
Using fs As New FileStream(sFileName, FileMode.OpenOrCreate, FileAccess.Write)
|
||||
fs.Write(myResFileData, 0, myResFileData.Length)
|
||||
@@ -452,6 +447,7 @@ Public Class frmMain
|
||||
fs.Flush()
|
||||
fs.Close()
|
||||
End Using
|
||||
Logger.Debug($"Trying to open {sFileName}...")
|
||||
'Open File
|
||||
Process.Start(sFileName)
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user