Refactor receiver handling and update solution structure
- Updated `BaseController.vb` to use `Receiver.Id` for deletion. - Changed `Receivers` property in `frmEnvelopeEditor.vb` to `BindingList(Of ReceiverVM)` and adjusted initialization and usage throughout the file. - Modified `frmFieldEditor.vb` to use `List(Of ReceiverVM)` for receivers and updated related methods. - Adjusted color assignment logic in `frmMain.vb` to utilize a new `Value` class. - Added new project for `EnvelopeGenerator.Form` in the solution file. - Introduced new enums `ContractType` and `PageOrientation` in their respective files.
This commit is contained in:
@@ -18,7 +18,7 @@ Imports EnvelopeGenerator.Domain.Entities
|
||||
Partial Public Class frmEnvelopeEditor
|
||||
Public Property Envelope As Envelope
|
||||
Public Property Documents As New BindingList(Of EnvelopeDocument)
|
||||
Public Property Receivers As New BindingList(Of Receiver)
|
||||
Public Property Receivers As New BindingList(Of ReceiverVM)
|
||||
|
||||
Private AllReceiverEmails As New List(Of String)
|
||||
|
||||
@@ -105,7 +105,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
Else
|
||||
Controller = New EnvelopeEditorController(State, Envelope)
|
||||
Documents = New BindingList(Of EnvelopeDocument)(Controller.Envelope.Documents)
|
||||
Receivers = New BindingList(Of Receiver)(Controller.Envelope.Receivers)
|
||||
Receivers = New BindingList(Of ReceiverVM)(Controller.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList())
|
||||
|
||||
For Each docItem As EnvelopeDocument In Documents
|
||||
If Not File.Exists(docItem.Filepath) Then
|
||||
@@ -233,7 +233,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
.Document = Controller.Envelope.Documents.
|
||||
Where(Function(d) d.Filename = oDocument.Filename).
|
||||
SingleOrDefault(),
|
||||
.Receivers = Controller.Envelope.Receivers.ToList
|
||||
.Receivers = Controller.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList()
|
||||
}
|
||||
oForm.ShowDialog()
|
||||
|
||||
@@ -335,7 +335,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
|
||||
|
||||
|
||||
If Controller.SaveReceivers(oEnvelope, Receivers.ToList) = False Then
|
||||
If Controller.SaveReceivers(oEnvelope, Receivers.Select(Function(vm) vm.Receiver).ToList()) = False Then
|
||||
MsgBox(Resources.Envelope.Error_when_saving_the_recipients, MsgBoxStyle.Critical, Text)
|
||||
Return False
|
||||
End If
|
||||
@@ -459,7 +459,7 @@ Partial Public Class frmEnvelopeEditor
|
||||
End Sub
|
||||
|
||||
Private Sub ViewReceivers_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles ViewReceivers.InitNewRow
|
||||
Dim oReceiver As Receiver = ViewReceivers.GetRow(e.RowHandle)
|
||||
Dim oReceiver As ReceiverVM = ViewReceivers.GetRow(e.RowHandle)
|
||||
|
||||
Dim oUsedColors = Receivers.Select(Of Integer)(Function(r) r.ColorType).ToList()
|
||||
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
||||
|
||||
Reference in New Issue
Block a user