17.07.2023

This commit is contained in:
Jonathan Jenne 2023-07-17 12:59:36 +02:00
parent b63655b212
commit 9a3c3c2706
23 changed files with 1121 additions and 176 deletions

View File

@ -1,7 +1,16 @@
Public Class Constants
Public Enum EnvelopeStatus
Created
Created = 0
Saved = 1
End Enum
Public Enum ElementType
Signature = 0
End Enum
Public Enum ElementStatus
Created = 0
End Enum
End Class

View File

@ -1,54 +1,47 @@
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Runtime.Remoting.Messaging
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.Form.My.Resources
Public Class EnvelopeController
Public Class EnvelopeEditorController
Inherits BaseClass
Private ReadOnly Database As MSSQLServer
Private Envelope As Envelope = Nothing
Private ReadOnly State As State = Nothing
Private ReadOnly EnvelopeModel As EnvelopeModel
Public ReadOnly Envelope As Envelope = Nothing
Public Sub New(pState As State)
MyBase.New(pState.LogConfig)
Database = pState.Database
State = pState
EnvelopeModel = New EnvelopeModel(pState)
Envelope = CreateEnvelope()
End Sub
#Region "Public"
Public Function CreateEnvelope() As Envelope
Dim oEnvelope As New Envelope(State.UserId)
If EnvelopeModel.Insert(oEnvelope) Then
Return oEnvelope
Else
Return Nothing
End If
End Function
Public Function SaveEnvelope(pEnvelope As Envelope) As Boolean
Dim oConnection = Database.GetConnection()
Dim oTransaction = oConnection.BeginTransaction(IsolationLevel.ReadUncommitted)
Try
If pEnvelope.Id > 0 Then
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET [SUBJECT] = @SUBJECT, [MESSAGE] = @MESSAGE, [ENVELOPE_UUID] = @UUID WHERE GUID = @ID AND USER_ID = @USER_ID"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
Dim oResult = Database.ExecuteNonQueryWithConnectionObject(oCommand, oConnection, MSSQLServer.TransactionMode.ExternalTransaction, oTransaction)
If oResult = False Then
pEnvelope.Status = Constants.EnvelopeStatus.Saved
If EnvelopeModel.Update(pEnvelope, oTransaction) = False Then
Throw New ApplicationException
End If
Else
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (SUBJECT, MESSAGE, ENVELOPE_UUID, STATUS, USER_ID) VALUES (@SUBJECT, @MESSAGE, @UUID, @STATUS, @USER_ID)"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pEnvelope.Status.ToString()
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
If Database.ExecuteNonQuery(oCommand, oTransaction) = False Then
Throw New ApplicationException
End If
pEnvelope.Id = GetEnvelopeId(pEnvelope.UserId, oTransaction)
If SaveEnvelopeReceivers(pEnvelope, oTransaction) = False Then
Throw New ApplicationException
@ -57,13 +50,11 @@ Public Class EnvelopeController
If SaveEnvelopeDocuments(pEnvelope, oTransaction) = False Then
Throw New ApplicationException
End If
End If
oTransaction.Commit()
Envelope = pEnvelope
Return True
Catch ex As Exception
Logger.Error(ex)
oTransaction.Rollback()
@ -72,11 +63,17 @@ Public Class EnvelopeController
End Try
End Function
Public Function DeleteDocument(pDocument As EnvelopeFile) As Boolean
If Envelope Is Nothing Then
Return False
End If
Public Function CleanupEnvelope() As Boolean
If Envelope.Status = Constants.EnvelopeStatus.Created Then
'TODO: Delete Documents and Receivers and elements
Return EnvelopeModel.Delete(Envelope)
Else
Return True
End If
End Function
Public Function DeleteDocument(pDocument As EnvelopeDocument) As Boolean
Dim oSql = "DELETE FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT] WHERE FILENAME = @FILENAME AND ENVELOPE_ID = @ENVELOPE_ID"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("FILENAME", SqlDbType.NVarChar).Value = pDocument.Filename
@ -89,6 +86,7 @@ Public Class EnvelopeController
Private Function SaveEnvelopeDocuments(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
Try
Return pEnvelope.Documents.
Where(Function(d) d.Id = 0).
Select(Function(d) InsertDocument(pEnvelope, d, pTransaction)).
All(Function(pResult) pResult = True)
@ -98,7 +96,7 @@ Public Class EnvelopeController
End Try
End Function
Private Function InsertDocument(pEnvelope As Envelope, pDocument As EnvelopeFile, pTransaction As SqlTransaction) As Boolean
Private Function InsertDocument(pEnvelope As Envelope, pDocument As EnvelopeDocument, pTransaction As SqlTransaction) As Boolean
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_DOCUMENT]
([FILENAME]
,[FILEPATH]
@ -113,9 +111,13 @@ Public Class EnvelopeController
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
If Database.ExecuteNonQuery(oCommand, pTransaction) Then
pDocument.EnvelopeId = pEnvelope.Id
Return Database.ExecuteNonQuery(oCommand, pTransaction)
pDocument.Id = GetDocumentId(pDocument.Filename, pEnvelope, pTransaction)
Return True
Else
Return False
End If
End Function
Private Function SaveEnvelopeReceivers(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
@ -139,7 +141,7 @@ Public Class EnvelopeController
End Try
End Function
Private Function UpdateReceivers(pReceivers As List(Of Receiver), pTransaction As SqlTransaction) As Boolean
Private Function UpdateReceivers(pReceivers As List(Of EnvelopeReceiver), pTransaction As SqlTransaction) As Boolean
Try
Return pReceivers.
Select(Function(r) UpdateReceiver(r, pTransaction)).
@ -162,7 +164,7 @@ Public Class EnvelopeController
End Function
Private Function AssignReceiver(pEnvelope As Envelope, pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
Private Function AssignReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_RECEIVER]
([ENVELOPE_ID]
,[RECEIVER_ID]
@ -186,7 +188,7 @@ Public Class EnvelopeController
Return Database.ExecuteNonQuery(oCommand, pTransaction)
End Function
Private Function UpdateReceiver(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
Private Function UpdateReceiver(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
If pReceiver.Id = 0 Then
Dim oSql As String = "INSERT INTO [dbo].[TBSIG_RECEIVER]
([NAME]
@ -234,16 +236,6 @@ Public Class EnvelopeController
End If
End Function
Private Function GetEnvelopeId(pUserId As Integer, pTransaction As SqlTransaction) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_ENVELOPE WHERE USER_ID = {pUserId}", pTransaction)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Private Function GetReceiverId(pEmailAddress As String, pTransaction As SqlTransaction) As Integer
Try
Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction)
@ -253,4 +245,14 @@ Public Class EnvelopeController
Return Nothing
End Try
End Function
Private Function GetDocumentId(pFilename As String, pEnvelope As Envelope, pTransaction As SqlTransaction) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_ENVELOPE_DOCUMENT WHERE FILENAME = '{pFilename}' AND ENVELOPE_ID = {pEnvelope.Id}", pTransaction)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@ -0,0 +1,115 @@
Imports System.Data.SqlClient
Imports DevExpress.Utils.CommonDialogs
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database
Public Class FieldEditorController
Inherits BaseClass
Private ReadOnly Database As MSSQLServer
Private Envelope As Envelope = Nothing
Public Sub New(pState As State)
MyBase.New(pState.LogConfig)
Database = pState.Database
End Sub
Public Function SaveElements(pElements As IEnumerable(Of EnvelopeDocumentElement)) As Boolean
Return pElements.
Select(AddressOf SaveElement).
All(Function(pResult) pResult = True)
End Function
Public Function SaveElement(pElement As EnvelopeDocumentElement) As Boolean
Try
If pElement.Id > 0 Then
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
SET [POSITION_X] = @POSITION_X
,[POSITION_Y] = @POSITION_Y
,[WIDTH] = @WIDTH
,[HEIGHT] = @HEIGHT
WHERE GUID = @GUID"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("GUID", SqlDbType.NVarChar).Value = pElement.Id
oCommand.Parameters.Add("POSITION_X", SqlDbType.Int).Value = pElement.X
oCommand.Parameters.Add("POSITION_Y", SqlDbType.Int).Value = pElement.Y
oCommand.Parameters.Add("WIDTH", SqlDbType.Int).Value = pElement.Width
oCommand.Parameters.Add("HEIGHT", SqlDbType.Int).Value = pElement.Height
Return Database.ExecuteNonQuery(oCommand)
Else
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
([DOCUMENT_ID]
,[RECEIVER_ID]
,[ELEMENT_TYPE]
,[POSITION_X]
,[POSITION_Y]
,[WIDTH]
,[HEIGHT]
,[REQUIRED]
,[READ_ONLY]
,[STATUS]
,[PAGE])
VALUES
(@DOCUMENT_ID
,@RECEIVER_ID
,@ELEMENT_TYPE
,@POSITION_X
,@POSITION_Y
,@WIDTH
,@HEIGHT
,@REQUIRED
,@READ_ONLY
,@STATUS
,@PAGE)"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("DOCUMENT_ID", SqlDbType.NVarChar).Value = pElement.DocumentId
oCommand.Parameters.Add("RECEIVER_ID", SqlDbType.NVarChar).Value = pElement.ReceiverId
oCommand.Parameters.Add("ELEMENT_TYPE", SqlDbType.NVarChar).Value = pElement.ElementType
oCommand.Parameters.Add("POSITION_X", SqlDbType.Int).Value = pElement.X
oCommand.Parameters.Add("POSITION_Y", SqlDbType.Int).Value = pElement.Y
oCommand.Parameters.Add("WIDTH", SqlDbType.Int).Value = pElement.Width
oCommand.Parameters.Add("HEIGHT", SqlDbType.Int).Value = pElement.Height
oCommand.Parameters.Add("REQUIRED", SqlDbType.Bit).Value = pElement.Required
oCommand.Parameters.Add("READ_ONLY", SqlDbType.Bit).Value = pElement.ReadOnly
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pElement.Status.ToString
oCommand.Parameters.Add("PAGE", SqlDbType.Int).Value = pElement.Page
If Database.ExecuteNonQuery(oCommand) Then
pElement.Id = GetElementId(pElement)
Return True
Else
Return False
End If
End If
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function DeleteElement(pElement As EnvelopeDocumentElement) As Boolean
Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
Return Database.ExecuteNonQuery(oSql)
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Private Function GetElementId(pElement As EnvelopeDocumentElement) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@ -4,14 +4,12 @@
Public Property Message As String
Public Property UserId As Integer
Public Property Uuid As String = Guid.NewGuid.ToString()
Public Property Status As Constants.EnvelopeStatus = Constants.EnvelopeStatus.Created
Public Property Status As Constants.EnvelopeStatus
Public Property Documents As New List(Of EnvelopeFile)
Public Property Receivers As New List(Of Receiver)
Public Property Documents As New List(Of EnvelopeDocument)
Public Property Receivers As New List(Of EnvelopeReceiver)
Public Sub New(pSubject As String, pMessage As String, pUserId As Integer)
Subject = pSubject
Message = pMessage
Public Sub New(pUserId As Integer)
UserId = pUserId
End Sub

View File

@ -1,6 +1,8 @@
Imports System.IO
Public Class EnvelopeFile
Public Class EnvelopeDocument
Public Property Id As Integer
Public Property FileInfo As FileInfo
Public Property EnvelopeId As Integer = 0

View File

@ -0,0 +1,14 @@
Public Class EnvelopeDocumentElement
Public Property Id As Integer = 0
Public Property X As Integer
Public Property Y As Integer
Public Property Width As Integer
Public Property Height As Integer
Public Property ElementType As String
Public Property DocumentId As Integer
Public Property ReceiverId As Integer
Public Property Required As Boolean = False
Public Property [ReadOnly] As Boolean = False
Public Property Page As Integer = 1
Public Property Status As Constants.ElementStatus = Constants.ElementStatus.Created
End Class

View File

@ -1,6 +1,6 @@
Imports DigitalData.Modules.Base
Public Class Receiver
Public Class EnvelopeReceiver
Public Property Id As Integer
Public Property Name As String
Public Property Company As String = ""
@ -16,7 +16,4 @@ Public Class Receiver
Public Property Sequence As Integer = 0
Public Property PrivateMessage As String = ""
Public Property AccessCode As String = ""
End Class

View File

@ -52,6 +52,9 @@
<Reference Include="DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraPrinting.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DigitalData.Controls.DocumentViewer">
<HintPath>..\..\DDMonorepo\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Base">
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
</Reference>
@ -64,6 +67,9 @@
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14">
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
</Reference>
@ -94,17 +100,25 @@
<ItemGroup>
<Compile Include="Config.vb" />
<Compile Include="Constants.vb" />
<Compile Include="Controllers\EnvelopeController.vb" />
<Compile Include="Controllers\EnvelopeEditorController.vb" />
<Compile Include="Controllers\FieldEditorController.vb" />
<Compile Include="DbConfig.vb" />
<Compile Include="Entities\Envelope.vb" />
<Compile Include="Entities\EnvelopeFile.vb" />
<Compile Include="Entities\EnvelopeDocument.vb" />
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
<Compile Include="Entities\EnvelopeReceiver.vb" />
<Compile Include="Entities\State.vb" />
<Compile Include="frmEditor.vb">
<Compile Include="frmEnvelopeEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmEditor.Designer.vb">
<DependentUpon>frmEditor.vb</DependentUpon>
<Compile Include="frmEnvelopeEditor.Designer.vb">
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
</Compile>
<Compile Include="frmFieldEditor.Designer.vb">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</Compile>
<Compile Include="frmFieldEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMain.Designer.vb">
<DependentUpon>frmMain.vb</DependentUpon>
@ -112,6 +126,7 @@
<Compile Include="frmMain.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Models\EnvelopeModel.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
@ -123,8 +138,11 @@
<DesignTime>True</DesignTime>
<DependentUpon>Envelope.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="frmEditor.resx">
<DependentUpon>frmEditor.vb</DependentUpon>
<EmbeddedResource Include="frmEnvelopeEditor.resx">
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmFieldEditor.resx">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.vb</DependentUpon>
@ -165,6 +183,7 @@
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -0,0 +1,79 @@
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Runtime.Remoting.Messaging
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.Form.My.Resources
Public Class EnvelopeModel
Private Database As MSSQLServer
Private Logger As Logger
Public Sub New(pState As State)
Logger = pState.LogConfig.GetLogger()
Database = pState.Database
End Sub
Public Function Insert(pEnvelope As Envelope) As Boolean
Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (SUBJECT, MESSAGE, ENVELOPE_UUID, STATUS, USER_ID) VALUES (@SUBJECT, @MESSAGE, @UUID, @STATUS, @USER_ID)"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = String.Empty
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = Constants.EnvelopeStatus.Created
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
If Database.ExecuteNonQuery(oCommand) Then
pEnvelope.Id = GetEnvelopeId(pEnvelope)
Return True
Else
Return False
End If
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function Update(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
Try
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET [SUBJECT] = @SUBJECT, [MESSAGE] = @MESSAGE, [STATUS] = @STATUS WHERE GUID = @ID AND USER_ID = @USER_ID"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pEnvelope.Status
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
Return Database.ExecuteNonQuery(oCommand, pTransaction)
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function Delete(pEnvelope As Envelope) As Boolean
Try
Dim oSql = $"DELETE FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = {pEnvelope.Id}"
Return Database.ExecuteNonQuery(oSql)
Catch ex As Exception
Return False
Logger.Error(ex)
End Try
End Function
Private Function GetEnvelopeId(pEnvelope As Envelope) As Integer
Try
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_ENVELOPE WHERE USER_ID = {pEnvelope.UserId}")
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@ -1,5 +1,9 @@
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -1,66 +0,0 @@
Imports System.ComponentModel
Imports System.IO
Imports DigitalData.Modules.Logging
Partial Public Class frmEditor
Public Property Documents As New BindingList(Of EnvelopeFile)
Public Property Receivers As New BindingList(Of Receiver)
Private Controller As EnvelopeController
Private Logger As Logger
Public Property State As State
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnNewFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnNewFile.ItemClick
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim oFileInfo = New FileInfo(OpenFileDialog1.FileName)
Documents.Add(New EnvelopeFile() With {.FileInfo = oFileInfo})
End If
End Sub
Private Sub frmEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
Logger = State.LogConfig.GetLogger()
Controller = New EnvelopeController(State)
GridDocuments.DataSource = Documents
GridReceivers.DataSource = Receivers
End Sub
Private Sub btnDeleteFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteFile.ItemClick
If ViewDocuments.GetSelectedRows().Count > 0 Then
Dim oDocument As EnvelopeFile = DirectCast(ViewDocuments.GetFocusedRow(), EnvelopeFile)
If Controller.DeleteDocument(oDocument) Then
Documents.Remove(oDocument)
End If
End If
End Sub
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
Try
Dim oSubject = txtSubject.EditValue?.ToString
Dim oMessage = txtMessage.EditValue?.ToString
Dim oEnv = New Envelope(oSubject, oMessage, State.UserId) With {
.Receivers = Receivers.ToList,
.Documents = Documents.ToList
}
Dim oErrors = oEnv.Validate()
If oErrors.Any Then
Dim oError = "Fehler beim Speichern des Umschlags:" & vbNewLine & vbNewLine & String.Join(vbNewLine, oErrors)
MsgBox(oError, MsgBoxStyle.Exclamation, Text)
ElseIf Controller.SaveEnvelope(oEnv) = False Then
MsgBox("Fehler beim Speichern des Umschlags!", MsgBoxStyle.Critical, Text)
Else
'YAY!
End If
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
End Class

View File

@ -1,7 +1,7 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraLayout
Partial Public Class frmEditor
Partial Public Class frmEnvelopeEditor
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
''' <summary>
@ -28,7 +28,7 @@ Partial Public Class frmEditor
''' </summary>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEditor))
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEnvelopeEditor))
Dim TableColumnDefinition1 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition()
Dim TableRowDefinition1 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition()
Dim TableRowDefinition2 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition()
@ -48,7 +48,6 @@ Partial Public Class frmEditor
Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.GridDocuments = New DevExpress.XtraGrid.GridControl()
Me.FrmEditorBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.ViewDocuments = New DevExpress.XtraGrid.Views.Tile.TileView()
Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl()
Me.PanelControl2 = New DevExpress.XtraEditors.PanelControl()
@ -65,6 +64,7 @@ Partial Public Class frmEditor
Me.colName = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colEmail = New DevExpress.XtraGrid.Columns.GridColumn()
Me.RepositoryItemEmailEdit = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit()
Me.FrmEditorBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.EnvelopeDocumentBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -75,7 +75,6 @@ Partial Public Class frmEditor
Me.SplitContainerControl1.Panel2.SuspendLayout()
Me.SplitContainerControl1.SuspendLayout()
CType(Me.GridDocuments, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.FrmEditorBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ViewDocuments, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl2.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -98,6 +97,7 @@ Partial Public Class frmEditor
CType(Me.EnvelopeReceiverBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ViewReceivers, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemEmailEdit, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.FrmEditorBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.EnvelopeDocumentBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
@ -224,10 +224,6 @@ Partial Public Class frmEditor
Me.GridDocuments.TabIndex = 0
Me.GridDocuments.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewDocuments})
'
'FrmEditorBindingSource
'
Me.FrmEditorBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEditor)
'
'ViewDocuments
'
Me.ViewDocuments.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colFilename})
@ -361,7 +357,7 @@ Partial Public Class frmEditor
'EnvelopeReceiverBindingSource
'
Me.EnvelopeReceiverBindingSource.DataMember = "Receivers"
Me.EnvelopeReceiverBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEditor)
Me.EnvelopeReceiverBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEnvelopeEditor)
'
'ViewReceivers
'
@ -394,24 +390,28 @@ Partial Public Class frmEditor
Me.RepositoryItemEmailEdit.MaskSettings.Set("mask", "\w+@\w+\.\w+")
Me.RepositoryItemEmailEdit.Name = "RepositoryItemEmailEdit"
'
'FrmEditorBindingSource
'
Me.FrmEditorBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEnvelopeEditor)
'
'EnvelopeDocumentBindingSource
'
Me.EnvelopeDocumentBindingSource.DataMember = "Documents"
Me.EnvelopeDocumentBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEditor)
Me.EnvelopeDocumentBindingSource.DataSource = GetType(EnvelopeGenerator.Form.frmEnvelopeEditor)
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
Me.OpenFileDialog1.Filter = "PDF Files|*.pdf"
'
'frmEditor
'frmEnvelopeEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1164, 684)
Me.Controls.Add(Me.SplitContainerControl1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmEditor"
Me.Name = "frmEnvelopeEditor"
Me.Ribbon = Me.RibbonControl1
Me.Text = "Form1"
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
@ -422,7 +422,6 @@ Partial Public Class frmEditor
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.ResumeLayout(False)
CType(Me.GridDocuments, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.FrmEditorBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ViewDocuments, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SplitContainerControl2.Panel1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl2.Panel1.ResumeLayout(False)
@ -445,6 +444,7 @@ Partial Public Class frmEditor
CType(Me.EnvelopeReceiverBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ViewReceivers, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RepositoryItemEmailEdit, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.FrmEditorBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.EnvelopeDocumentBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

View File

@ -0,0 +1,97 @@
Imports System.ComponentModel
Imports System.IO
Imports DigitalData.Modules.Logging
Partial Public Class frmEnvelopeEditor
Public Property Documents As New BindingList(Of EnvelopeDocument)
Public Property Receivers As New BindingList(Of EnvelopeReceiver)
Private Controller As EnvelopeEditorController
Private Logger As Logger
Public Property State As State
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnNewFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnNewFile.ItemClick
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim oFileInfo = New FileInfo(OpenFileDialog1.FileName)
Documents.Add(New EnvelopeDocument() With {.FileInfo = oFileInfo})
End If
End Sub
Private Sub frmEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
Logger = State.LogConfig.GetLogger()
Controller = New EnvelopeEditorController(State)
GridDocuments.DataSource = Documents
GridReceivers.DataSource = Receivers
End Sub
Private Sub frmEnvelopeEditor_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Controller.CleanupEnvelope()
End Sub
Private Sub btnDeleteFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteFile.ItemClick
If ViewDocuments.GetSelectedRows().Count > 0 Then
Dim oDocument As EnvelopeDocument = DirectCast(ViewDocuments.GetFocusedRow(), EnvelopeDocument)
If Controller.DeleteDocument(oDocument) Then
Documents.Remove(oDocument)
End If
End If
End Sub
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
Try
SaveEnvelope()
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
If ViewDocuments.GetSelectedRows().Count > 0 Then
Dim oDocument As EnvelopeDocument = DirectCast(ViewDocuments.GetFocusedRow(), EnvelopeDocument)
Dim oGDPictureKey As String = "21182889975216572111813147150675976632"
If SaveEnvelope() Then
Dim oForm As New frmFieldEditor() With {
.Document = Controller.Envelope.Documents.
Where(Function(d) d.Filename = oDocument.Filename).
SingleOrDefault(),
.GDPictureKey = oGDPictureKey,
.Receivers = Receivers.ToList,
.State = State
}
oForm.ShowDialog()
End If
End If
End Sub
Private Function SaveEnvelope() As Boolean
Dim oSubject = txtSubject.EditValue?.ToString
Dim oMessage = txtMessage.EditValue?.ToString
Dim oEnvelope = Controller.Envelope
oEnvelope.Subject = oSubject
oEnvelope.Message = oMessage
oEnvelope.Receivers = Receivers.ToList
oEnvelope.Documents = Documents.ToList
Dim oErrors = oEnvelope.Validate()
If oErrors.Any Then
Dim oError = "Fehler beim Speichern des Umschlags:" & vbNewLine & vbNewLine & String.Join(vbNewLine, oErrors)
MsgBox(oError, MsgBoxStyle.Exclamation, Text)
Return False
ElseIf Controller.SaveEnvelope(oEnvelope) = False Then
MsgBox("Fehler beim Speichern des Umschlags!", MsgBoxStyle.Critical, Text)
Return False
Else
Return True
End If
End Function
End Class

View File

@ -0,0 +1,254 @@
Partial Public Class frmFieldEditor
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
''' <summary>
''' Required designer variable.
''' </summary>
Private components As System.ComponentModel.IContainer = Nothing
''' <summary>
''' Clean up any resources being used.
''' </summary>
''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso (components IsNot Nothing) Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
#Region "Windows Form Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmFieldEditor))
Me.ribbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.btnSave = New DevExpress.XtraBars.BarButtonItem()
Me.btnDelete = New DevExpress.XtraBars.BarButtonItem()
Me.BarListItem1 = New DevExpress.XtraBars.BarListItem()
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
Me.PopupMenu1 = New DevExpress.XtraBars.PopupMenu(Me.components)
Me.txtReceiver = New DevExpress.XtraBars.BarStaticItem()
Me.ribbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.ribbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RepositoryItemComboBox1 = New DevExpress.XtraEditors.Repository.RepositoryItemComboBox()
Me.RepositoryItemLookUpEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit()
Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
Me.BarManager1 = New DevExpress.XtraBars.BarManager(Me.components)
Me.barDockControlTop = New DevExpress.XtraBars.BarDockControl()
Me.barDockControlBottom = New DevExpress.XtraBars.BarDockControl()
Me.barDockControlLeft = New DevExpress.XtraBars.BarDockControl()
Me.barDockControlRight = New DevExpress.XtraBars.BarDockControl()
CType(Me.ribbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PopupMenu1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemComboBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemLookUpEdit1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.BarManager1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ribbonControl1
'
Me.ribbonControl1.ExpandCollapseItem.Id = 0
Me.ribbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.ribbonControl1.ExpandCollapseItem, Me.ribbonControl1.SearchEditItem, Me.BarButtonItem1, Me.btnSave, Me.btnDelete, Me.BarListItem1, Me.BarButtonItem2, Me.txtReceiver})
Me.ribbonControl1.Location = New System.Drawing.Point(0, 0)
Me.ribbonControl1.MaxItemId = 14
Me.ribbonControl1.Name = "ribbonControl1"
Me.ribbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.ribbonPage1})
Me.ribbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemComboBox1, Me.RepositoryItemLookUpEdit1})
Me.ribbonControl1.Size = New System.Drawing.Size(1125, 158)
'
'BarButtonItem1
'
Me.BarButtonItem1.Caption = "Signatur hinzufügen"
Me.BarButtonItem1.Id = 1
Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem1.Name = "BarButtonItem1"
'
'btnSave
'
Me.btnSave.Caption = "Speichern"
Me.btnSave.Id = 4
Me.btnSave.ImageOptions.SvgImage = CType(resources.GetObject("btnSave.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnSave.Name = "btnSave"
'
'btnDelete
'
Me.btnDelete.Caption = "Signatur entfernen"
Me.btnDelete.Id = 6
Me.btnDelete.ImageOptions.SvgImage = CType(resources.GetObject("btnDelete.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnDelete.Name = "btnDelete"
'
'BarListItem1
'
Me.BarListItem1.Caption = "BarListItem1"
Me.BarListItem1.Id = 9
Me.BarListItem1.Name = "BarListItem1"
'
'BarButtonItem2
'
Me.BarButtonItem2.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.DropDown
Me.BarButtonItem2.Caption = "Empfänger"
Me.BarButtonItem2.DropDownControl = Me.PopupMenu1
Me.BarButtonItem2.Id = 11
Me.BarButtonItem2.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem2.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem2.Name = "BarButtonItem2"
'
'PopupMenu1
'
Me.PopupMenu1.Name = "PopupMenu1"
Me.PopupMenu1.Ribbon = Me.ribbonControl1
'
'txtReceiver
'
Me.txtReceiver.Caption = "Kein Empfänger ausgewählt"
Me.txtReceiver.Id = 13
Me.txtReceiver.Name = "txtReceiver"
'
'ribbonPage1
'
Me.ribbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.ribbonPageGroup1, Me.RibbonPageGroup3, Me.RibbonPageGroup2})
Me.ribbonPage1.Name = "ribbonPage1"
Me.ribbonPage1.Text = "ribbonPage1"
'
'ribbonPageGroup1
'
Me.ribbonPageGroup1.ItemLinks.Add(Me.btnSave)
Me.ribbonPageGroup1.ItemLinks.Add(Me.btnDelete)
Me.ribbonPageGroup1.Name = "ribbonPageGroup1"
Me.ribbonPageGroup1.Text = "ribbonPageGroup1"
'
'RibbonPageGroup3
'
Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem2)
Me.RibbonPageGroup3.ItemLinks.Add(Me.txtReceiver)
Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
Me.RibbonPageGroup3.Text = "RibbonPageGroup3"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1)
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
'
'RepositoryItemComboBox1
'
Me.RepositoryItemComboBox1.AutoHeight = False
Me.RepositoryItemComboBox1.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.RepositoryItemComboBox1.Name = "RepositoryItemComboBox1"
'
'RepositoryItemLookUpEdit1
'
Me.RepositoryItemLookUpEdit1.AutoHeight = False
Me.RepositoryItemLookUpEdit1.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.RepositoryItemLookUpEdit1.Name = "RepositoryItemLookUpEdit1"
'
'DocumentViewer1
'
Me.DocumentViewer1.Dock = System.Windows.Forms.DockStyle.Fill
Me.DocumentViewer1.FileLoaded = False
Me.DocumentViewer1.Location = New System.Drawing.Point(0, 158)
Me.DocumentViewer1.Name = "DocumentViewer1"
Me.DocumentViewer1.Size = New System.Drawing.Size(1125, 500)
Me.DocumentViewer1.TabIndex = 3
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
Me.OpenFileDialog1.Filter = "PDF Files|*.pdf"
'
'BarManager1
'
Me.BarManager1.DockControls.Add(Me.barDockControlTop)
Me.BarManager1.DockControls.Add(Me.barDockControlBottom)
Me.BarManager1.DockControls.Add(Me.barDockControlLeft)
Me.BarManager1.DockControls.Add(Me.barDockControlRight)
Me.BarManager1.Form = Me
'
'barDockControlTop
'
Me.barDockControlTop.CausesValidation = False
Me.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top
Me.barDockControlTop.Location = New System.Drawing.Point(0, 0)
Me.barDockControlTop.Manager = Me.BarManager1
Me.barDockControlTop.Size = New System.Drawing.Size(1125, 0)
'
'barDockControlBottom
'
Me.barDockControlBottom.CausesValidation = False
Me.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom
Me.barDockControlBottom.Location = New System.Drawing.Point(0, 658)
Me.barDockControlBottom.Manager = Me.BarManager1
Me.barDockControlBottom.Size = New System.Drawing.Size(1125, 0)
'
'barDockControlLeft
'
Me.barDockControlLeft.CausesValidation = False
Me.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left
Me.barDockControlLeft.Location = New System.Drawing.Point(0, 0)
Me.barDockControlLeft.Manager = Me.BarManager1
Me.barDockControlLeft.Size = New System.Drawing.Size(0, 658)
'
'barDockControlRight
'
Me.barDockControlRight.CausesValidation = False
Me.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right
Me.barDockControlRight.Location = New System.Drawing.Point(1125, 0)
Me.barDockControlRight.Manager = Me.BarManager1
Me.barDockControlRight.Size = New System.Drawing.Size(0, 658)
'
'frmFieldEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1125, 658)
Me.Controls.Add(Me.DocumentViewer1)
Me.Controls.Add(Me.ribbonControl1)
Me.Controls.Add(Me.barDockControlLeft)
Me.Controls.Add(Me.barDockControlRight)
Me.Controls.Add(Me.barDockControlBottom)
Me.Controls.Add(Me.barDockControlTop)
Me.Name = "frmFieldEditor"
Me.Ribbon = Me.ribbonControl1
Me.Text = "Form1"
CType(Me.ribbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PopupMenu1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RepositoryItemComboBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RepositoryItemLookUpEdit1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.BarManager1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Private WithEvents ribbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
Private WithEvents ribbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Private WithEvents ribbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents DocumentViewer1 As DigitalData.Controls.DocumentViewer.DocumentViewer
Friend WithEvents OpenFileDialog1 As OpenFileDialog
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnDelete As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RepositoryItemComboBox1 As DevExpress.XtraEditors.Repository.RepositoryItemComboBox
Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RepositoryItemLookUpEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit
Friend WithEvents BarListItem1 As DevExpress.XtraBars.BarListItem
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents PopupMenu1 As DevExpress.XtraBars.PopupMenu
Friend WithEvents txtReceiver As DevExpress.XtraBars.BarStaticItem
Friend WithEvents BarManager1 As DevExpress.XtraBars.BarManager
Friend WithEvents barDockControlTop As DevExpress.XtraBars.BarDockControl
Friend WithEvents barDockControlBottom As DevExpress.XtraBars.BarDockControl
Friend WithEvents barDockControlLeft As DevExpress.XtraBars.BarDockControl
Friend WithEvents barDockControlRight As DevExpress.XtraBars.BarDockControl
End Class

View File

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="DevExpress.Data.v21.2" name="DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="BarButtonItem1.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANACAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGluZV9Db2xvciIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAw
IDAgMzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9
CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJLnN0MHtmaWxsOm5vbmU7fQoJLnN0MXtvcGFjaXR5OjAuMjU7
fQo8L3N0eWxlPg0KICA8cGF0aCBkPSJNMTcsMTFMNywyMWwtNC00TDEzLDdMMTcsMTF6IE0xOCwxMGwx
LjctMS43YzAuNC0wLjQsMC40LTEsMC0xLjNMMTcsNC4zYy0wLjQtMC40LTEtMC40LTEuMywwTDE0LDZM
MTgsMTB6ICAgTTIsMTh2NGg0TDIsMTh6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPHJlY3QgeD0iMCIgeT0i
MjQiIHdpZHRoPSIzMiIgaGVpZ2h0PSI4IiByeD0iMCIgcnk9IjAiIGlkPSJJbmRpY2F0b3IiIGNsYXNz
PSJzdDAiIC8+DQogIDxnIGNsYXNzPSJzdDEiPg0KICAgIDxwYXRoIGQ9Ik0wLDIzLjlWMzJoMzJ2LTgu
MUgweiBNMzAsMzBIMnYtNGgyOFYzMHoiIGNsYXNzPSJCbGFjayIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
</value>
</data>
<data name="btnSave.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMICAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzczNzM3NDt9Cgku
WWVsbG93e2ZpbGw6I0ZDQjAxQjt9CgkuR3JlZW57ZmlsbDojMTI5QzQ5O30KCS5CbHVle2ZpbGw6IzM4
N0NCNzt9CgkuUmVke2ZpbGw6I0QwMjEyNzt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh
Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQoJLnN0M3tk
aXNwbGF5Om5vbmU7ZmlsbDojNzM3Mzc0O30KPC9zdHlsZT4NCiAgPHBhdGggZD0iTTI3LDRoLTN2MTBI
OFY0SDVDNC40LDQsNCw0LjQsNCw1djIyYzAsMC42LDAuNCwxLDEsMWgyMmMwLjYsMCwxLTAuNCwxLTFW
NUMyOCw0LjQsMjcuNiw0LDI3LDR6IE0yNCwyNEg4di02ICBoMTZWMjR6IE0xMCw0djhoMTBWNEgxMHog
TTE0LDEwaC0yVjZoMlYxMHoiIGNsYXNzPSJCbGFjayIgLz4NCjwvc3ZnPgs=
</value>
</data>
<data name="btnDelete.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAD0DAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJs
YWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJLkdyZWVue2ZpbGw6IzAzOUMy
Mzt9CgkuWWVsbG93e2ZpbGw6I0ZGQjExNTt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh
Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQo8L3N0eWxlPg0KICA8ZyBpZD0iRGVsZXRlIj4N
CiAgICA8Zz4NCiAgICAgIDxwYXRoIGQ9Ik0xOC44LDE2bDYuOS02LjljMC40LTAuNCwwLjQtMSwwLTEu
NGwtMS40LTEuNGMtMC40LTAuNC0xLTAuNC0xLjQsMEwxNiwxMy4yTDkuMSw2LjNjLTAuNC0wLjQtMS0w
LjQtMS40LDAgICAgTDYuMyw3LjdjLTAuNCwwLjQtMC40LDEsMCwxLjRsNi45LDYuOWwtNi45LDYuOWMt
MC40LDAuNC0wLjQsMSwwLDEuNGwxLjQsMS40YzAuNCwwLjQsMSwwLjQsMS40LDBsNi45LTYuOWw2Ljks
Ni45ICAgIGMwLjQsMC40LDEsMC40LDEuNCwwbDEuNC0xLjRjMC40LTAuNCwwLjQtMSwwLTEuNEwxOC44
LDE2eiIgY2xhc3M9IlJlZCIgLz4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPgs=
</value>
</data>
<metadata name="PopupMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>159, 17</value>
</metadata>
<data name="BarButtonItem2.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAKEDAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z
ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5CbGFja3tmaWxsOiM3MjcyNzI7fQoJLkdyZWVue2ZpbGw6IzAz
OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9Cgkuc3Qwe29wYWNpdHk6MC43NTt9Cgkuc3Qxe29wYWNp
dHk6MC41O30KPC9zdHlsZT4NCiAgPGcgaWQ9IlVzZXIiPg0KICAgIDxwYXRoIGQ9Ik0xMCw5LjljLTAu
MSwwLjUsMC4yLDAuOSwwLjQsMS40YzAuMiwwLjUtMC4xLDEuNywwLjksMS42YzAsMCwwLDAuMSwwLDAu
MmMwLjYsMi4zLDIsNC45LDQuNyw0LjkgICBjMi43LDAsNC4yLTIuNiw0LjctNC45YzAsMCwwLTAuMSww
LTAuMWMxLDAuMSwwLjYtMS4xLDAuOS0xLjZjMC4yLTAuNSwwLjQtMC45LDAuMy0xLjRjLTAuMS0wLjQt
MC40LTAuNC0wLjUtMC4zICAgYzEuOC00LjktMS4xLTQuNy0xLjEtNC43UzIwLDIsMTQuOCwyQzEwLDIs
OS40LDYsMTAuNSw5LjZDMTAuNCw5LjYsMTAuMSw5LjcsMTAsOS45eiIgY2xhc3M9IkJsYWNrIiAvPg0K
ICAgIDxwYXRoIGQ9Ik0yMCwxOGMtMC44LDEuNS0yLjEsNC00LDRjLTEuOSwwLTMuMi0yLjUtNC00Yy0y
LjMsMy41LTgsMS04LDguNVYzMGgyNHYtMy41QzI4LDE5LjEsMjIuMywyMS40LDIwLDE4eiIgY2xhc3M9
IkJsYWNrIiAvPg0KICA8L2c+DQo8L3N2Zz4L
</value>
</data>
<metadata name="PopupMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>159, 17</value>
</metadata>
<metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="BarManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>284, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,202 @@
Imports System.ComponentModel
Imports System.Text
Imports DevExpress.XtraBars
Imports DigitalData.Modules.Logging
Imports GdPicture14
Imports GdPicture14.Annotations
Partial Public Class frmFieldEditor
Private LogConfig As LogConfig
Private Logger As Logger
Private GDViewer As GdViewer
Private Manager As AnnotationManager
Private Controller As FieldEditorController
Public Property Document As EnvelopeDocument = Nothing
Public Property GDPictureKey As String = ""
Public Property Receivers As List(Of EnvelopeReceiver)
Public Property SelectedReceiver As EnvelopeReceiver = Nothing
Public Property State As State
Public Property Fields As New List(Of EnvelopeDocumentElement)
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
LogConfig = New LogConfig(LogConfig.PathType.CustomPath, Application.StartupPath, CompanyName:="Digital Data", ProductName:="EnvelopeGenerator")
Logger = LogConfig.GetLogger()
If Document Is Nothing Then
Throw New ArgumentNullException("Document")
End If
If State Is Nothing Then
Throw New ArgumentNullException("State")
End If
If GDPictureKey = "" Then
Throw New ArgumentNullException("GDPictureKey")
End If
DocumentViewer1.Init(LogConfig, GDPictureKey)
DocumentViewer1.LoadFile(Document.Filepath)
If DocumentViewer1.PdfViewer IsNot Nothing Then
GDViewer = DocumentViewer1.PdfViewer
Manager = GDViewer.GetAnnotationManager()
Manager.InitFromGdViewer(GDViewer)
End If
SetReceiver(Receivers.First())
Dim oItems = Receivers.Select(AddressOf CreateBarItem).ToArray()
PopupMenu1.AddItems(oItems)
Controller = New FieldEditorController(State)
End Sub
Private Function CreateBarItem(pReceiver As EnvelopeReceiver) As BarItem
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
AddHandler oItem.ItemClick, AddressOf BarItem_Click
oItem.Tag = pReceiver
Return oItem
End Function
Private Sub BarItem_Click(sender As Object, e As ItemClickEventArgs)
Dim oReceiver As EnvelopeReceiver = e.Item.Tag
SetReceiver(oReceiver)
End Sub
Private Sub SetReceiver(pReceiver As EnvelopeReceiver)
txtReceiver.Caption = pReceiver.Name
SelectedReceiver = pReceiver
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
If GDViewer IsNot Nothing Then
AddHandler GDViewer.BeforeAnnotationAddedByUser, AddressOf Viewer_BeforeAnnotationAddedByUser
AddHandler GDViewer.AnnotationAddedByUser, AddressOf Viewer_AnnotationAddedByUser
GDViewer.AddStickyNoteAnnotationInteractive("SIGNATUR", Color.Black, "Arial", FontStyle.Regular, 10, 1, 0)
End If
End Sub
Private Sub Viewer_AnnotationAddedByUser(AnnotationIdx As Integer)
Dim oAnnotation = GDViewer.GetAnnotationFromIdx(AnnotationIdx)
If TypeOf oAnnotation Is AnnotationStickyNote Then
Dim oStickyNote As AnnotationStickyNote = oAnnotation
oStickyNote.Width = 1
oStickyNote.Height = 1
ApplyAnnotationStyle(oAnnotation)
End If
oAnnotation.CanRotate = False
oAnnotation.CanEdit = False
oAnnotation.CanResize = False
End Sub
Private Sub Viewer_BeforeAnnotationAddedByUser(AnnotationIdx As Integer)
'NOOP
End Sub
Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
Dim oAnnotationCount = GDViewer.GetAnnotationCount()
Dim oElements As New List(Of EnvelopeDocumentElement)
' TODO: Annotationen mit den ElementObjekten verknüpfen, um doppelte Sätze zu verhindern
For index = 0 To oAnnotationCount - 1
Dim oAnnotation As Annotation = GDViewer.GetAnnotationFromIdx(index)
If TypeOf oAnnotation Is AnnotationStickyNote Then
Dim oStickyNote As AnnotationStickyNote = oAnnotation
Dim oWidth = InchToPixel(oStickyNote.Width)
Dim oHeight = InchToPixel(oStickyNote.Height)
Dim oTop = InchToPixel(oStickyNote.Top)
Dim oLeft = InchToPixel(oStickyNote.Left)
Dim oElement As New EnvelopeDocumentElement() With {
.ElementType = Constants.ElementType.Signature.ToString,
.Height = oHeight,
.Width = oWidth,
.X = oLeft,
.Y = oTop,
.DocumentId = Document.Id,
.ReceiverId = SelectedReceiver.Id
}
oElements.Add(oElement)
End If
Next
If Not Controller.SaveElements(oElements) Then
MsgBox("Element konnten nicht gespeichert werden!", MsgBoxStyle.Critical, Text)
End If
End Sub
Private Function InchToPixel(pInch As Single) As Single
Return pInch * 96
End Function
Private Function PixelToInch(pPixel As Single) As Single
Return pPixel / 96
End Function
Private Sub ApplyAnnotationStyle(ByRef pAnnotation As Annotation)
If TypeOf pAnnotation Is AnnotationStickyNote Then
Dim oStickyNote As AnnotationStickyNote = pAnnotation
oStickyNote.Fill = True
oStickyNote.FillColor = Color.LightGoldenrodYellow
oStickyNote.Text = "SIGNATUR"
oStickyNote.Alignment = StringAlignment.Center
oStickyNote.LineAlignment = StringAlignment.Center
End If
End Sub
Private Sub BarButtonItem3_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDelete.ItemClick
Dim oSelected = GDViewer.GetSelectedAnnotationIdx()
If oSelected = -1 Then
Exit Sub
End If
If MsgBox("Wollen Sie die Annotation löschen?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question, Text) = DialogResult.Yes Then
GDViewer.DeleteAnnotation(oSelected)
End If
End Sub
Private Sub LoadAnnotation()
Dim oAnnotation As AnnotationStickyNote = Manager.AddStickyNoteAnnot(0, 0, 0, 0, "SIGNATUR")
If Manager.GetStat() = GdPictureStatus.OK Then
oAnnotation.Width = 2
oAnnotation.Height = 2
oAnnotation.Left = 1
oAnnotation.Top = 1
oAnnotation.Fill = True
oAnnotation.FillColor = Color.DarkRed
oAnnotation.Text = "SIGNATUR JUNGE"
If Manager.SaveAnnotationsToPage() = GdPictureStatus.OK Then
'oManager.BurnAnnotationsToPage(True)
'GDViewer.ReloadAnnotations()
'GDViewer.Redraw()
End If
End If
End Sub
End Class

View File

@ -37,6 +37,7 @@ Public Class frmMain
End Sub
Private Function GetDatabaseConfig() As DbConfig
Try
Dim oSql As String = "SELECT TOP 1 * FROM TBSIG_CONFIG"
Dim oTable As DataTable = Database.GetDatatable(oSql)
Dim oRow = oTable.Rows.Item(0)
@ -44,10 +45,13 @@ Public Class frmMain
Return New DbConfig() With {
.DocumentPath = oRow.ItemEx("DOCUMENT_PATH", "")
}
Catch ex As Exception
Return New DbConfig()
End Try
End Function
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
Dim oForm As New frmEditor() With {
Dim oForm As New frmEnvelopeEditor() With {
.State = New State With {
.UserId = UserId,
.Config = ConfigManager.Config,

View File

@ -95,19 +95,19 @@
<Import Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmMain.vb">
<Compile Include="frmFieldEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMain.Designer.vb">
<DependentUpon>frmMain.vb</DependentUpon>
<Compile Include="frmFieldEditor.Designer.vb">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</Compile>
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.vb</DependentUpon>
<EmbeddedResource Include="frmFieldEditor.resx">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">

View File

@ -32,7 +32,7 @@ Namespace My
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.EnvelopeGenerator.frmMain
Me.MainForm = Global.EnvelopeGenerator.frmFieldEditor
End Sub
End Class
End Namespace

View File

@ -1,4 +1,4 @@
Partial Public Class frmMain
Partial Public Class frmFieldEditor
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
''' <summary>

View File

@ -4,7 +4,7 @@ Imports DigitalData.Modules.Logging
Imports GdPicture14
Imports GdPicture14.Annotations
Partial Public Class frmMain
Partial Public Class frmFieldEditor
Private LogConfig As LogConfig
Private Logger As Logger