Refactor Receiver to ReceiverVM in EnvelopeEditor and Main
Updated the `oReceiver` variable type from `Receiver` to `ReceiverVM` in the `frmEnvelopeEditor` and `frmMain` classes to align with a view model pattern. Modified the `Controller.DeleteReceiver` method to use `oReceiver.Receiver`, reflecting the new structure. Additionally, created `BindingList` of `ReceiverVM` to support a more MVVM architecture.
This commit is contained in:
parent
33fa4b76f5
commit
3e3c9d4c54
@ -366,7 +366,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oReceiver As Receiver = ViewReceivers.GetFocusedRow()
|
Dim oReceiver As ReceiverVM = ViewReceivers.GetFocusedRow()
|
||||||
|
|
||||||
If oReceiver Is Nothing Then
|
If oReceiver Is Nothing Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -381,7 +381,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Controller.DeleteReceiver(oReceiver) Then
|
If Controller.DeleteReceiver(oReceiver.Receiver) Then
|
||||||
Receivers.Remove(oReceiver)
|
Receivers.Remove(oReceiver)
|
||||||
Else
|
Else
|
||||||
MsgBox(Resources.Envelope.Recipient_could_not_be_deleted, MsgBoxStyle.Critical, Text)
|
MsgBox(Resources.Envelope.Recipient_could_not_be_deleted, MsgBoxStyle.Critical, Text)
|
||||||
|
|||||||
@ -331,7 +331,7 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oView As GridView = DirectCast(sender, GridView)
|
Dim oView As GridView = DirectCast(sender, GridView)
|
||||||
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
Dim oReceiver As ReceiverVM = oView.GetRow(e.RowHandle)
|
||||||
|
|
||||||
If (oReceiver Is Nothing) Then
|
If (oReceiver Is Nothing) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -365,7 +365,7 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oView As GridView = DirectCast(sender, GridView)
|
Dim oView As GridView = DirectCast(sender, GridView)
|
||||||
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
Dim oReceiver As ReceiverVM = oView.GetRow(e.RowHandle)
|
||||||
|
|
||||||
If (oReceiver Is Nothing) Then
|
If (oReceiver Is Nothing) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -624,9 +624,8 @@ Public Class frmMain
|
|||||||
|
|
||||||
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
||||||
Dim Documents As New BindingList(Of EnvelopeDocument)
|
Dim Documents As New BindingList(Of EnvelopeDocument)
|
||||||
Dim Receivers As New BindingList(Of Receiver)
|
Dim Receivers = New BindingList(Of ReceiverVM)(oController.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||||
Receivers = New BindingList(Of Receiver)(oController.Envelope.Receivers)
|
For Each oReceiver As ReceiverVM In Receivers
|
||||||
For Each oReceiver As Receiver In Receivers
|
|
||||||
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
||||||
If oController.ActionService.ResendReceiver(oEnvelope, oReceiver) = True Then
|
If oController.ActionService.ResendReceiver(oEnvelope, oReceiver) = True Then
|
||||||
Dim oMsg = Resources.Envelope.Invitation_successfully_resend.Replace("@Mail", oReceiver.EmailAddress)
|
Dim oMsg = Resources.Envelope.Invitation_successfully_resend.Replace("@Mail", oReceiver.EmailAddress)
|
||||||
@ -873,9 +872,8 @@ Public Class frmMain
|
|||||||
If oEnvelope.UseAccessCode = True Then
|
If oEnvelope.UseAccessCode = True Then
|
||||||
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
||||||
Dim Documents As New BindingList(Of EnvelopeDocument)
|
Dim Documents As New BindingList(Of EnvelopeDocument)
|
||||||
Dim Receivers As New BindingList(Of Receiver)
|
Dim Receivers = New BindingList(Of ReceiverVM)(oController.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||||
Receivers = New BindingList(Of Receiver)(oController.Envelope.Receivers)
|
For Each oReceiver As ReceiverVM In Receivers
|
||||||
For Each oReceiver As Receiver In Receivers
|
|
||||||
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
If oReceiver.EmailAddress = selReceiver.EmailAddress Then
|
||||||
If oController.ActionService.ManuallySendAccessCode(oEnvelope, oReceiver) = True Then
|
If oController.ActionService.ManuallySendAccessCode(oEnvelope, oReceiver) = True Then
|
||||||
Dim oMsg = Resources.Envelope.AccessCode_successfully_send.Replace("@Mail", oReceiver.EmailAddress)
|
Dim oMsg = Resources.Envelope.AccessCode_successfully_send.Replace("@Mail", oReceiver.EmailAddress)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user