06-12-23 Buttons enabled

This commit is contained in:
PitzM 2023-12-06 11:24:45 +01:00
parent d0b7c6fbd8
commit 3701ac30ef

View File

@ -41,6 +41,7 @@ Partial Public Class frmEnvelopeEditor
MsgBox(Resources.Envelope.Document_Could_Not_Be_Saved, MsgBoxStyle.Critical, Text) MsgBox(Resources.Envelope.Document_Could_Not_Be_Saved, MsgBoxStyle.Critical, Text)
End If End If
End If End If
RibbonPageGroupAddSignature_Enabled() RibbonPageGroupAddSignature_Enabled()
End Sub End Sub
@ -225,11 +226,6 @@ Partial Public Class frmEnvelopeEditor
oEnvelope.Message = oMessage oEnvelope.Message = oMessage
oEnvelope.Documents = Documents.ToList oEnvelope.Documents = Documents.ToList
'oEnvelope.Receivers = Receivers.ToList
If Controller.SaveReceivers(oEnvelope, Receivers.ToList) = False Then If Controller.SaveReceivers(oEnvelope, Receivers.ToList) = False Then
MsgBox(Resources.Envelope.Error_when_saving_the_recipients, MsgBoxStyle.Critical, Text) MsgBox(Resources.Envelope.Error_when_saving_the_recipients, MsgBoxStyle.Critical, Text)
Return False Return False
@ -375,6 +371,7 @@ Partial Public Class frmEnvelopeEditor
RibbonPageGroupAddSignature.Enabled = True RibbonPageGroupAddSignature.Enabled = True
End If End If
End Sub End Sub
Private Sub RibbonPageGroupReceiver_Enable() Private Sub RibbonPageGroupReceiver_Enable()
If ViewReceivers.SelectedRowsCount = 0 Then If ViewReceivers.SelectedRowsCount = 0 Then
RibbonPageGroupReceiver.Enabled = False RibbonPageGroupReceiver.Enabled = False
@ -383,6 +380,16 @@ Partial Public Class frmEnvelopeEditor
End If End If
End Sub End Sub
Private Sub DocumentButtons_Enable()
If ViewDocuments.SelectedRowsCount = 0 Then
btnNewFile.Enabled = True
btnDeleteFile.Enabled = False
Else
btnNewFile.Enabled = False
btnDeleteFile.Enabled = True
End If
End Sub
Private Sub SetFormTitle(pTitle As String) Private Sub SetFormTitle(pTitle As String)
Dim oFormTitle As String = State.DbConfig.ExternalProgramName + " - Umschlag-Editor" Dim oFormTitle As String = State.DbConfig.ExternalProgramName + " - Umschlag-Editor"
If String.IsNullOrEmpty(pTitle) = False Then If String.IsNullOrEmpty(pTitle) = False Then
@ -397,4 +404,13 @@ Partial Public Class frmEnvelopeEditor
Controller.DeleteEnvelopeFromDisk(Controller.Envelope) Controller.DeleteEnvelopeFromDisk(Controller.Envelope)
End If End If
End Sub End Sub
Private Sub ViewReceivers_RowCountChanged(sender As Object, e As EventArgs) Handles ViewReceivers.RowCountChanged
RibbonPageGroupReceiver_Enable()
End Sub
Private Sub ViewDocuments_RowCountChanged(sender As Object, e As EventArgs) Handles ViewDocuments.RowCountChanged
DocumentButtons_Enable()
End Sub
End Class End Class