First create solution
This commit is contained in:
+119
@@ -0,0 +1,119 @@
|
||||
Partial Class BusinessDirectory_VC
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.aBusinessDirectory_OpenRTFDocument = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aOpenRTFDocument_InsertTable = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
Me.aOpenRTFDocument_InsertDocVariable = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
Me.aBusinessDirectory_OpenSpreadDocument = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
|
||||
'
|
||||
'aBusinessDirectory_OpenRTFDocument
|
||||
'
|
||||
Me.aBusinessDirectory_OpenRTFDocument.Caption = "aBusinessDirectory_OpenRTFDocument"
|
||||
Me.aBusinessDirectory_OpenRTFDocument.Category = "RecordEdit"
|
||||
Me.aBusinessDirectory_OpenRTFDocument.ConfirmationMessage = Nothing
|
||||
Me.aBusinessDirectory_OpenRTFDocument.Id = "aBusinessDirectory_OpenRTFDocument"
|
||||
Me.aBusinessDirectory_OpenRTFDocument.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
|
||||
Me.aBusinessDirectory_OpenRTFDocument.TargetObjectsCriteria = "IsFolder=False"
|
||||
Me.aBusinessDirectory_OpenRTFDocument.TargetObjectType = GetType(Nuvolar.[Module].BusinessDirectory)
|
||||
Me.aBusinessDirectory_OpenRTFDocument.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
|
||||
Me.aBusinessDirectory_OpenRTFDocument.ToolTip = Nothing
|
||||
Me.aBusinessDirectory_OpenRTFDocument.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
|
||||
'
|
||||
'aOpenRTFDocument_InsertTable
|
||||
'
|
||||
Me.aOpenRTFDocument_InsertTable.Caption = "aOpenRTFDocument_InsertTable"
|
||||
Me.aOpenRTFDocument_InsertTable.Category = "RecordEdit"
|
||||
Me.aOpenRTFDocument_InsertTable.ConfirmationMessage = Nothing
|
||||
Me.aOpenRTFDocument_InsertTable.Id = "aOpenRTFDocument_InsertTable"
|
||||
Me.aOpenRTFDocument_InsertTable.TargetObjectType = GetType(Nuvolar.[Module].OpenRTFDocument_PopUp)
|
||||
Me.aOpenRTFDocument_InsertTable.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aOpenRTFDocument_InsertTable.ToolTip = Nothing
|
||||
Me.aOpenRTFDocument_InsertTable.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aOpenRTFDocument_SaveBusinessDiretory
|
||||
'
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.Caption = "aOpenRTFDocument_SaveBusinessDiretory"
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.Category = "Save"
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.ConfirmationMessage = Nothing
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.Id = "aOpenRTFDocument_SaveBusinessDiretory"
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.TargetObjectType = GetType(Nuvolar.[Module].OpenRTFDocument_PopUp)
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.ToolTip = Nothing
|
||||
Me.aOpenRTFDocument_SaveBusinessDiretory.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aOpenRTFDocument_SaveToCRM_Lead
|
||||
'
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.AcceptButtonCaption = Nothing
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.CancelButtonCaption = Nothing
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.Caption = "aOpenRTFDocument_SaveToCRM_Lead"
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.Category = "Save"
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.ConfirmationMessage = Nothing
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.Id = "aOpenRTFDocument_SaveToCRM_Lead"
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.TargetObjectType = GetType(Nuvolar.[Module].OpenRTFDocument_PopUp)
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.ToolTip = Nothing
|
||||
Me.aOpenRTFDocument_SaveToCRM_Lead.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aOpenRTFDocument_InsertDocVariable
|
||||
'
|
||||
Me.aOpenRTFDocument_InsertDocVariable.AcceptButtonCaption = Nothing
|
||||
Me.aOpenRTFDocument_InsertDocVariable.CancelButtonCaption = Nothing
|
||||
Me.aOpenRTFDocument_InsertDocVariable.Caption = "aOpenRTFDocument_InsertDocVariable"
|
||||
Me.aOpenRTFDocument_InsertDocVariable.Category = "RecordEdit"
|
||||
Me.aOpenRTFDocument_InsertDocVariable.ConfirmationMessage = Nothing
|
||||
Me.aOpenRTFDocument_InsertDocVariable.Id = "aOpenRTFDocument_InsertDocVariable"
|
||||
Me.aOpenRTFDocument_InsertDocVariable.TargetObjectType = GetType(Nuvolar.[Module].OpenRTFDocument_PopUp)
|
||||
Me.aOpenRTFDocument_InsertDocVariable.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aOpenRTFDocument_InsertDocVariable.ToolTip = Nothing
|
||||
Me.aOpenRTFDocument_InsertDocVariable.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
'
|
||||
'aBusinessDirectory_OpenSpreadDocument
|
||||
'
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.Caption = "aBusinessDirectory_OpenSpreadDocument"
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.Category = "RecordEdit"
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.ConfirmationMessage = Nothing
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.Id = "aBusinessDirectory_OpenSpreadDocument"
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.TargetObjectsCriteria = "IsFolder=False"
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.TargetObjectType = GetType(Nuvolar.[Module].BusinessDirectory)
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.ToolTip = Nothing
|
||||
Me.aBusinessDirectory_OpenSpreadDocument.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aBusinessDirectory_OpenRTFDocument As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aOpenRTFDocument_InsertTable As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aOpenRTFDocument_SaveBusinessDiretory As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
Friend WithEvents aOpenRTFDocument_SaveToCRM_Lead As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
Friend WithEvents aOpenRTFDocument_InsertDocVariable As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
Friend WithEvents aBusinessDirectory_OpenSpreadDocument As DevExpress.ExpressApp.Actions.SimpleAction
|
||||
|
||||
End Class
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
<?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>
|
||||
<metadata name="aBusinessDirectory_OpenRTFDocument.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
</metadata>
|
||||
<metadata name="aOpenRTFDocument_InsertTable.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 134</value>
|
||||
</metadata>
|
||||
<metadata name="aOpenRTFDocument_SaveBusinessDiretory.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 173</value>
|
||||
</metadata>
|
||||
<metadata name="aOpenRTFDocument_SaveToCRM_Lead.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="aOpenRTFDocument_InsertDocVariable.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1064, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aBusinessDirectory_OpenSpreadDocument.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>302, 173</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+352
@@ -0,0 +1,352 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
Imports DevExpress.XtraRichEdit.API.Native
|
||||
Imports DevExpress.XtraRichEdit
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.ExpressApp.SystemModule
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
Imports DevExpress.ExpressApp.TreeListEditors.Win
|
||||
Imports DevExpress.XtraTreeList
|
||||
Imports DevExpress.ExpressApp.Win.Controls
|
||||
Imports DevExpress.XtraSpreadsheet
|
||||
Imports DevExpress.XtraSpreadsheet.Services
|
||||
|
||||
Public Class BusinessDirectory_VC
|
||||
Inherits Nuvolar.Module.BusinessDirectory_VC
|
||||
|
||||
Private _RichEditControl As RichEditControl
|
||||
Private _SpreadsheetControl As SpreadsheetControl
|
||||
Private _ISpreadsheetCommandFactoryService As ISpreadsheetCommandFactoryService
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
If View.Id = "OpenRTFDocument_PopUp_DetailView" Then
|
||||
Frame.GetController(Of ModificationsController).SaveAction.Active.SetItemValue("", False)
|
||||
Frame.GetController(Of ModificationsController).SaveAndCloseAction.Active.SetItemValue("", False)
|
||||
Frame.GetController(Of ModificationsController).SaveAndNewAction.Active.SetItemValue("", False)
|
||||
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _RichEditContolViewItem As ViewItem = _DetailView.FindItem("RTFText")
|
||||
If _RichEditContolViewItem IsNot Nothing Then
|
||||
AddHandler _RichEditContolViewItem.ControlCreated, AddressOf RichEditContolViewItem_ControlCreated
|
||||
End If
|
||||
End If
|
||||
If View.Id = "OpenSpreadDocument_Popup_DetailView" Then
|
||||
Frame.GetController(Of ModificationsController).SaveAction.Active.SetItemValue("", False)
|
||||
Frame.GetController(Of ModificationsController).SaveAndCloseAction.Active.SetItemValue("", False)
|
||||
Frame.GetController(Of ModificationsController).SaveAndNewAction.Active.SetItemValue("", False)
|
||||
|
||||
Frame.GetController(Of CloneObject.CloneObjectViewController).Active.SetItemValue("", False)
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", False)
|
||||
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _SpreadXML_ViewItem As ViewItem = _DetailView.FindItem("SpreadXML")
|
||||
If _SpreadXML_ViewItem IsNot Nothing Then
|
||||
AddHandler _SpreadXML_ViewItem.ControlCreated, AddressOf _SpreadXML_ViewItem_ControlCreated
|
||||
End If
|
||||
End If
|
||||
If View.Id = "BusinessDirectory_ListView" Then
|
||||
AddHandler View.ControlsCreated, AddressOf BusinessDirectory_ListView_ControlsCreated
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If View.Id = "OpenRTFDocument_PopUp_DetailView" Then
|
||||
Frame.GetController(Of ModificationsController).SaveAction.Active.SetItemValue("", True)
|
||||
Frame.GetController(Of ModificationsController).SaveAndCloseAction.Active.SetItemValue("", True)
|
||||
Frame.GetController(Of ModificationsController).SaveAndNewAction.Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "BusinessDirectory_ListView" Then
|
||||
RemoveHandler View.ControlsCreated, AddressOf BusinessDirectory_ListView_ControlsCreated
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aBusinessDirectory_OpenRTFDocument_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aBusinessDirectory_OpenRTFDocument.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _BusinessDirectory As BusinessDirectory = TryCast(View.SelectedObjects(0), BusinessDirectory)
|
||||
Dim _FileType As String = GetFileType(_BusinessDirectory.FileData)
|
||||
If _FileType = ".rtf" Or _FileType = ".RTF" Or _FileType = ".doc" Or _FileType = ".DOC" Or _FileType = ".docx" Or _FileType = ".DOCX" Then
|
||||
Dim _OpenRTFDocument_PopUp As New OpenRTFDocument_PopUp(_onew.Session)
|
||||
Dim _RichEditControl_New As New RichEditControl
|
||||
_BusinessDirectory.Reload()
|
||||
_RichEditControl_New.LoadDocument(GetFile(_BusinessDirectory.FileData))
|
||||
_OpenRTFDocument_PopUp.RTFText = _RichEditControl_New.RtfText
|
||||
_OpenRTFDocument_PopUp.BusinessDirectory = _onew.GetObject(_BusinessDirectory)
|
||||
|
||||
e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "OpenRTFDocument_PopUp_DetailView", True, _OpenRTFDocument_PopUp)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aBusinessDirectory_OpenSpreadDocument_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aBusinessDirectory_OpenSpreadDocument.Execute
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _BusinessDirectory As BusinessDirectory = TryCast(View.SelectedObjects(0), BusinessDirectory)
|
||||
Dim _FileType As String = GetFileType(_BusinessDirectory.FileData)
|
||||
If UCase(_FileType) = ".XLS" Or UCase(_FileType) = ".XLSX" Then
|
||||
Dim _OpenSpreadDocument_PopUp As New OpenSpreadDocument_Popup(_onew.Session)
|
||||
_OpenSpreadDocument_PopUp.BusinessDirectory = _onew.GetObject(_BusinessDirectory)
|
||||
e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "OpenSpreadDocument_Popup_DetailView", True, _OpenSpreadDocument_PopUp)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_InsertTable_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aOpenRTFDocument_InsertTable.Execute
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _User As User = _onew.GetObjectByKey(Of User)(_onew.GetKeyValue(SecuritySystem.CurrentUser))
|
||||
Dim _RTFCopy As RTFCopy = _onew.FindObject(Of RTFCopy)(CriteriaOperator.Parse("UserCreated=?", _User))
|
||||
If _RTFCopy Is Nothing Then Throw New Exception("*Nincs táblázat elhelyezve a vágólapon!")
|
||||
Dim _ContractTemplate As ContractTemplate = TryCast(View.SelectedObjects(0), ContractTemplate)
|
||||
|
||||
Dim _DocPos As DocumentPosition = _RichEditControl.Document.CaretPosition
|
||||
|
||||
_RichEditControl.Document.InsertHtmlText(_DocPos, _RTFCopy.RTFString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_SaveBusinessDiretory_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aOpenRTFDocument_SaveBusinessDiretory.Execute
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _OpenRTFDocument_PopUp As OpenRTFDocument_PopUp = TryCast(View.SelectedObjects(0), OpenRTFDocument_PopUp)
|
||||
Dim _BusinessDirectory As BusinessDirectory = _ocur.GetObject(_OpenRTFDocument_PopUp.BusinessDirectory)
|
||||
|
||||
_RichEditControl.SaveDocument(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf", DocumentFormat.Rtf)
|
||||
|
||||
_BusinessDirectory.FileData = LoadOtherFile(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf", New FileData(_ocur.Session))
|
||||
|
||||
_BusinessDirectory.FileCreated = GetFileCreatedDate(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf")
|
||||
_BusinessDirectory.FileCreated = GetFileModifiedDate(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf")
|
||||
|
||||
If IO.File.Exists(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf") Then _
|
||||
IO.File.Delete(IO.Path.GetTempPath + _BusinessDirectory.FileData.FileName.Remove(_BusinessDirectory.FileData.FileName.Length - 4, 4) + ".rtf")
|
||||
|
||||
_ocur.CommitChanges()
|
||||
_BusinessDirectory.Reload()
|
||||
View.Close()
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_SaveToCRM_Lead_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aOpenRTFDocument_SaveToCRM_Lead.CustomizePopupWindowParams
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _OpenRTFDocument_PopUp As OpenRTFDocument_PopUp = TryCast(View.SelectedObjects(0), OpenRTFDocument_PopUp)
|
||||
If _OpenRTFDocument_PopUp Is Nothing Then Throw New Exception("*Váratlan hiba történt a folyamat megszakadt!")
|
||||
Dim _RichEditControlNew As New RichEditControl
|
||||
_RichEditControlNew.RtfText = _OpenRTFDocument_PopUp.RTFText
|
||||
|
||||
Dim _RTFDocumentsCreatorHeader As New RTFDocumentsCreatorHeader(_onew.Session)
|
||||
Dim _Fields As DevExpress.XtraRichEdit.API.Native.FieldCollection = _RichEditControlNew.Document.Fields
|
||||
Dim _Document As DevExpress.XtraRichEdit.API.Native.Document = _RichEditControlNew.Document
|
||||
For Each _ActTagString As DevExpress.XtraRichEdit.API.Native.Field In _Fields
|
||||
Dim _RTFDocumentsCreatorRows As New RTFDocumentsCreatorRows(_onew.Session)
|
||||
With _RTFDocumentsCreatorRows
|
||||
.RTFDocumentsCreatorHeader = _RTFDocumentsCreatorHeader
|
||||
.InfoString = _Document.GetText(_ActTagString.CodeRange)
|
||||
_RTFDocumentsCreatorHeader.RTFDocumentsCreatorRows.Add(_RTFDocumentsCreatorRows)
|
||||
End With
|
||||
Next
|
||||
_RTFDocumentsCreatorHeader.FileName = _OpenRTFDocument_PopUp.BusinessDirectory.FileData.FileName
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "RTFDocumentsCreatorHeader_DetailView", False, _RTFDocumentsCreatorHeader)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_SaveToCRM_Lead_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aOpenRTFDocument_SaveToCRM_Lead.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _OpenRTFDocument_PopUp As OpenRTFDocument_PopUp = TryCast(View.SelectedObjects(0), OpenRTFDocument_PopUp)
|
||||
If _OpenRTFDocument_PopUp Is Nothing Then Throw New Exception("*Váratlan hiba történt a folyamat megszakadt!")
|
||||
Dim _RichEditControlNew As New RichEditControl
|
||||
_RichEditControlNew.RtfText = _OpenRTFDocument_PopUp.RTFText
|
||||
Dim _RTFDocumentsCreatorHeader As RTFDocumentsCreatorHeader = TryCast(e.PopupWindow.View.SelectedObjects(0), RTFDocumentsCreatorHeader)
|
||||
|
||||
Dim _FieldIndex As Int16 = 0
|
||||
Dim _Fields As DevExpress.XtraRichEdit.API.Native.FieldCollection = _RichEditControlNew.Document.Fields
|
||||
|
||||
_RichEditControlNew.BeginUpdate()
|
||||
|
||||
Dim _Document As DevExpress.XtraRichEdit.API.Native.Document = _RichEditControlNew.Document
|
||||
|
||||
_Document.BeginUpdate()
|
||||
|
||||
For Each _RTFDocumentsCreatorRows As RTFDocumentsCreatorRows In _RTFDocumentsCreatorHeader.RTFDocumentsCreatorRows
|
||||
Dim field As DevExpress.XtraRichEdit.API.Native.Field = _Fields(_FieldIndex)
|
||||
field.ShowCodes = True
|
||||
Dim _FieldCode As String = _Document.GetText(field.CodeRange)
|
||||
Dim _FieldResult As String = _RTFDocumentsCreatorRows.ValueString
|
||||
Dim _FieldPosition As DocumentPosition = field.Range.Start
|
||||
_Document.Delete(field.Range)
|
||||
_Document.InsertText(_FieldPosition, _FieldResult)
|
||||
Next
|
||||
_Document.EndUpdate()
|
||||
_RichEditControlNew.EndUpdate()
|
||||
|
||||
Dim _FilePath As String = System.IO.Path.GetTempPath
|
||||
Dim _FileName As String = ""
|
||||
Select Case _RTFDocumentsCreatorHeader.RTFExportFileType
|
||||
Case eRTFExportFileType.ePDF
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".pdf"
|
||||
_RichEditControlNew.ExportToPdf(_FilePath + _FileName)
|
||||
Case eRTFExportFileType.eRTF
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".rtf"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.Rtf)
|
||||
Case eRTFExportFileType.eWord
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".doc"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.Doc)
|
||||
Case eRTFExportFileType.eWordXDoc
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".docx"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.WordML)
|
||||
End Select
|
||||
|
||||
If System.IO.File.Exists(_FilePath + _FileName) Then
|
||||
Dim _CRM_LeadsDocumentation As New CRM_LeadsDocumentation(_ocur.Session)
|
||||
With _CRM_LeadsDocumentation
|
||||
.CRM_Leads = _ocur.GetObject(_OpenRTFDocument_PopUp.CRM_Opportunities.CRM_Leads)
|
||||
.File = LoadOtherFile(_FilePath + _FileName, New DevExpress.Persistent.BaseImpl.FileData(_ocur.Session))
|
||||
.FileCreated = GetFileCreatedDate(_FilePath + _FileName)
|
||||
.FileModified = GetFileModifiedDate(_FilePath + _FileName)
|
||||
.ShortName = .File.FileName
|
||||
.Status = eProductsDocumentationStatus.ePublic
|
||||
End With
|
||||
|
||||
System.IO.File.Delete(_FilePath + _FileName)
|
||||
End If
|
||||
|
||||
_ocur.CommitChanges()
|
||||
View.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_InsertDocVariable_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aOpenRTFDocument_InsertDocVariable.CustomizePopupWindowParams
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _RTFDocumanetsHandler_DocVariable_PopUp As New RTFDocumanetsHandler_DocVariable_PopUp(_onew.Session)
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "RTFDocumanetsHandler_DocVariable_PopUp_DetailView", False, _RTFDocumanetsHandler_DocVariable_PopUp)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aOpenRTFDocument_InsertDocVariable_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aOpenRTFDocument_InsertDocVariable.Execute
|
||||
Try
|
||||
Dim _RTFDocumanetsHandler_DocVariable_PopUp As RTFDocumanetsHandler_DocVariable_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), RTFDocumanetsHandler_DocVariable_PopUp)
|
||||
_RichEditControl.Document.Fields.Add(_RichEditControl.Document.CaretPosition, "DOCVARIABLE " + _RTFDocumanetsHandler_DocVariable_PopUp.DocVariableString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub BusinessDirectory_ListView_ControlsCreated(sender As Object, e As EventArgs)
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _TreeListEditor As TreeListEditor = CType((CType(View, DevExpress.ExpressApp.ListView)).Editor, TreeListEditor)
|
||||
Dim _TreeList As TreeList = _TreeListEditor.TreeList
|
||||
|
||||
AddHandler _TreeList.FilterNode, AddressOf _TreeList_FilterNode
|
||||
End Sub
|
||||
Private Sub _TreeList_FilterNode(sender As Object, e As FilterNodeEventArgs)
|
||||
e.Handled = True
|
||||
If View Is Nothing Then Exit Sub
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _ObjectTreeListNode As ObjectTreeListNode = TryCast(e.Node, ObjectTreeListNode)
|
||||
Dim _BusinessDirectory As BusinessDirectory = TryCast(_ObjectTreeListNode.Object, BusinessDirectory)
|
||||
If _BusinessDirectory IsNot Nothing Then
|
||||
Dim _BusinessDirectory_Roles As BusinessDirectory_Roles = _ocur.FindObject(Of BusinessDirectory_Roles)(CriteriaOperator.Parse("BusinessDirectory=?", _BusinessDirectory))
|
||||
If _BusinessDirectory_Roles IsNot Nothing Then
|
||||
If SecuritySystemHelper.IsUserInRoleCurrentUser(_BusinessDirectory_Roles.Role.Name) Then
|
||||
_ObjectTreeListNode.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#Region "Other Functions and Subs"
|
||||
Private Function GetFileType(_FileData As FileData) As String
|
||||
Dim _FileExt As String = ""
|
||||
Dim _FilePath As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), _FileData.FileName)
|
||||
Dim _Stream As System.IO.Stream = New System.IO.FileStream(_FilePath, System.IO.FileMode.Create)
|
||||
_FileData.SaveToStream(_Stream)
|
||||
_Stream.Close()
|
||||
|
||||
_FileExt = System.IO.Path.GetExtension(_FilePath)
|
||||
|
||||
If IO.File.Exists(_FilePath) Then IO.File.Delete(_FilePath)
|
||||
|
||||
Return _FileExt
|
||||
End Function
|
||||
Private Function GetFile(_DocumentFile As DevExpress.Persistent.BaseImpl.FileData) As String
|
||||
Dim _FilePath As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), _DocumentFile.FileName)
|
||||
Dim _Stream As System.IO.Stream = New System.IO.FileStream(_FilePath, System.IO.FileMode.Create)
|
||||
_DocumentFile.SaveToStream(_Stream)
|
||||
_Stream.Close()
|
||||
|
||||
Return _FilePath
|
||||
End Function
|
||||
Private Sub RichEditContolViewItem_ControlCreated(sender As Object, e As EventArgs)
|
||||
Dim _ItemControl As Object = TryCast(sender, ViewItem).Control
|
||||
Dim _RichEditUserControl As RichEditUserControl = TryCast(_ItemControl, RichEditUserControl)
|
||||
_RichEditControl = TryCast(_ItemControl, RichEditUserControl).RichEditControl
|
||||
End Sub
|
||||
Private Sub _SpreadXML_ViewItem_ControlCreated(sender As Object, e As EventArgs)
|
||||
Dim _OpenSpreadDocument_PopUp As OpenSpreadDocument_Popup = TryCast(View.SelectedObjects(0), OpenSpreadDocument_Popup)
|
||||
Dim _ItemControl As Object = TryCast(sender, ViewItem).Control
|
||||
Dim _SpreadUserControl As SpreadUserControl = TryCast(_ItemControl, SpreadUserControl)
|
||||
|
||||
_SpreadsheetControl = TryCast(_ItemControl, SpreadUserControl).SpreadsheetControl1
|
||||
|
||||
_ISpreadsheetCommandFactoryService = _SpreadsheetControl.GetService(Of ISpreadsheetCommandFactoryService)()
|
||||
_SpreadsheetControl.ReplaceService(Of ISpreadsheetCommandFactoryService)(New CustomCommandFactoryServise(_ISpreadsheetCommandFactoryService, _SpreadsheetControl, View))
|
||||
|
||||
'// IDE KELL !!! Itt már van SPREAD !!
|
||||
|
||||
If _OpenSpreadDocument_PopUp IsNot Nothing Then
|
||||
If _OpenSpreadDocument_PopUp.BusinessDirectory IsNot Nothing Then
|
||||
If _OpenSpreadDocument_PopUp.BusinessDirectory.FileData IsNot Nothing Then
|
||||
Dim _FilePath As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), _OpenSpreadDocument_PopUp.BusinessDirectory.FileData.FileName)
|
||||
Dim _Stream As System.IO.Stream = New System.IO.FileStream(_FilePath, System.IO.FileMode.Create)
|
||||
_OpenSpreadDocument_PopUp.BusinessDirectory.FileData.SaveToStream(_Stream)
|
||||
_Stream.Close()
|
||||
|
||||
|
||||
Dim _StreamFile = New System.IO.FileStream(_FilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read)
|
||||
Dim _StreamReader As New System.IO.StreamReader(_StreamFile)
|
||||
Dim workbook As DevExpress.Spreadsheet.IWorkbook = _SpreadsheetControl.Document
|
||||
_StreamFile.Seek(0, System.IO.SeekOrigin.Begin)
|
||||
workbook.LoadDocument(_StreamFile, DevExpress.Spreadsheet.DocumentFormat.OpenXml)
|
||||
_StreamFile.Close()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function LoadOtherFile(ByVal _ActFile As String, _FileData As FileData) As FileData
|
||||
Dim _StreamFile = New System.IO.FileStream(_ActFile, System.IO.FileMode.Open, System.IO.FileAccess.Read)
|
||||
Dim _StreamReader As New System.IO.StreamReader(_StreamFile)
|
||||
_StreamFile.Seek(0, System.IO.SeekOrigin.Begin)
|
||||
|
||||
_FileData.LoadFromStream(_ActFile, _StreamFile)
|
||||
_FileData.FileName = System.IO.Path.GetFileName(_ActFile)
|
||||
_StreamReader.Close()
|
||||
_StreamFile.Close()
|
||||
|
||||
Return _FileData
|
||||
|
||||
End Function
|
||||
Private Function GetFileCreatedDate(_ActFile As String) As Date
|
||||
Return System.IO.File.GetCreationTime(_ActFile)
|
||||
End Function
|
||||
Private Function GetFileModifiedDate(_ActFile As String) As Date
|
||||
Return System.IO.File.GetLastAccessTime(_ActFile)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.Persistent.Validation
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False)> _
|
||||
<CreatableItem(False)> _
|
||||
<NonPersistent()> _
|
||||
Public Class RTFDocumanetsHandler_DocVariable_PopUp
|
||||
Inherits BaseObject
|
||||
|
||||
Private _DocVariableString As String
|
||||
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
End Sub
|
||||
|
||||
Property DocVariableString As String
|
||||
Get
|
||||
Return _DocVariableString
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetPropertyValue("DocVariableString", _DocVariableString, value)
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
Partial Class RTFDocumentsHandlerVC
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
Me.aRTFDocuments_InsertRTFDocVariable = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
|
||||
'
|
||||
'aRFTDocuments_CreateBusinessDirectoryDocument
|
||||
'
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.AcceptButtonCaption = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.CancelButtonCaption = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.Caption = "aRFTDocuments_CreateBusinessDirectoryDocument"
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.ConfirmationMessage = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.Id = "aRFTDocuments_CreateBusinessDirectoryDocument"
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.ImageName = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.Shortcut = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.Tag = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.TargetObjectsCriteria = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.TargetObjectType = GetType(Nuvolar.[Module].RTFDocumentsHandler)
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.TargetViewId = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.ToolTip = Nothing
|
||||
Me.aRFTDocuments_CreateBusinessDirectoryDocument.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
|
||||
'
|
||||
'aRTFDocuments_InsertRTFDocVariable
|
||||
'
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.AcceptButtonCaption = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.CancelButtonCaption = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.Caption = "aRTFDocuments_InsertRTFDocVariable"
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.ConfirmationMessage = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.Id = "aRTFDocuments_InsertRTFDocVariable"
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.ImageName = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.Shortcut = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.Tag = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.TargetObjectsCriteria = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.TargetObjectType = GetType(Nuvolar.[Module].RTFDocumentsHandler)
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.TargetViewId = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.TargetViewType = DevExpress.ExpressApp.ViewType.DetailView
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.ToolTip = Nothing
|
||||
Me.aRTFDocuments_InsertRTFDocVariable.TypeOfView = GetType(DevExpress.ExpressApp.DetailView)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents aRFTDocuments_CreateBusinessDirectoryDocument As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
Friend WithEvents aRTFDocuments_InsertRTFDocVariable As DevExpress.ExpressApp.Actions.PopupWindowShowAction
|
||||
|
||||
End Class
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
<?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>
|
||||
<metadata name="aRFTDocuments_CreateBusinessDirectoryDocument.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="aRTFDocuments_InsertRTFDocVariable.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>412, 140</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
Imports DevExpress.XtraRichEdit.API.Native
|
||||
Imports DevExpress.XtraRichEdit
|
||||
|
||||
Public Class RTFDocumentsHandlerVC
|
||||
Inherits Nuvolar.Module.RTFDocumentsHandlerVC
|
||||
|
||||
Private _RichEditControl As RichEditControl
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
If View.Id = "RTFDocumentsHandler_DetailView" Then
|
||||
Dim _RTFDocumentsHandler As RTFDocumentsHandler = TryCast(View.SelectedObjects(0), RTFDocumentsHandler)
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _RichEditContolViewItem As ViewItem = _DetailView.FindItem("DocumentBody")
|
||||
If _RichEditContolViewItem IsNot Nothing Then
|
||||
AddHandler _RichEditContolViewItem.ControlCreated, AddressOf RichEditContolViewItem_ControlCreated
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub aRFTDocuments_CreateBusinessDirectoryDocument_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aRFTDocuments_CreateBusinessDirectoryDocument.CustomizePopupWindowParams
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _RTFDocumentsHandler As RTFDocumentsHandler = TryCast(View.SelectedObjects(0), RTFDocumentsHandler)
|
||||
If _RTFDocumentsHandler Is Nothing Then Throw New Exception("*Váratlan hiba történt a folyamat megszakadt!")
|
||||
Dim _RichEditControlNew As New RichEditControl
|
||||
_RichEditControlNew.RtfText = _RTFDocumentsHandler.DocumentBody
|
||||
|
||||
Dim _RTFDocumentsCreatorHeader As New RTFDocumentsCreatorHeader(_onew.Session)
|
||||
Dim _Fields As DevExpress.XtraRichEdit.API.Native.FieldCollection = _RichEditControlNew.Document.Fields
|
||||
Dim _Document As DevExpress.XtraRichEdit.API.Native.Document = _RichEditControlNew.Document
|
||||
For Each _ActTagString As DevExpress.XtraRichEdit.API.Native.Field In _Fields
|
||||
Dim _RTFDocumentsCreatorRows As New RTFDocumentsCreatorRows(_onew.Session)
|
||||
With _RTFDocumentsCreatorRows
|
||||
.RTFDocumentsCreatorHeader = _RTFDocumentsCreatorHeader
|
||||
.InfoString = _Document.GetText(_ActTagString.CodeRange)
|
||||
_RTFDocumentsCreatorHeader.RTFDocumentsCreatorRows.Add(_RTFDocumentsCreatorRows)
|
||||
End With
|
||||
Next
|
||||
_RTFDocumentsCreatorHeader.FileName = _RTFDocumentsHandler.ShortName
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "RTFDocumentsCreatorHeader_DetailView", False, _RTFDocumentsCreatorHeader)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aRFTDocuments_CreateBusinessDirectoryDocument_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aRFTDocuments_CreateBusinessDirectoryDocument.Execute
|
||||
Try
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _RTFDocumentsHandler As RTFDocumentsHandler = TryCast(View.SelectedObjects(0), RTFDocumentsHandler)
|
||||
If _RTFDocumentsHandler Is Nothing Then Throw New Exception("*Váratlan hiba történt a folyamat megszakadt!")
|
||||
Dim _RichEditControlNew As New RichEditControl
|
||||
_RichEditControlNew.RtfText = _RTFDocumentsHandler.DocumentBody
|
||||
Dim _RTFDocumentsCreatorHeader As RTFDocumentsCreatorHeader = TryCast(e.PopupWindow.View.SelectedObjects(0), RTFDocumentsCreatorHeader)
|
||||
|
||||
Dim _FieldIndex As Int16 = 0
|
||||
Dim _Fields As DevExpress.XtraRichEdit.API.Native.FieldCollection = _RichEditControlNew.Document.Fields
|
||||
|
||||
_RichEditControlNew.BeginUpdate()
|
||||
|
||||
Dim _Document As DevExpress.XtraRichEdit.API.Native.Document = _RichEditControlNew.Document
|
||||
|
||||
_Document.BeginUpdate()
|
||||
|
||||
For Each _RTFDocumentsCreatorRows As RTFDocumentsCreatorRows In _RTFDocumentsCreatorHeader.RTFDocumentsCreatorRows
|
||||
Dim field As DevExpress.XtraRichEdit.API.Native.Field = _Fields(_FieldIndex)
|
||||
field.ShowCodes = True
|
||||
Dim _FieldCode As String = _Document.GetText(field.CodeRange)
|
||||
Dim _FieldResult As String = _RTFDocumentsCreatorRows.ValueString
|
||||
Dim _FieldPosition As DocumentPosition = field.Range.Start
|
||||
_Document.Delete(field.Range)
|
||||
_Document.InsertText(_FieldPosition, _FieldResult)
|
||||
Next
|
||||
_Document.EndUpdate()
|
||||
_RichEditControlNew.EndUpdate()
|
||||
|
||||
Dim _FilePath As String = System.IO.Path.GetTempPath
|
||||
Dim _FileName As String
|
||||
Select Case _RTFDocumentsCreatorHeader.RTFExportFileType
|
||||
Case eRTFExportFileType.ePDF
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".pdf"
|
||||
_RichEditControlNew.ExportToPdf(_FilePath + _FileName)
|
||||
Case eRTFExportFileType.eRTF
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".rtf"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.Rtf)
|
||||
Case eRTFExportFileType.eWord
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".doc"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.Doc)
|
||||
Case eRTFExportFileType.eWordXDoc
|
||||
_FileName = _RTFDocumentsCreatorHeader.FileName + ".docx"
|
||||
_RichEditControlNew.SaveDocument(_FilePath + _FileName, DocumentFormat.WordML)
|
||||
End Select
|
||||
|
||||
If System.IO.File.Exists(_FilePath + _FileName) Then
|
||||
Dim _BusinessDirectory As New BusinessDirectory(_ocur.Session)
|
||||
With _BusinessDirectory
|
||||
_BusinessDirectory.BusinessDirectory_Parent = _ocur.GetObject(_RTFDocumentsCreatorHeader.BusinessDirectory)
|
||||
_BusinessDirectory.IsFolder = False
|
||||
_BusinessDirectory.FileData = LoadOtherFile(_FilePath + _FileName, New DevExpress.Persistent.BaseImpl.FileData(_ocur.Session))
|
||||
_BusinessDirectory.FileCreated = GetFileCreatedDate(_FilePath + _FileName)
|
||||
_BusinessDirectory.FileModified = GetFileModifiedDate(_FilePath + _FileName)
|
||||
End With
|
||||
|
||||
System.IO.File.Delete(_FilePath + _FileName)
|
||||
End If
|
||||
|
||||
_ocur.CommitChanges()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aRTFDocuments_InsertRTFDocVariable_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aRTFDocuments_InsertRTFDocVariable.CustomizePopupWindowParams
|
||||
Try
|
||||
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
||||
Dim _RTFDocumanetsHandler_DocVariable_PopUp As New RTFDocumanetsHandler_DocVariable_PopUp(_onew.Session)
|
||||
|
||||
e.View = Application.CreateDetailView(_onew, "RTFDocumanetsHandler_DocVariable_PopUp_DetailView", False, _RTFDocumanetsHandler_DocVariable_PopUp)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub aRTFDocuments_InsertRTFDocVariable_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aRTFDocuments_InsertRTFDocVariable.Execute
|
||||
Try
|
||||
Dim _RTFDocumanetsHandler_DocVariable_PopUp As RTFDocumanetsHandler_DocVariable_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), RTFDocumanetsHandler_DocVariable_PopUp)
|
||||
_RichEditControl.Document.Fields.Add(_RichEditControl.Document.CaretPosition, "DOCVARIABLE " + _RTFDocumanetsHandler_DocVariable_PopUp.DocVariableString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub RichEditContolViewItem_ControlCreated(sender As Object, e As EventArgs)
|
||||
Dim _ItemControl As Object = TryCast(sender, ViewItem).Control
|
||||
Dim _RichEditUserControl As RichEditUserControl = TryCast(_ItemControl, RichEditUserControl)
|
||||
_RichEditControl = TryCast(_ItemControl, RichEditUserControl).RichEditControl
|
||||
End Sub
|
||||
Private Function LoadOtherFile(ByVal _ActFile As String, _FileData As DevExpress.Persistent.BaseImpl.FileData) As DevExpress.Persistent.BaseImpl.FileData
|
||||
Dim _StreamFile = New System.IO.FileStream(_ActFile, System.IO.FileMode.Open, System.IO.FileAccess.Read)
|
||||
Dim _StreamReader As New System.IO.StreamReader(_StreamFile)
|
||||
_StreamFile.Seek(0, System.IO.SeekOrigin.Begin)
|
||||
|
||||
_FileData.LoadFromStream(_ActFile, _StreamFile)
|
||||
_FileData.FileName = System.IO.Path.GetFileName(_ActFile)
|
||||
_StreamReader.Close()
|
||||
_StreamFile.Close()
|
||||
|
||||
Return _FileData
|
||||
|
||||
End Function
|
||||
Private Function GetFileCreatedDate(_ActFile As String) As Date
|
||||
Return System.IO.File.GetCreationTime(_ActFile)
|
||||
End Function
|
||||
Private Function GetFileModifiedDate(_ActFile As String) As Date
|
||||
Return System.IO.File.GetLastAccessTime(_ActFile)
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user