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:
parent
7a84726a3b
commit
33fa4b76f5
8
EnvelopeGenerator.Domain/Constants/ContractType.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/ContractType.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
|
{
|
||||||
|
public enum ContractType
|
||||||
|
{
|
||||||
|
Contract = 1,
|
||||||
|
ReadAndSign = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
8
EnvelopeGenerator.Domain/Constants/PageOrientation.cs
Normal file
8
EnvelopeGenerator.Domain/Constants/PageOrientation.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
|
{
|
||||||
|
public enum PageOrientation
|
||||||
|
{
|
||||||
|
Portrait = 0,
|
||||||
|
Landscape = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -76,7 +76,7 @@ Public MustInherit Class BaseController
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oResult2 = pEnvelope.Receivers.
|
Dim oResult2 = pEnvelope.Receivers.
|
||||||
Select(Function(r) ReceiverModel.Delete(r.Id, pEnvelope.Id, oTransaction)).
|
Select(Function(r) ReceiverModel.Delete(r.Receiver.Id, pEnvelope.Id, oTransaction)).
|
||||||
All(Function(r) r = True)
|
All(Function(r) r = True)
|
||||||
|
|
||||||
If oResult2 = False Then
|
If oResult2 = False Then
|
||||||
|
|||||||
@ -18,7 +18,7 @@ Imports EnvelopeGenerator.Domain.Entities
|
|||||||
Partial Public Class frmEnvelopeEditor
|
Partial Public Class frmEnvelopeEditor
|
||||||
Public Property Envelope As Envelope
|
Public Property Envelope As Envelope
|
||||||
Public Property Documents As New BindingList(Of EnvelopeDocument)
|
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)
|
Private AllReceiverEmails As New List(Of String)
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
Else
|
Else
|
||||||
Controller = New EnvelopeEditorController(State, Envelope)
|
Controller = New EnvelopeEditorController(State, Envelope)
|
||||||
Documents = New BindingList(Of EnvelopeDocument)(Controller.Envelope.Documents)
|
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
|
For Each docItem As EnvelopeDocument In Documents
|
||||||
If Not File.Exists(docItem.Filepath) Then
|
If Not File.Exists(docItem.Filepath) Then
|
||||||
@ -233,7 +233,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
.Document = Controller.Envelope.Documents.
|
.Document = Controller.Envelope.Documents.
|
||||||
Where(Function(d) d.Filename = oDocument.Filename).
|
Where(Function(d) d.Filename = oDocument.Filename).
|
||||||
SingleOrDefault(),
|
SingleOrDefault(),
|
||||||
.Receivers = Controller.Envelope.Receivers.ToList
|
.Receivers = Controller.Envelope.Receivers.Select(Function(r) ReceiverVM.From(r)).ToList()
|
||||||
}
|
}
|
||||||
oForm.ShowDialog()
|
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)
|
MsgBox(Resources.Envelope.Error_when_saving_the_recipients, MsgBoxStyle.Critical, Text)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@ -459,7 +459,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ViewReceivers_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles ViewReceivers.InitNewRow
|
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 oUsedColors = Receivers.Select(Of Integer)(Function(r) r.ColorType).ToList()
|
||||||
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
||||||
|
|||||||
@ -19,8 +19,8 @@ Partial Public Class frmFieldEditor
|
|||||||
Private Controller As FieldEditorController
|
Private Controller As FieldEditorController
|
||||||
|
|
||||||
Public Property Document As EnvelopeDocument = Nothing
|
Public Property Document As EnvelopeDocument = Nothing
|
||||||
Public Property Receivers As List(Of Receiver)
|
Public Property Receivers As List(Of ReceiverVM)
|
||||||
Public Property SelectedReceiver As Receiver = Nothing
|
Public Property SelectedReceiver As ReceiverVM = Nothing
|
||||||
|
|
||||||
Private UnsavedChanges As Boolean = False
|
Private UnsavedChanges As Boolean = False
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ Partial Public Class frmFieldEditor
|
|||||||
UnsavedChanges = True
|
UnsavedChanges = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateBarItem(pReceiver As Receiver) As BarItem
|
Private Function CreateBarItem(pReceiver As ReceiverVM) As BarItem
|
||||||
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
|
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
|
||||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||||
Dim oColorCircle = Helpers.GetColorCircle(oBaseCircle, pReceiver.Color)
|
Dim oColorCircle = Helpers.GetColorCircle(oBaseCircle, pReceiver.Color)
|
||||||
@ -121,7 +121,7 @@ Partial Public Class frmFieldEditor
|
|||||||
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
|
|
||||||
Dim oSelectedReceiver As Receiver = e.Item.Tag
|
Dim oSelectedReceiver As ReceiverVM = e.Item.Tag
|
||||||
Dim oCurrentPage = GDViewer.CurrentPage
|
Dim oCurrentPage = GDViewer.CurrentPage
|
||||||
Dim oCurrentPosition = GDViewer.GetVScrollBarPosition()
|
Dim oCurrentPosition = GDViewer.GetVScrollBarPosition()
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ Partial Public Class frmFieldEditor
|
|||||||
Me.ResumeLayout()
|
Me.ResumeLayout()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetReceiver(pReceiver As Receiver)
|
Private Sub SetReceiver(pReceiver As ReceiverVM)
|
||||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||||
|
|
||||||
txtReceiver.Caption = pReceiver.Name
|
txtReceiver.Caption = pReceiver.Name
|
||||||
@ -436,5 +436,3 @@ Partial Public Class frmFieldEditor
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports System.IdentityModel.Metadata
|
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports DevExpress.LookAndFeel
|
Imports DevExpress.LookAndFeel
|
||||||
@ -14,6 +13,7 @@ Imports DigitalData.Modules.Base
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports EnvelopeGenerator.CommonServices
|
Imports EnvelopeGenerator.CommonServices
|
||||||
Imports EnvelopeGenerator.CommonServices.My
|
Imports EnvelopeGenerator.CommonServices.My
|
||||||
|
Imports EnvelopeGenerator.Domain.Constants
|
||||||
Imports EnvelopeGenerator.Domain.Entities
|
Imports EnvelopeGenerator.Domain.Entities
|
||||||
|
|
||||||
Public Class frmMain
|
Public Class frmMain
|
||||||
@ -317,11 +317,11 @@ Public Class frmMain
|
|||||||
|
|
||||||
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(e.RowHandle)
|
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(e.RowHandle)
|
||||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopePartlySigned Then
|
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopePartlySigned Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeQueued Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeSent Then
|
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeQueued Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeSent Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.ORANGE_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.ORANGE_300)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -337,10 +337,10 @@ Public Class frmMain
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oReceiver.Status = Domain.Constants.ReceiverStatus.Signed Then
|
If oReceiver.Status = ReceiverStatus.Signed Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||||
Else
|
Else
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -351,11 +351,11 @@ Public Class frmMain
|
|||||||
|
|
||||||
Dim oEnvelope As Envelope = ViewCompleted.GetRow(e.RowHandle)
|
Dim oEnvelope As Envelope = ViewCompleted.GetRow(e.RowHandle)
|
||||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeCompletelySigned Then
|
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeCompletelySigned Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeDeleted Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeWithdrawn Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeRejected Then
|
If oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeDeleted Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeWithdrawn Or oEnvelope.Status = Domain.Constants.EnvelopeStatus.EnvelopeRejected Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -372,9 +372,9 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If oReceiver.Status = Domain.Constants.ReceiverStatus.Signed Then
|
If oReceiver.Status = Domain.Constants.ReceiverStatus.Signed Then
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.GREEN_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.GREEN_300)
|
||||||
Else
|
Else
|
||||||
e.Appearance.BackColor = ColorTranslator.FromHtml(Domain.Constants.RED_300)
|
e.Appearance.BackColor = ColorTranslator.FromHtml(Value.RED_300)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "presentation", "presentatio
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.Terminal", "EnvelopeGenerator.Terminal\EnvelopeGenerator.Terminal.csproj", "{A9F9B431-BB9B-49B8-9E2C-0703634A653A}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvelopeGenerator.Terminal", "EnvelopeGenerator.Terminal\EnvelopeGenerator.Terminal.csproj", "{A9F9B431-BB9B-49B8-9E2C-0703634A653A}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.Form", "EnvelopeGenerator.Form\EnvelopeGenerator.Form.vbproj", "{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -79,6 +81,10 @@ Global
|
|||||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A9F9B431-BB9B-49B8-9E2C-0703634A653A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -97,6 +103,7 @@ Global
|
|||||||
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||||
{E3C758DC-914D-4B7E-8457-0813F1FDB0CB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
{E3C758DC-914D-4B7E-8457-0813F1FDB0CB} = {134D4164-B291-4E19-99B9-E4FA3AFAB62C}
|
||||||
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
|
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}
|
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user