23-08-23
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Threading.Tasks
|
||||
Imports DevExpress.XtraBars.Docking
|
||||
Imports DevExpress.XtraSplashScreen
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common
|
||||
@@ -41,12 +42,28 @@ Partial Public Class frmEnvelopeEditor
|
||||
Receivers = New BindingList(Of EnvelopeReceiver)(Controller.Envelope.Receivers)
|
||||
txtMessage.EditValue = Controller.Envelope.Message
|
||||
txtSubject.EditValue = Controller.Envelope.Subject
|
||||
|
||||
If Envelope.Status = Constants.EnvelopeStatus.Sent Then
|
||||
SetFormReadonly()
|
||||
End If
|
||||
End If
|
||||
|
||||
GridDocuments.DataSource = Documents
|
||||
GridReceivers.DataSource = Receivers
|
||||
End Sub
|
||||
|
||||
Private Sub SetFormReadonly()
|
||||
RibbonPageGroup1.Enabled = False
|
||||
RibbonPageGroup2.Enabled = False
|
||||
RibbonPageGroup3.Enabled = False
|
||||
RibbonPageGroup5.Enabled = False
|
||||
btnEditFields.Enabled = False
|
||||
txtSubject.Properties.ReadOnly = True
|
||||
txtMessage.Properties.ReadOnly = True
|
||||
ViewReceivers.OptionsBehavior.ReadOnly = True
|
||||
ViewDocuments.OptionsBehavior.ReadOnly = True
|
||||
End Sub
|
||||
|
||||
Private Sub frmEnvelopeEditor_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
Controller.CleanupEnvelope()
|
||||
End Sub
|
||||
@@ -87,7 +104,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
.Receivers = Receivers.ToList,
|
||||
.State = State
|
||||
}
|
||||
oForm.Show()
|
||||
oForm.ShowDialog()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -112,8 +129,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
|
||||
Dim oErrors = oEnvelope.Validate()
|
||||
If oErrors.Any Then
|
||||
Dim oError = "Fehler beim Speichern des Umschlags:" & vbNewLine & vbNewLine & String.Join(vbNewLine, oErrors)
|
||||
MsgBox(oError, MsgBoxStyle.Exclamation, Text)
|
||||
ShowValidationErrors("Fehler beim Speichern des Umschlags: ", oErrors)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -122,7 +138,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
Return False
|
||||
End If
|
||||
|
||||
If Controller.SaveEnvelope(oEnvelope) = False Then
|
||||
If Controller.SaveEnvelope() = False Then
|
||||
MsgBox("Fehler beim Speichern des Umschlags!", MsgBoxStyle.Critical, Text)
|
||||
Return False
|
||||
Else
|
||||
@@ -130,6 +146,11 @@ Partial Public Class frmEnvelopeEditor
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub ShowValidationErrors(pErrorTitle As String, pErrors As List(Of String))
|
||||
Dim oError = pErrorTitle & vbNewLine & vbNewLine & String.Join(vbNewLine, pErrors)
|
||||
MsgBox(oError, MsgBoxStyle.Exclamation, Text)
|
||||
End Sub
|
||||
|
||||
Private Sub btnDeleteReceiver_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteReceiver.ItemClick
|
||||
If ViewReceivers.SelectedRowsCount = 0 Then
|
||||
Exit Sub
|
||||
@@ -157,4 +178,24 @@ Partial Public Class frmEnvelopeEditor
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnSendEnvelope_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSendEnvelope.ItemClick
|
||||
If SaveEnvelope() = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oErrors = Controller.ValidateEnvelopeForSending()
|
||||
If oErrors.Any() Then
|
||||
ShowValidationErrors("Fehler beim Senden des Umschlags: ", oErrors)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Controller.SendEnvelope() = False Then
|
||||
MsgBox("Umschlag konnte nicht gesendet werden!", MsgBoxStyle.Critical, Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnCancel_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnCancel.ItemClick
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user