einfach alles

This commit is contained in:
Jonathan Jenne
2023-12-05 15:40:16 +01:00
parent 763ac96f4e
commit 6f91ecac83
14 changed files with 522 additions and 247 deletions

View File

@@ -9,6 +9,7 @@ Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.Common
Imports EnvelopeGenerator.Common.My
Imports DevExpress.Charts.Native
Imports DevExpress.XtraGrid.Views.Grid
Public Class frmMain
Private LogConfig As LogConfig
@@ -70,10 +71,7 @@ Public Class frmMain
Controller = New EnvelopeListController(State)
LoadEnvelopes()
LoadCompletedEnvelopes()
LoadCharts()
LoadEnvelopeData()
Catch ex As Exception
Logger.Error(ex)
@@ -81,6 +79,14 @@ Public Class frmMain
End Sub
Private Sub LoadEnvelopeData()
LoadEnvelopes()
LoadCompletedEnvelopes()
'LoadCharts()
End Sub
Private Sub LoadEnvelopes()
GridBuilder = New GridBuilder(ViewEnvelopes)
GridBuilder.SetDefaults(ViewEnvelopes)
@@ -107,7 +113,7 @@ Public Class frmMain
Try
Dim oForm As New frmEnvelopeEditor() With {.State = State}
oForm.ShowDialog()
GridEnvelopes.DataSource = Controller.ListEnvelopes()
LoadEnvelopeData()
Catch ex As Exception
Logger.Error(ex)
@@ -127,9 +133,14 @@ Public Class frmMain
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
Dim oEnvelope As Envelope = DirectCast(ViewEnvelopes.GetRow(pRowHandle), Envelope)
If oEnvelope.IsAlreadySent Then
Exit Sub
End If
Dim oForm As New frmEnvelopeEditor() With {.State = State, .Envelope = oEnvelope}
oForm.ShowDialog()
GridEnvelopes.DataSource = Controller.ListEnvelopes()
LoadEnvelopeData()
Catch ex As Exception
Logger.Error(ex)
@@ -146,7 +157,7 @@ Public Class frmMain
End If
If Controller.DeleteEnvelope(oEnvelope) Then
GridEnvelopes.DataSource = Controller.ListEnvelopes()
LoadEnvelopeData()
Else
MsgBox(Resources.Envelope.The_envelope_could_not_be_deleted, MsgBoxStyle.Critical, Text)
End If
@@ -174,9 +185,75 @@ Public Class frmMain
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl1.SelectedPageChanged
Select Case XtraTabControl1.SelectedTabPageIndex
Case 1
RibbonPageEnvelopeActions.Enabled = False
btnEditEnvelope.Enabled = False
Case 0
RibbonPageEnvelopeActions.Enabled = True
btnEditEnvelope.Enabled = True
End Select
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
LoadEnvelopeData()
End Sub
Private Sub ViewEnvelopes_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles ViewEnvelopes.FocusedRowChanged
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
If oEnvelope.IsAlreadySent Then
btnEditEnvelope.Enabled = False
Else
btnEditEnvelope.Enabled = True
End If
End Sub
Private Sub ViewEnvelopes_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles ViewEnvelopes.CustomDrawCell
If e.RowHandle < 0 Then
Exit Sub
End If
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(e.RowHandle)
If oEnvelope.Status = Common.Constants.EnvelopeStatus.EnvelopePartlySigned Then
e.Appearance.BackColor = Color.LightGreen
End If
If oEnvelope.Status = Common.Constants.EnvelopeStatus.EnvelopeQueued Or oEnvelope.Status = Common.Constants.EnvelopeStatus.EnvelopeSent Then
e.Appearance.BackColor = Color.LightGoldenrodYellow
End If
End Sub
Private Sub ViewReceivers_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles ViewReceivers.CustomDrawCell
'If e.RowHandle < 0 Then
' Exit Sub
'End If
'Dim oDetailView As GridView = ViewEnvelopes.GetDetailView(ViewEnvelopes.FocusedRowHandle, 0)
'Dim oRow = oDetailView.GetDataRow(e.RowHandle)
'Dim oReceiver As EnvelopeReceiver = ViewReceivers.GetRow(e.RowHandle)
'If e.Column.FieldName = "Status" Then
' e.Appearance.BackColor = Color.LightSalmon
'End If
'Dim oReceiver As EnvelopeReceiver = ViewReceivers.GetRow(e.RowHandle)
'If (oReceiver Is Nothing) Then
' Exit Sub
'End If
'If oReceiver.Status = Common.Constants.ReceiverStatus.Signed Then
' e.Appearance.BackColor = Color.LightGreen
'Else
' e.Appearance.BackColor = Color.LightSalmon
'End If
End Sub
Private Sub GridEnvelopes_ViewRegistered(sender As Object, e As DevExpress.XtraGrid.ViewOperationEventArgs) Handles GridEnvelopes.ViewRegistered
If (e.View.IsDetailView = False) Then
Exit Sub
End If
AddHandler DirectCast(e.View, GridView).CustomDrawCell, AddressOf ViewReceivers_CustomDrawCell
End Sub
End Class