First create solution

This commit is contained in:
2017-03-08 11:21:27 +01:00
commit a2fb86bacf
5508 changed files with 1082238 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
Partial Class AnonymVC
<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.aAnonymData = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aAnonymData
'
Me.aAnonymData.Caption = "aAnonym Data"
Me.aAnonymData.ConfirmationMessage = Nothing
Me.aAnonymData.Id = "aAnonymData"
Me.aAnonymData.ToolTip = Nothing
End Sub
Friend WithEvents aAnonymData As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -0,0 +1,126 @@
<?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="aAnonymData.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,85 @@
Imports Microsoft.VisualBasic
Imports System
Imports System.Linq
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.Data.Filtering
Imports System.Collections.Generic
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.Utils
Imports DevExpress.ExpressApp.Layout
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.ExpressApp.Templates
Imports DevExpress.Persistent.Validation
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.Model.NodeGenerators
Imports DevExpress.Xpo
Imports DevExpress.Persistent.BaseImpl
' For more typical usage scenarios, be sure to check out http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppViewControllertopic.
Partial Public Class AnonymVC
Inherits ViewController
Public Sub New()
InitializeComponent()
RegisterActions(components)
' Target required Views (via the TargetXXX properties) and create their Actions.
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
' Perform various tasks depending on the target View.
Frame.GetController(Of AnonymVC).aAnonymData.Active.SetItemValue("", False)
'If SecuritySystem.CurrentUserName = "SysAdmin" Then
' Frame.GetController(Of AnonymVC).aAnonymData.Active.SetItemValue("", True)
'End If
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
' Access and customize the target View control.
End Sub
Protected Overrides Sub OnDeactivated()
' Unsubscribe from previously subscribed events and release other references and resources.
Frame.GetController(Of AnonymVC).aAnonymData.Active.SetItemValue("", False)
MyBase.OnDeactivated()
End Sub
Private Sub aAnonymData_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aAnonymData.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _uow As New UnitOfWork(_onew.Session.DataLayer)
Dim _Organization_Collection As New XPCollection(Of Organization)(_uow)
Dim _Organization As Organization
For Each _Organization In _Organization_Collection
Dim _Z1 As ZIPHU = ObjectSpace.FindObject(Of ZIPHU)(CriteriaOperator.Parse("ID=?", Math.Round(Rnd() * 3570, 0, MidpointRounding.AwayFromZero)))
Dim _Z2 As ZIPHU = ObjectSpace.FindObject(Of ZIPHU)(CriteriaOperator.Parse("ID=?", Math.Round(Rnd() * 3570, 0, MidpointRounding.AwayFromZero)))
_Organization.Name = String.Format("{0} {1}", _Z1.City, _Z2.City)
_Organization.FullName = _Organization.Name
If _Organization.Address1 IsNot Nothing Then
_Organization.Address1.Street = _Organization.Name
End If
If _Organization.Address2 IsNot Nothing Then
_Organization.Address2.Street = _Organization.Name
End If
_uow.CommitChanges()
Next
Dim _Person_Collection As New XPCollection(Of Person)(_uow)
Dim _Person As Person
For Each _Person In _Person_Collection
Dim _LN1 As String = TryCast(ObjectSpace, Xpo.XPObjectSpace).Session.ExecuteScalar(String.Format("select LastName from _LastName where Oid={0}", Math.Round(Rnd() * 9039, 0, MidpointRounding.AwayFromZero)))
Dim _LN2 As String = TryCast(ObjectSpace, Xpo.XPObjectSpace).Session.ExecuteScalar(String.Format("select LastName from _LastName where Oid={0}", Math.Round(Rnd() * 9039, 0, MidpointRounding.AwayFromZero)))
_Person.LastName = _LN1
_Person.FirstName = _LN2
_Person.Email = String.Format("{0}.{1}@tdfexample.org", _LN2, _LN1)
_uow.CommitChanges()
Next
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class AutoFilterRowControllerVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,53 @@
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.XtraGrid.Views.Base
Imports DevExpress.Data.Filtering
Imports DevExpress.XtraGrid
Public Class AutoFilterRowControllerVC
Inherits DevExpress.ExpressApp.ViewController
Private currentView As ListView
Private gridView As ColumnView
Private falseCriteria As CriteriaOperator = CriteriaOperator.Parse("1=0")
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
'If View.Id = "ProductFinder_ProductSelect_ListView" Then
' currentView = CType(View, ListView)
' AddHandler currentView.ControlsCreated, AddressOf AutoFilterRowController_ControlsCreated
'End If
End Sub
Private Sub AutoFilterRowController_ControlsCreated(ByVal sender As Object, ByVal e As EventArgs)
Dim grid As GridControl = TryCast(currentView.Control, GridControl)
gridView = TryCast(grid.FocusedView, ColumnView)
If gridView.ActiveFilter.IsEmpty Then
currentView.CollectionSource.Criteria("FalseCriteria") = falseCriteria
End If
AddHandler gridView.ActiveFilter.Changed, AddressOf ActiveFilter_Changed
End Sub
Private Sub ActiveFilter_Changed(ByVal sender As Object, ByVal e As EventArgs)
If (CType(sender, ViewFilter)).IsEmpty Then
currentView.CollectionSource.Criteria("FalseCriteria") = falseCriteria
Else
If currentView.CollectionSource.Criteria.ContainsKey("FalseCriteria") Then
currentView.CollectionSource.Criteria.Remove("FalseCriteria")
End If
End If
End Sub
End Class
@@ -0,0 +1,63 @@
Partial Class CentralListViewVC
<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.aSaveCentralListViewSettings = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
Me.aResetCentralListViewSettings = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aSaveCentralListViewSettings
'
Me.aSaveCentralListViewSettings.Caption = "aSave Central List View Settings"
Me.aSaveCentralListViewSettings.ConfirmationMessage = "Are you sure ?"
Me.aSaveCentralListViewSettings.Id = "aSaveCentralListViewSettings"
Me.aSaveCentralListViewSettings.ImageName = Nothing
Me.aSaveCentralListViewSettings.Shortcut = Nothing
Me.aSaveCentralListViewSettings.Tag = Nothing
Me.aSaveCentralListViewSettings.TargetObjectsCriteria = Nothing
Me.aSaveCentralListViewSettings.TargetViewId = Nothing
Me.aSaveCentralListViewSettings.ToolTip = Nothing
Me.aSaveCentralListViewSettings.TypeOfView = Nothing
'
'aResetCentralListViewSettings
'
Me.aResetCentralListViewSettings.Caption = "aReset Central List View Settings"
Me.aResetCentralListViewSettings.ConfirmationMessage = "Are you sure ?"
Me.aResetCentralListViewSettings.Id = "aResetCentralListViewSettings"
Me.aResetCentralListViewSettings.ImageName = Nothing
Me.aResetCentralListViewSettings.Shortcut = Nothing
Me.aResetCentralListViewSettings.Tag = Nothing
Me.aResetCentralListViewSettings.TargetObjectsCriteria = Nothing
Me.aResetCentralListViewSettings.TargetViewId = Nothing
Me.aResetCentralListViewSettings.ToolTip = Nothing
Me.aResetCentralListViewSettings.TypeOfView = Nothing
End Sub
Friend WithEvents aSaveCentralListViewSettings As DevExpress.ExpressApp.Actions.SimpleAction
Friend WithEvents aResetCentralListViewSettings As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -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="aSaveCentralListViewSettings.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="aResetCentralListViewSettings.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>227, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,234 @@
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.Win.Editors
Imports DevExpress.ExpressApp.ConditionalAppearance
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.ExpressApp.Model
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.Utils
Imports DevExpress.ExpressApp.TreeListEditors.Win
Imports DevExpress.ExpressApp.Win.Core
Imports DevExpress.Xpo
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.ExpressApp.PivotGrid.Win
Imports DevExpress.ExpressApp.PivotGrid
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.Win.SystemModule
Public Class CentralListViewVC
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
Dim _WaitFormClass As New WaitFormClass
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
Frame.GetController(Of CentralListViewVC).aSaveCentralListViewSettings.Active.SetItemValue("", False)
Frame.GetController(Of CentralListViewVC).aResetCentralListViewSettings.Active.SetItemValue("", False)
Dim _IModelListViewExtender As IModelListViewExtender = TryCast(View.Model, IModelListViewExtender)
If _IModelListViewExtender.IsCentralListView Then
Frame.GetController(Of CentralListViewVC).aSaveCentralListViewSettings.Active.SetItemValue("", True)
Frame.GetController(Of CentralListViewVC).aResetCentralListViewSettings.Active.SetItemValue("", True)
AddHandler View.ControlsCreating, AddressOf View_ControlCreating
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
RemoveHandler View.ControlsCreating, AddressOf View_ControlCreating
End Sub
Private Sub View_ControlCreating(sender As Object, e As EventArgs)
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ModelListView As ModelListView
Dim _IModelListView As IModelListView = TryCast(View.Model, IModelListView)
Dim _PropertyCollectionSource As PropertyCollectionSource
_PropertyCollectionSource = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource)
If _PropertyCollectionSource IsNot Nothing Then
If TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject IsNot Nothing Then
Dim _MasterObject As Guid = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject.oid
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=? and MasterObject=?", View.Id, _MasterObject))
Else
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=?", View.Id))
End If
Else
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=?", View.Id))
End If
If _ModelListView IsNot Nothing Then
If _IModelListView.EditorType = GetType(PivotGridListEditor) Then
TryCast(View.Model, IModelPivotListView).PivotSettings.Settings = _ModelListView.PivotSettings
View.SaveModel()
'View.LoadModel()
End If
If _IModelListView.EditorType = GetType(GridListEditor) Then
TryCast(View.Model, IModelListView).IsFooterVisible = _ModelListView.IsFooterVisible
TryCast(View.Model, IModelListView).IsGroupPanelVisible = _ModelListView.IsGroupPanelVisible
TryCast(View.Model, IModelListViewShowAutoFilterRow).ShowAutoFilterRow = _ModelListView.ShowAutoFilterRow
TryCast(View.Model, IModelListViewShowFindPanel).ShowFindPanel = _ModelListView.ShowFindPanel
For Each _Column In TryCast(View.Model, IModelListView).Columns
_Column.Index = -1
_Column.GroupIndex = -1
Next
For Each _ModelListViewColumn As ModelListViewColumn In _ModelListView.ModelListViewColumn
Dim _Found As Boolean = False
For Each _Column In TryCast(View.Model, IModelListView).Columns
If _Column.Id = _ModelListViewColumn.Id Then
_Column.Index = _ModelListViewColumn.Index
_Column.GroupIndex = _ModelListViewColumn.GroupIndex
_Column.Width = _ModelListViewColumn.Width
_Column.GroupInterval = _ModelListViewColumn.GroupInterval
_Found = True
Exit For
End If
Next
If _Found = False Then
Dim _Column As IModelColumn = TryCast(View.Model, IModelListView).Columns.AddNode(Of IModelColumn)(_ModelListViewColumn.Id)
TryCast(_Column, IModelColumnExtender).HideValueIfZero = _ModelListViewColumn.HideValueIfZero
TryCast(_Column, IModelColumnExtender).InLineCriteria = _ModelListViewColumn.InLineCriteria
TryCast(_Column, IModelColumnExtender).InLineEdit = _ModelListViewColumn.InLineEdit
_Column.AllowEdit = _ModelListViewColumn.AllowEdit
'TryCast(_Column, IModelColumnAllowSort).AllowSort = _ModelListViewColumn.AllowSort
_Column.GroupInterval = _ModelListViewColumn.GroupInterval
_Column.ImmediatePostData = _ModelListViewColumn.ImmediatePostData
_Column.IsPassword = _ModelListViewColumn.IsPassword
_Column.PropertyName = _ModelListViewColumn.PropertyName
_Column.GroupIndex = _ModelListViewColumn.GroupIndex
_Column.MaxLength = _ModelListViewColumn.MaxLength
_Column.SortIndex = _ModelListViewColumn.SortIndex
_Column.Width = _ModelListViewColumn.Width
_Column.Caption = _ModelListViewColumn.Caption
_Column.Index = _ModelListViewColumn.Index
End If
Next
View.SaveModel()
'View.LoadModel()
End If
End If
End Sub
Private Sub aSaveCentralListViewSettings_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aSaveCentralListViewSettings.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ModelListView As ModelListView
Dim _ModelListViewColumn As ModelListViewColumn
Dim _IModelListView As IModelListView = TryCast(View.Model, IModelListView)
Try
GLOBAL_HAS_Audit = False
View.SaveModel()
If TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject IsNot Nothing Then
Dim _MasterObject As Guid = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject.oid
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=? and MasterObject=?", View.Id, _MasterObject))
If _ModelListView Is Nothing Then
_ModelListView = _onew.CreateObject(Of ModelListView)()
_ModelListView.MasterObject = _MasterObject
_ModelListView.Id = View.Id
End If
Else
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=?", View.Id))
If _ModelListView Is Nothing Then
_ModelListView = _onew.CreateObject(Of ModelListView)()
_ModelListView.Id = View.Id
End If
End If
If _ModelListView IsNot Nothing Then
If _IModelListView.EditorType = GetType(PivotGridListEditor) Then
View.SaveModel()
_ModelListView.PivotSettings = TryCast(View.Model, IModelPivotListView).PivotSettings.Settings
End If
If _IModelListView.EditorType = GetType(GridListEditor) Then
View.SaveModel()
_ModelListView.IsFooterVisible = TryCast(View.Model, IModelListView).IsFooterVisible
_ModelListView.IsGroupPanelVisible = TryCast(View.Model, IModelListView).IsGroupPanelVisible
_ModelListView.ShowAutoFilterRow = TryCast(View.Model, IModelListViewShowAutoFilterRow).ShowAutoFilterRow
_ModelListView.ShowFindPanel = TryCast(View.Model, IModelListViewShowFindPanel).ShowFindPanel
_onew.Delete(_ModelListView.ModelListViewColumn)
_WaitFormClass.Initwork(1, 1, TryCast(View.Model, IModelListView).Columns.Count)
For Each _Column In TryCast(View.Model, IModelListView).Columns
_WaitFormClass.DoWork()
_ModelListViewColumn = _onew.CreateObject(Of ModelListViewColumn)()
_ModelListViewColumn.ModelListView = _ModelListView
_ModelListViewColumn.Index = _Column.Index
_ModelListViewColumn.GroupIndex = _Column.GroupIndex
_ModelListViewColumn.HideValueIfZero = TryCast(_Column, IModelColumnExtender).HideValueIfZero
_ModelListViewColumn.InLineCriteria = TryCast(_Column, IModelColumnExtender).InLineCriteria
_ModelListViewColumn.InLineEdit = TryCast(_Column, IModelColumnExtender).InLineEdit
_ModelListViewColumn.AllowEdit = _Column.AllowEdit
_ModelListViewColumn.AllowSort = TryCast(_Column, IModelColumnAllowSort).AllowSort
_ModelListViewColumn.GroupInterval = _Column.GroupInterval
_ModelListViewColumn.ImmediatePostData = _Column.ImmediatePostData
_ModelListViewColumn.IsPassword = _Column.IsPassword
_ModelListViewColumn.PropertyName = _Column.PropertyName
_ModelListViewColumn.GroupIndex = _Column.GroupIndex
_ModelListViewColumn.MaxLength = _Column.MaxLength
_ModelListViewColumn.SortIndex = _Column.SortIndex
If _Column.Index >= 0 Then
_ModelListViewColumn.Width = TryCast(TryCast(View, ListView).Editor, GridListEditor).Columns(_Column.Index).Width
End If
_ModelListViewColumn.Caption = _Column.Caption
_ModelListViewColumn.Index = _Column.Index
_ModelListViewColumn.Id = _Column.Id
Next
End If
_onew.CommitChanges()
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "HIBA !")
Finally
GLOBAL_HAS_Audit = True
_Waitformclass.FinalWork
End Try
End Sub
Private Sub aResetCentralListViewSettings_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aResetCentralListViewSettings.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ModelListView As ModelListView
Dim _IModelListView As IModelListView = TryCast(View.Model, IModelListView)
If TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject IsNot Nothing Then
Dim _MasterObject As Guid = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject.oid
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=? and MasterObject=?", View.Id, _MasterObject))
Else
_ModelListView = _onew.FindObject(Of ModelListView)(CriteriaOperator.Parse("Id=?", View.Id))
End If
If _ModelListView IsNot Nothing Then
Dim _ModelListViewColumn_Collection As New XPCollection(Of ModelListViewColumn)(_onew.Session, CriteriaOperator.Parse("ModelListView=?", _ModelListView))
_onew.Delete(_ModelListViewColumn_Collection)
_onew.Delete(_ModelListView)
_onew.CommitChanges()
End If
End Sub
'//CSÍK
End Class
+32
View File
@@ -0,0 +1,32 @@
Partial Class CountListView
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,45 @@
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.Model
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.SystemModule
Public Class CountListView
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
'SetNavitemCaptionCount("RegistryTasks_ListView_Not_Completed", "@RegistryTask_ListView_Not_Completed")
'SetNavitemCaptionCount("CRM_Leads_Activity_Task_ListView", "CRM_Leads_Activity_Task_ListView")
End Sub
Sub SetNavitemCaptionCount(_ListView As String, _NavigationItem As String)
Dim ListViewModel As IModelListView = Application.FindModelView(_ListView)
Dim count As Long = TryCast(View.ObjectSpace, Xpo.XPObjectSpace).Session.Evaluate(ListViewModel.ModelClass.TypeInfo.Type, New AggregateOperand("", Aggregate.Count), CriteriaOperator.Parse(ListViewModel.Criteria))
Dim navItem As ChoiceActionItem = Application.MainWindow.GetController(Of ShowNavigationItemController).ShowNavigationItemAction.Items.Find(_NavigationItem, ChoiceActionItemFindType.Recursive, ChoiceActionItemFindTarget.Any)
Dim sArray() As String
If navItem IsNot Nothing Then
sArray = Split(navItem.Caption, "[")
If UBound(sArray) > 0 Then
navItem.Caption = Replace(sArray(0).ToString, "[", "").Trim + String.Format(" [{0}]", count)
Else
navItem.Caption += String.Format(" [{0}]", count)
End If
End If
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class CreateLogonWindowsControllerVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,22 @@
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
Public Class CreateLogonWindowsControllerVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class CustomPrintingController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,73 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports System.Drawing
Imports System.Object
Imports System.Windows.Forms
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.XtraPrinting
Imports System.Drawing.Printing
Imports DevExpress.XtraReports.UI
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.ExpressApp.Win.SystemModule
Imports DevExpress.Data.Filtering
Public Class CustomPrintingController
Inherits PrintingController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
'Protected Overrides Sub OnPrintingSettingsLoaded(ByVal args As PrintableComponentLinkEventArgs)
' MyBase.OnPrintingSettingsLoaded(args)
' CustomizePrintingSystem(args.PrintableComponentLink)
'End Sub
Private Sub CustomizePrintingSystem(ByVal link As PrintableComponentLink)
Dim _IModelListViewExtender As IModelListViewExtender = TryCast(View.Model, IModelListViewExtender)
Dim _CustomersFrom As CustomersFrom = View.ObjectSpace.FindObject(Of CustomersFrom)(CriteriaOperator.Parse("IsDefault=True"))
Dim _HeaderLeft As String = String.Format(_IModelListViewExtender.HeaderLeft, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _HeaderCenter As String = String.Format(_IModelListViewExtender.HeaderCenter, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _HeaderRight As String = String.Format(_IModelListViewExtender.HeaderRight, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _FooterLeft As String = String.Format(_IModelListViewExtender.FooterLeft, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _FooterCenter As String = String.Format(_IModelListViewExtender.FooterCenter, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _FooterRight As String = String.Format(_IModelListViewExtender.FooterRight, _CustomersFrom.FullName, View.Model.Caption, GLOBAL_MainModuleVersion)
Dim _PageHeaderFooter As PageHeaderFooter = TryCast(link.PageHeaderFooter, PageHeaderFooter)
_PageHeaderFooter.Header.Content.Clear()
_PageHeaderFooter.Footer.Content.Clear()
_PageHeaderFooter.Header.Content.AddRange(New String() {_HeaderLeft, _HeaderCenter, _HeaderRight})
'_PageHeaderFooter.Header.LineAlignment = BrickAlignment.Far
_PageHeaderFooter.Footer.Content.AddRange(New String() {_FooterLeft, _FooterCenter, _FooterRight})
'_PageHeaderFooter.Footer.LineAlignment = BrickAlignment.Far
'
End Sub
Private Sub CustomPrintingController_CustomPrint(sender As Object, e As HandledEventArgs) Handles Me.CustomPrint
e.Handled = True
Dim _PrintableComponentLink As PrintableComponentLink = New PrintableComponentLink(New PrintingSystem())
_PrintableComponentLink.Component = GetPrintable()
CustomizePrintingSystem(_PrintableComponentLink)
_PrintableComponentLink.PrintDlg()
End Sub
Private Sub CustomPrintingController_CustomShowPrintPreview(sender As Object, e As CustomShowPrintPreviewEventArgs) Handles Me.CustomShowPrintPreview
e.Handled = True
Dim _PrintableComponentLink As PrintableComponentLink = New PrintableComponentLink(New PrintingSystem())
_PrintableComponentLink.Component = GetPrintable()
CustomizePrintingSystem(_PrintableComponentLink)
_PrintableComponentLink.ShowPreviewDialog()
End Sub
End Class
@@ -0,0 +1,31 @@
Partial Class ReportWizardModifyController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,99 @@
Imports Microsoft.VisualBasic
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.Xpo
Imports DevExpress.ExpressApp.Reports
Imports DevExpress.ExpressApp.Reports.Win
Imports DevExpress.Persistent.Validation
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraReports.Parameters
Imports DevExpress.XtraReports.Design
Imports DevExpress.XtraReports.UserDesigner
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.AuditTrail
Imports DevExpress.Persistent.BaseImpl
Imports System.Data
Imports System.Drawing.Printing
Partial Public Class ReportWizardModifyController
Inherits WindowController
Private reportServiceController As WinReportServiceController
Public Sub New()
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
reportServiceController = Frame.GetController(Of WinReportServiceController)()
AddHandler reportServiceController.NewXafReportWizardShowing, AddressOf reportServiceController_NewXafReportWizardShowing
'AddHandler reportServiceController.CustomShowPreview, AddressOf WinReportsController_CustomShowPreview
AddHandler reportServiceController.CustomShowPreview, AddressOf reportServiceController_CustomShowPreview
End Sub
Protected Overrides Sub OnDeactivated()
RemoveHandler reportServiceController.NewXafReportWizardShowing, AddressOf reportServiceController_NewXafReportWizardShowing
'RemoveHandler reportServiceController.CustomShowPreview, AddressOf WinReportsController_CustomShowPreview
reportServiceController = Nothing
MyBase.OnDeactivated()
End Sub
Private Sub reportServiceController_CustomShowPreview(ByVal sender As Object, ByVal e As CustomShowPreviewEventArgs)
AddHandler e.Report.PrintProgress, AddressOf report_PrintProgress
End Sub
Private Sub report_PrintProgress(sender As Object, e As DevExpress.XtraPrinting.PrintProgressEventArgs)
End Sub
Private Sub reportServiceController_NewXafReportWizardShowing(ByVal sender As Object, ByVal e As NewXafReportWizardShowingEventArgs)
If (Not e.ReportDataType.Equals(GetType(CustomReportData))) Then
Return
End If
Dim newReportParamsObject As New CustomReportWizardParameters(e.WizardParameters.Report)
newReportParamsObject.ReportName = "Custom report name"
newReportParamsObject.AdditionalInfo = "AdditionalInfo default value"
e.WizardParameters = newReportParamsObject
End Sub
Private Sub WinReportsController_CustomShowPreview(ByVal sender As Object, ByVal e As CustomShowPreviewEventArgs)
' 'Dim _NameOfCreator As XRLabel = TryCast(e.Report.FindControl("NameOfCreator", False), XRLabel)
' If e.Report.Name = "xafReport_OfferOut" Then
' Dim _ocur As Xpo.XPObjectSpace = TryCast(e.Report.ObjectSpace, Xpo.XPObjectSpace)
' Dim _AuditTrail As XPCollection(Of AuditDataItemPersistent) = AuditedObjectWeakReference.GetAuditTrail(_ocur.Session, e.Report.GetCurrentRow)
' 'Dim _DocumentNumber As XRLabel = TryCast(e.Report.FindControl("DocumentNumber", False), XRLabel)
' 'Dim _st As String = e.Report.GetCurrentColumnValue("DocumentNumber")
' 'Dim _AuditedObjectWeakReference As XPCollection = AuditedObjectWeakReference.GetAuditTrail()
' 'Dim _OfferOutHeader As OfferOutHeader = _ocur.FindObject(Of OfferOutHeader)(CriteriaOperator.Parse("DocumentNumber=?", _DocumentNumber.Text))
' 'Dim _AuditDataItemPersistent As AuditDataItemPersistent = _ocur.FindObject(Of AuditDataItemPersistent)(CriteriaOperator.Parse("AuditedObject=?", _OfferOutHeader.Oid))
' '_NameOfCreator.Text = _AuditDataItemPersistent.UserName
' End If
'Dim _ReportData As ReportData =
'e.Report.ExportToPdf()
End Sub
End Class
<NonPersistent()> _
Friend Class CustomReportWizardParameters
Inherits NewXafReportWizardParameters
Public Sub New(ByVal report As XafReport)
MyBase.New(report)
End Sub
Public Property AdditionalInfo() As String
Get
Return (CType(Report, CustomXafReport)).AdditionalInfo
End Get
Set(ByVal value As String)
CType(Report, CustomXafReport).AdditionalInfo = value
End Set
End Property
End Class
@@ -0,0 +1,43 @@
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports DevExpress.ExpressApp.Reports
Imports DevExpress.Xpo
Imports DevExpress.XtraReports
Imports DevExpress.XtraReports.Serialization
Imports DevExpress.Persistent.BaseImpl
<RootClass()> _
Public Class CustomXafReport
Inherits XafReport
Protected additionalInfo_Renamed As String
Public Property AdditionalInfo() As String
Get
Return additionalInfo_Renamed
End Get
Set(ByVal value As String)
additionalInfo_Renamed = value
End Set
End Property
Protected Overrides Sub SerializeProperties(ByVal serializer As XRSerializer)
MyBase.SerializeProperties(serializer)
serializer.SerializeString("AdditionalInfo", AdditionalInfo)
End Sub
Protected Overrides Sub DeserializeProperties(ByVal serializer As XRSerializer)
MyBase.DeserializeProperties(serializer)
AdditionalInfo = serializer.DeserializeString("AdditionalInfo", String.Empty)
End Sub
End Class
<System.ComponentModel.DisplayName("CustomReport")> _
Public Class CustomReportData
Inherits ReportData
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Protected Overrides Function CreateReport() As XafReport
Return New CustomXafReport()
End Function
End Class
+31
View File
@@ -0,0 +1,31 @@
Partial Class Customization
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,54 @@
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.SystemModule
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.ExpressApp.Model
Imports DevExpress.XtraLayout
Public Class Customization
Inherits DevExpress.ExpressApp.WindowController
Private controller As WindowTemplateController
Public Sub New()
TargetWindowType = WindowType.Main
AddHandler Activated, AddressOf CustomizeWindowController_Activated
End Sub
Private Sub CustomizeWindowController_Activated(ByVal sender As Object, ByVal e As EventArgs)
controller = Frame.GetController(Of WindowTemplateController)()
AddHandler controller.CustomizeWindowCaption, AddressOf controller_CustomizeWindowCaption
AddHandler controller.CustomizeWindowStatusMessages, AddressOf controller_CustomizeWindowStatusMessages
End Sub
Private Sub controller_CustomizeWindowCaption(ByVal sender As Object, _
ByVal e As CustomizeWindowCaptionEventArgs)
e.WindowCaption.SecondPart = GLOBAL_WINFormCaption
End Sub
Private Sub controller_CustomizeWindowStatusMessages(ByVal sender As Object, _
ByVal e As CustomizeWindowStatusMessagesEventArgs)
e.StatusMessages.Add(GLOBAL_WINFormCaption)
End Sub
End Class
Public Class CustomDateTimeEditor
Inherits DatePropertyEditor
Public Sub New(ByVal objectType As Type, ByVal info As IModelMemberViewItem)
MyBase.New(objectType, info)
End Sub
Protected Overrides Sub SetupRepositoryItem(ByVal item As DevExpress.XtraEditors.Repository.RepositoryItem)
'MyBase.SetupRepositoryItem(item)
'CType(item, RepositoryItemDateTimeEdit).VistaDisplayMode = _
'DevExpress.Utils.DefaultBoolean.True
'CType(item, RepositoryItemDateTimeEdit).VistaEditTime = _
'DevExpress.Utils.DefaultBoolean.True
'CType(item, RepositoryItemDateTimeEdit).Mask.EditMask = "MM.dd.yyyy hh:mm:ss"
'CType(item, RepositoryItemDateTimeEdit).Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTimeAdvancingCaret
'CType(item, RepositoryItemDateTimeEdit).AllowNullInput = True
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class DateTimeHandle
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,110 @@
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 System.Windows.Forms
Imports DevExpress.XtraLayout
Public Class DateTimeHandle
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
TargetViewType = ViewType.DetailView
End Sub
Protected Overloads Overrides Sub OnActivated()
MyBase.OnActivated()
For Each editor As PropertyEditor In (CType(View, DetailView)).GetItems(Of PropertyEditor)()
AddHandler editor.ControlCreated, AddressOf editor_ControlCreated
Next editor
End Sub
Private Sub editor_ControlCreated(ByVal sender As Object, ByVal e As EventArgs)
' You can access the corresponding property editor control by the following code:
Dim editorControl As Control = TryCast((CType(sender, PropertyEditor)).Control, Control)
AddHandler editorControl.HandleCreated, AddressOf editorControl_HandleCreated
Dim _DateTimeEditor As DevExpress.XtraEditors.DateEdit = TryCast(editorControl, DevExpress.XtraEditors.DateEdit)
If _DateTimeEditor IsNot Nothing Then
_DateTimeEditor.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTimeAdvancingCaret
AddHandler _DateTimeEditor.Click, AddressOf DateTimeEditor_Click
AddHandler _DateTimeEditor.KeyDown, AddressOf DateTimeEditor_KeyDown
End If
Dim _SpinEditor As DevExpress.XtraEditors.SpinEdit = TryCast(editorControl, DevExpress.XtraEditors.SpinEdit)
If _SpinEditor IsNot Nothing Then
AddHandler _SpinEditor.Click, AddressOf SpinEditor_Click
AddHandler _SpinEditor.KeyDown, AddressOf SpinEditor_KeyDown
End If
Dim _TextEditor As DevExpress.XtraEditors.TextEdit = TryCast(editorControl, DevExpress.XtraEditors.TextEdit)
If _TextEditor IsNot Nothing Then
AddHandler _TextEditor.KeyDown, AddressOf TextEditor_KeyDown
End If
End Sub
Private Sub editorControl_HandleCreated(ByVal sender As Object, ByVal e As EventArgs)
' Sometimes it is necessary to access editor's control after it is visible (its handle is created).
RemoveHandler (CType(sender, Control)).HandleCreated, AddressOf editorControl_HandleCreated
End Sub
Private Sub DateTimeEditor_Click(ByVal sender As Object, ByVal e As System.EventArgs)
sender.SelectAll()
End Sub
Private Sub SpinEditor_Click(ByVal sender As Object, ByVal e As System.EventArgs)
sender.Selectall()
End Sub
Private Sub DateTimeEditor_KeyDown(sender As Object, e As KeyEventArgs)
Select Case e.KeyCode
Case Keys.Enter, Keys.Down
DirectCast(View.Control, LayoutControl).FocusHelper.GetNextControl(sender).Focus()
e.Handled = True
Case Else
End Select
End Sub
Private Sub SpinEditor_KeyDown(sender As Object, e As KeyEventArgs)
Select Case e.KeyCode
Case Keys.Enter, Keys.Down
DirectCast(View.Control, LayoutControl).FocusHelper.GetNextControl(sender).Focus()
e.Handled = True
Case Else
End Select
End Sub
Private Sub TextEditor_KeyDown(sender As Object, e As KeyEventArgs)
If TryCast(sender, DevExpress.ExpressApp.Win.Editors.LargeStringEdit) IsNot Nothing Then
Else
Select Case e.KeyCode
Case Keys.Enter, Keys.Down
DirectCast(View.Control, LayoutControl).FocusHelper.GetNextControl(sender).Focus()
e.Handled = True
Case Keys.Up
DirectCast(View.Control, LayoutControl).FocusHelper.ProcessDialogKey(Keys.Shift + Keys.Tab)
e.Handled = True
Case Else
End Select
End If
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class DisableGridColumnsVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,44 @@
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.XtraGrid.Columns
Imports DevExpress.ExpressApp.Win.Editors
Public Class DisableGridColumnsVC
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
Dim _GridListEditor As GridListEditor = TryCast(View.Editor, GridListEditor)
Dim _GridColumn As GridColumn
If _GridListEditor IsNot Nothing Then
For Each _GridColumn In _GridListEditor.GridView.Columns
If _GridColumn.FieldName Like "row_*" Or _GridColumn.FieldName Like "!row_*" Then
_GridColumn.Visible = False
_GridColumn.OptionsColumn.AllowShowHide = False
End If
Next
End If
'GridListEditor gridListEditor = View.Editor as GridListEditor;
' if (gridListEditor != null)
' foreach (GridColumn column in gridListEditor.GridView.Columns)
' if (column.FieldName == "Photo")
' column.OptionsColumn.AllowShowHide = false;
End Sub
End Class
@@ -0,0 +1,31 @@
Partial Class DisableValidationPopUpWindow
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,31 @@
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
Public Class DisableValidationPopUpWindow
Inherits DevExpress.ExpressApp.Validation.Win.ValidationResultsShowingController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated() '--- Ha ki van kommentelve nem jelenik meg a validáló ablak--------
'AddHandler (CType(Application, DevExpress.ExpressApp.Win.WinApplication)).CustomHandleException, AddressOf ViewController1_CustomHandleException
End Sub
Private Sub ViewController1_CustomHandleException(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.Win.CustomHandleExceptionEventArgs)
e.Handled = True
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
'RemoveHandler (CType(Application, DevExpress.ExpressApp.Win.WinApplication)).CustomHandleException, AddressOf ViewController1_CustomHandleException
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class DragAndDropBusinessDirectory_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()
End Sub
End Class
@@ -0,0 +1,123 @@
<?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="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,397 @@
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.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Win
Imports Microsoft.Office.Interop
Imports System.IO
Imports DevExpress.XtraTreeList
Imports DevExpress.ExpressApp.Win.Controls
Imports DevExpress.ExpressApp.TreeListEditors.Win
Imports DevExpress.XtraTreeList.Nodes
Imports Microsoft.Office
Imports System.Runtime.InteropServices
Imports System.Collections.Specialized
Imports System.Threading
Public Class DragAndDropBusinessDirectory_VC
Inherits DevExpress.ExpressApp.ViewController
Private _TreeListEditor As TreeListEditor
Private _TreeList As TreeList
Private _Selection As New ArrayList
Private _EnabledSelection = True
Private _CanEmailDrop As Boolean = True
Dim _WaitFormClass As New WaitFormClass
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id Like "*BusinessDirectory_ListView*" Then
AddHandler View.ControlsCreated, AddressOf View_ControlsCreated
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "BusinessDirectory_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController).DeleteAction.Active.SetItemValue("", True)
End If
End Sub
Private Sub View_ControlsCreated(sender As Object, e As EventArgs)
_TreeListEditor = CType((CType(View, DevExpress.ExpressApp.ListView)).Editor, TreeListEditor)
_TreeList = _TreeListEditor.TreeList
_TreeList.OptionsDragAndDrop.DragNodesMode = DragNodesMode.Multiple
_TreeList.OptionsDragAndDrop.ExpandNodeOnDrag = True
AddHandler _TreeList.DragOver, AddressOf _TreeList_DragOver
AddHandler _TreeList.DragDrop, AddressOf _TreeList_DragDrop
AddHandler _TreeList.DragLeave, AddressOf _TreeList_DragLeave
AddHandler View.SelectionChanged, AddressOf BusinessDirectory_ListView_SelectionChanged
End Sub
#Region "Drag and Drop"
Private Sub _TreeList_DragOver(sender As Object, e As DragEventArgs)
'Dim dragNode As TreeListNode = TryCast(e.Data.GetData(GetType(TreeListNode)), TreeListNode)
e.Effect = DragDropEffects.All
'e.Effect = GetDragDropEffect(TryCast(sender, TreeList), dragNode, New Point(e.X, e.Y))
End Sub
Private Sub _TreeList_DragLeave(sender As Object, e As EventArgs)
'Fileok Clipboard droplistba
Dim _Paths As New StringCollection
For Each _BusinessDirectory As BusinessDirectory In View.SelectedObjects
If _BusinessDirectory.FileData IsNot Nothing Then
Dim _FileName As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetTempPath, _BusinessDirectory.FileData.FileName)
Dim _StreamFile As System.IO.Stream = New System.IO.FileStream(_FileName, System.IO.FileMode.Create)
_BusinessDirectory.FileData.SaveToStream(_StreamFile)
_StreamFile.Close()
_Paths.Add(_FileName)
End If
Next
If _Paths.Count > 0 Then
Dim data As New DataObject()
data.SetFileDropList(_Paths)
_TreeList.DoDragDrop(data, DragDropEffects.Copy)
End If
End Sub
Private Sub _TreeList_DragDrop(sender As Object, e As DragEventArgs)
Dim _TargetNode As TreeListNode = Nothing
Dim _Point As Point
Dim _BusinessDirectoryDrop As Boolean = False
Dim _FileDrop As Boolean = False
Dim _EmailDrop As Boolean = False
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _TL As TreeList = TryCast(sender, TreeList)
If _TL IsNot Nothing Then
_Point = _TL.PointToClient(New Point(e.X, e.Y))
_TargetNode = _TL.CalcHitInfo(_Point).Node
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
_FileDrop = True
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
_EmailDrop = True
ElseIf TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory) IsNot Nothing Then
_BusinessDirectoryDrop = True
End If
End If
If _TargetNode Is Nothing Then Exit Sub
If _BusinessDirectoryDrop Then
Dim _TargetBusinessDirectory As BusinessDirectory = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
If TryCast(_Selection(0), BusinessDirectory).Oid <> _TargetBusinessDirectory.Oid Then
If _TargetBusinessDirectory.IsFolder Then
If _TargetBusinessDirectory IsNot Nothing Then
_EnabledSelection = False
For Each _BusinessDirectory As BusinessDirectory In _Selection
_BusinessDirectory.BusinessDirectory_Parent = _TargetBusinessDirectory
Next
_ocur.CommitChanges()
_EnabledSelection = True
End If
Else
MsgBox("Fájl nem használható könyvtárként!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Figyelem!")
End If
Else
MsgBox("Nem helyezhetõ át az elem saját magába!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Figyelem!")
End If
End If
If _FileDrop Then
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_Selection.Clear()
_WaitFormClass.Initwork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
_WaitFormClass.DoWork()
If System.IO.File.Exists(_ActFile) Then
Dim _BusinessDirectory As New BusinessDirectory(_ocur.Session)
With _BusinessDirectory
.IsFolder = False
.ShortName = IO.Path.GetFileName(IO.Path.GetFileNameWithoutExtension(_ActFile))
.FileData = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.BusinessDirectory_Parent = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
End If
Next
_ocur.CommitChanges()
_WaitFormClass.FinalWork()
End If
End If
If _EmailDrop Then
Dim _OL As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
Dim _Explorer As Microsoft.Office.Interop.Outlook.Explorer = _OL.ActiveExplorer
Dim _TargetBusinessDirectory As BusinessDirectory = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
If _TargetBusinessDirectory.IsFolder Then
If _CanEmailDrop Then
If _Explorer.Selection.Count > 0 Then
_CanEmailDrop = False
Dim _MemoryStream As MemoryStream = TryCast(e.Data.GetData("FileGroupDescriptor"), MemoryStream)
Dim _TMPFileName As String = Path.GetTempPath + Path.GetRandomFileName
Dim _FileStream As FileStream = File.OpenWrite(_TMPFileName)
_MemoryStream.WriteTo(_FileStream)
_FileStream.Flush()
_FileStream.Close()
Dim _TxtLine As String = ""
If File.Exists(_TMPFileName) Then
Dim _StreamReader As New StreamReader(_TMPFileName)
Do While _StreamReader.Peek <> -1
_TxtLine += _StreamReader.ReadLine
Loop
End If
If _TxtLine.Contains(".msg") Then
_WaitFormClass.Initwork(0, 1, _Explorer.Selection.Count)
For ik = 1 To _Explorer.Selection.Count
_WaitFormClass.DoWork()
Dim _FileIn As Object = _Explorer.Selection(ik)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
Dim _MeetingItem As Microsoft.Office.Interop.Outlook.MeetingItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MeetingItem)
If _MailItem Is Nothing And _MeetingItem Is Nothing Then Throw New Exception("*Csak e-mail, értekezlet és találkozó típusú Outlook elemet lehet beilleszteni!")
If _MailItem IsNot Nothing Then
Try
Dim _FileName As String = ""
Dim _Subject As String = ""
If _MailItem.Subject IsNot Nothing Then
_Subject = _MailItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
Else
_Subject = "Nincs tárgy"
End If
If Not IsValidFileName(_Subject) Then Throw New Exception("*Illegális karakterek a tárgy mezõben!")
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
_MailItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _BusinessDirectory As New BusinessDirectory(_ocur.Session)
With _BusinessDirectory
.FileData = LoadOtherFile(_FileName, New FileData(_ocur.Session))
.FileData.FileName = IO.Path.GetFileName(_FileName)
.FileCreated = _MailItem.ReceivedTime 'Küldés dátuma kell?
.FileModified = GetFileModifiedDate(_FileName)
.ShortName = IO.Path.GetFileName(_FileName)
.BusinessDirectory_Parent = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
.IsFolder = False
.EMail_Sender = _MailItem.Sender.Name
.Email_Copy = _MailItem.CC
End With
System.IO.File.Delete(_FileName)
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
End Try
ElseIf _MeetingItem IsNot Nothing Then
Try
Dim _FileName As String = ""
Dim _Subject As String = ""
If _MeetingItem.Subject IsNot Nothing Then
_Subject = _MeetingItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
_Subject = _Subject.Replace("|", "_")
Else
_Subject = "Nincs tárgy"
End If
If Not IsValidFileName(_Subject) Then Throw New Exception("*Illegális karakterek a tárgy mezõben!")
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
_MeetingItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _BusinessDirectory As New BusinessDirectory(_ocur.Session)
With _BusinessDirectory
.FileData = LoadOtherFile(_FileName, New FileData(_ocur.Session))
.FileData.FileName = IO.Path.GetFileName(_FileName)
.FileCreated = _MeetingItem.ReceivedTime 'Küldés dátuma kell?
.FileModified = GetFileModifiedDate(_FileName)
.ShortName = IO.Path.GetFileName(_FileName)
.BusinessDirectory_Parent = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
.IsFolder = False
.EMail_Sender = _MeetingItem.SenderName '.Sender.Name
End With
System.IO.File.Delete(_FileName)
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
Finally
_WaitFormClass.FinalWork()
End Try
End If
Next
_ocur.CommitChanges()
Marshal.ReleaseComObject(_Explorer)
Marshal.ReleaseComObject(_Explorer)
_Explorer = Nothing
Marshal.ReleaseComObject(_OL)
_OL = Nothing
_WaitFormClass.FinalWork()
Else
_WaitFormClass.Initwork(0, 1, 1)
_WaitFormClass.DoWork()
Dim _FileNameFromStream As New StringBuilder("")
_FileNameFromStream.Append(Path.GetTempPath)
Dim fileGroupDescriptor(512) As Byte
_MemoryStream.Read(fileGroupDescriptor, 0, 512)
Dim i As Integer = 76
While fileGroupDescriptor(i) <> 0
_FileNameFromStream.Append(Convert.ToChar(fileGroupDescriptor(i)))
i += 1
End While
Dim _FileIn As Object = _Explorer.Selection(1)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
For Each _Attachment As Microsoft.Office.Interop.Outlook.Attachment In _MailItem.Attachments
If _Attachment.FileName = Path.GetFileName(_FileNameFromStream.ToString) Then
_Attachment.SaveAsFile(Path.GetTempPath + _Attachment.FileName)
If System.IO.File.Exists(Path.GetTempPath + _Attachment.FileName) Then
Dim _BusinessDirectory As New BusinessDirectory(_ocur.Session)
With _BusinessDirectory
.FileData = LoadOtherFile(Path.GetTempPath + _Attachment.FileName, New FileData(_ocur.Session))
.FileData.FileName = IO.Path.GetFileName(Path.GetTempPath + _Attachment.FileName)
.FileCreated = GetFileCreatedDate(Path.GetTempPath + _Attachment.FileName)
.FileModified = GetFileModifiedDate(Path.GetTempPath + _Attachment.FileName)
.ShortName = IO.Path.GetFileName(Path.GetTempPath + _Attachment.FileName)
.BusinessDirectory_Parent = TryCast(DirectCast(_TargetNode, DevExpress.ExpressApp.Win.Controls.ObjectTreeListNode).Object, BusinessDirectory)
.IsFolder = False
.EMail_Sender = _MailItem.Sender.Name
.Email_Copy = _MailItem.CC
End With
System.IO.File.Delete(Path.GetTempPath + _Attachment.FileName)
End If
End If
Next
_ocur.CommitChanges()
Marshal.ReleaseComObject(_Explorer)
Marshal.ReleaseComObject(_Explorer)
_Explorer = Nothing
Marshal.ReleaseComObject(_OL)
_OL = Nothing
_WaitFormClass.FinalWork()
End If
End If
End If
_CanEmailDrop = True
Else
MsgBox("Fájl nem használható könyvtárként!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Figyelem!")
End If
End If
e.Effect = DragDropEffects.None
End Sub
#End Region
Private Function GetDragDropEffect(ByVal tl As TreeList, ByVal dragNode As TreeListNode, _Point As Point) As DragDropEffects
Dim _TargetNode As TreeListNode
Dim _PointNew As Point = tl.PointToClient(_Point)
_TargetNode = tl.CalcHitInfo(_PointNew).Node
Return DragDropEffects.Move
End Function
Private Sub BusinessDirectory_ListView_SelectionChanged(sender As Object, e As EventArgs)
If _EnabledSelection Then
_Selection.Clear()
_Selection.AddRange(View.SelectedObjects)
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
Public Function IsValidFileName(ByVal fn As String) As Boolean
Try
Dim fi As New IO.FileInfo(fn)
Catch ex As Exception
Return False
End Try
Return True
End Function
End Class
@@ -0,0 +1,51 @@
Partial Class DragAndDropCRMOutlookCRM_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.aDragDrop_CRM_Change = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aDragDrop_CRM_Change
'
Me.aDragDrop_CRM_Change.AcceptButtonCaption = Nothing
Me.aDragDrop_CRM_Change.CancelButtonCaption = Nothing
Me.aDragDrop_CRM_Change.Caption = "aDragDrop_CRM_Change"
Me.aDragDrop_CRM_Change.Category = "aDragDrop_CRM_Change"
Me.aDragDrop_CRM_Change.ConfirmationMessage = Nothing
Me.aDragDrop_CRM_Change.Id = "aDragDrop_CRM_Change"
Me.aDragDrop_CRM_Change.ImageName = Nothing
Me.aDragDrop_CRM_Change.Shortcut = Nothing
Me.aDragDrop_CRM_Change.Tag = Nothing
Me.aDragDrop_CRM_Change.TargetObjectsCriteria = Nothing
Me.aDragDrop_CRM_Change.TargetViewId = Nothing
Me.aDragDrop_CRM_Change.ToolTip = Nothing
Me.aDragDrop_CRM_Change.TypeOfView = Nothing
End Sub
Friend WithEvents aDragDrop_CRM_Change As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,126 @@
<?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="aDragDrop_CRM_Change.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,603 @@
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.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Win
Imports Microsoft.Office.Interop
Imports System.IO
Imports DevExpress.ExpressApp.Utils
Imports System.Runtime.InteropServices
Imports Microsoft.Office
Public Class DragAndDropCRMOutlookCRM_VC
Inherits DevExpress.ExpressApp.ViewController
Private _Selection As New ArrayList
Dim _ActSelection As Object
Private downHitInfo As GridHitInfo = Nothing
Dim _WaitFormClass As New WaitFormClass
Private _CRM_Opportunities As CRM_Opportunities = Nothing
Private _AllowSelect_CRM_Opportunities As Boolean = False
Private _DoDragGridViewOutlookEMailAttachments As DevExpress.XtraGrid.Views.Grid.GridView
Private _DoDragGridControlOutlookEMailAttachments As DevExpress.XtraGrid.GridControl
Private _DoDragGridViewOutlookEMailIn As DevExpress.XtraGrid.Views.Grid.GridView
Private _DoDragGridControlOutlookEMailIn As DevExpress.XtraGrid.GridControl
Private _ToDragGridControlCRM_Opportunities As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewCRM_Opportunities As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlCRM_LeadsDocumentation As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewCRM_LeadsDocumentation As DevExpress.XtraGrid.Views.Grid.GridView
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
If View.Id = "" Then
End If
If View.Id = "OutlookEMailIn_ListView_CRM_Outlook" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_DoDragGridViewOutlookEMailIn = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_DoDragGridViewOutlookEMailIn.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseUp
_DoDragGridControlOutlookEMailIn = _DoDragGridViewOutlookEMailIn.GridControl
AddHandler _DoDragGridViewOutlookEMailIn.MouseDown, AddressOf _DoDragGridViewOutlookEMailIn_MouseDown
AddHandler _DoDragGridViewOutlookEMailIn.MouseMove, AddressOf _DoDragGridViewOutlookEMailIn_MouseMove
AddHandler View.SelectionChanged, AddressOf OutlookEMailIn_ListView_SelectionChanged
End If
If View.Id = "OutlookEMailIn_OutlookEMailAttachments_ListView" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_DoDragGridViewOutlookEMailAttachments = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_DoDragGridViewOutlookEMailAttachments.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseUp
_DoDragGridControlOutlookEMailAttachments = _DoDragGridViewOutlookEMailAttachments.GridControl
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseDown, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseMove, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove
AddHandler View.SelectionChanged, AddressOf OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged
End If
If View.Id = "CRM_Opportunities_ListView_CRM_Outlook" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCRM_Opportunities = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCRM_Opportunities = _ToDragGridViewCRM_Opportunities.GridControl
AddHandler _ToDragGridControlCRM_Opportunities.DragOver, AddressOf _ToDragGridControlCRM_Opportunities_DragOver
AddHandler _ToDragGridControlCRM_Opportunities.DragDrop, AddressOf _ToDragGridControlCRM_Opportunities_DragDrop
AddHandler _ToDragGridViewCRM_Opportunities.MouseMove, AddressOf _ToDragGridControlCRM_Opportunities_MouseMove
AddHandler View.SelectionChanged, AddressOf CRM_Opportunities_ListView_CRM_Outlook_SelectionChanged
End If
If View.Id = "CRM_Leads_CRM_LeadsDocumentation_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCRM_LeadsDocumentation = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCRM_LeadsDocumentation = _ToDragGridViewCRM_LeadsDocumentation.GridControl
AddHandler _ToDragGridControlCRM_LeadsDocumentation.DragOver, AddressOf ToDragGridControlControlCRM_LeadsDocumentation_DragOver
AddHandler _ToDragGridControlCRM_LeadsDocumentation.DragDrop, AddressOf ToDragGridControlCRM_LeadsDocumentation_DragDrop
AddHandler _ToDragGridViewCRM_LeadsDocumentation.MouseMove, AddressOf ToDragGridView_MouseMove
End If
End Sub
Private Sub _DoDragGridViewOutlookEMailIn_MouseDown(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
downHitInfo = Nothing
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If Control.ModifierKeys <> Keys.None Then
Return
End If
If e.Button = MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
downHitInfo = hitInfo
End If
End Sub
Private Sub _DoDragGridViewOutlookEMailIn_MouseMove(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
If e.Button = MouseButtons.Left AndAlso downHitInfo IsNot Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
Dim dragRect As New Rectangle(New Point(downHitInfo.HitPoint.X - dragSize.Width / 2, downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
If (Not dragRect.Contains(New Point(e.X, e.Y))) Then
_AllowSelect_CRM_Opportunities = True
view.GridControl.DoDragDrop(_Selection, DragDropEffects.All)
downHitInfo = Nothing
End If
End If
End Sub
Private Sub OutlookEMailIn_ListView_SelectionChanged(sender As Object, e As EventArgs)
_Selection.Clear()
_Selection.AddRange(View.SelectedObjects)
End Sub
Private Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
downHitInfo = Nothing
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If Control.ModifierKeys <> Keys.None Then
Return
End If
If e.Button = MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
downHitInfo = hitInfo
End If
End Sub
Private Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
If e.Button = MouseButtons.Left AndAlso downHitInfo IsNot Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
Dim dragRect As New Rectangle(New Point(downHitInfo.HitPoint.X - dragSize.Width / 2, downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
If (Not dragRect.Contains(New Point(e.X, e.Y))) Then
_AllowSelect_CRM_Opportunities = True
view.GridControl.DoDragDrop(_Selection, DragDropEffects.All)
downHitInfo = Nothing
End If
End If
End Sub
Private Sub OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged(sender As Object, e As EventArgs)
_Selection.Clear()
_Selection.AddRange(View.SelectedObjects)
End Sub
Private Sub _ToDragGridControlCRM_Opportunities_DragOver(sender As Object, e As DragEventArgs)
e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewCRM_Opportunities.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCRM_Opportunities.CollapseAllGroups()
If _ToDragGridViewCRM_Opportunities.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCRM_Opportunities.ExpandGroupRow(_GridHitInfo.RowHandle)
If _ToDragGridViewCRM_Opportunities.IsDataRow(_GridHitInfo.RowHandle) Then
_ToDragGridViewCRM_Opportunities.ClearSelection()
_ToDragGridViewCRM_Opportunities.SelectRow(_GridHitInfo.RowHandle)
End If
End Sub
Private Sub _ToDragGridControlCRM_Opportunities_DragDrop(sender As Object, e As DragEventArgs)
Try
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
Dim _CRM_Opportunities As CRM_Opportunities = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), CRM_Opportunities)
If _CRM_Opportunities Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = View.ObjectSpace
Dim _OutlookEMailInSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _OutlookEMailInSelection IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, _OutlookEMailInSelection.Count)
If TryCast(_OutlookEMailInSelection(0), OutlookEMailIn) IsNot Nothing Then
For Each _OutlookEMailIn As OutlookEMailIn In _OutlookEMailInSelection
Dim _CRM_Leads_Activity As New CRM_Leads_Activity(_ocur.Session)
_OutlookEMailIn = _ocur.GetObject(_OutlookEMailIn)
_CRM_Leads_Activity.CRM_Opportunities = _CRM_Opportunities
_CRM_Leads_Activity.CRM_Leads = _CRM_Opportunities.CRM_Leads
_CRM_Leads_Activity.EventType = eEventType.eEMailIn
_CRM_Leads_Activity.Email_Oid = _OutlookEMailIn.Oid.ToString
_OutlookEMailIn.Qualified = True
_OutlookEMailIn.IsReaded = True
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
ElseIf TryCast(_OutlookEMailInSelection(0), OutlookEMailAttachments) IsNot Nothing Then
If _CRM_Opportunities.CRM_Leads Is Nothing Then Throw New Exception("*Nem tartozik Potenciáli ügyfél a CRM ügyhöz!")
_Selection.Clear()
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _OutlookEMailInSelection
Dim _CRM_LeadsDocumentation As New CRM_LeadsDocumentation(_ocur.Session)
With (_CRM_LeadsDocumentation)
.CRM_Leads = _ocur.GetObject(_CRM_Opportunities.CRM_Leads)
.File = _ocur.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
End With
_Selection.Add(_CRM_LeadsDocumentation)
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookCRM_VC).aDragDrop_CRM_Change), PopupWindowShowActionHelper).ShowPopupWindow()
Else
Throw New Exception("*Váratlan hiba történt a folyamat megszakadt!")
End If
ElseIf e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop) 'File
If _FileIn IsNot Nothing Then
_Selection.Clear()
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CRM_LeadsDocumentation As New CRM_LeadsDocumentation(_ocur.Session)
With (_CRM_LeadsDocumentation)
.CRM_Leads = _ocur.GetObject(_CRM_Opportunities.CRM_Leads)
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.ShortName = .File.FileName
End With
_Selection.Add(_CRM_LeadsDocumentation)
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookCRM_VC).aDragDrop_CRM_Change), PopupWindowShowActionHelper).ShowPopupWindow()
End If
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then 'Email
Dim _OL As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
_WaitFormClass.InitWork(0, 1, _OL.ActiveExplorer.Selection.Count)
If _OL.ActiveExplorer.Selection.Count > 0 Then
For ik As Long = 1 To _OL.ActiveExplorer.Selection.Count
Dim _FileIn As Object = _OL.ActiveExplorer.Selection(ik)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
If _MailItem IsNot Nothing Then
Dim _FileName As String = ""
Dim _Subject As String = ""
If _MailItem.Subject IsNot Nothing Then
_Subject = _MailItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
Else
_Subject = "Nincs tárgy"
End If
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
_FileName = _FileName.Replace("\\", "\")
_MailItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _CRM_LeadsDocumentation As New CRM_LeadsDocumentation(_ocur.Session)
With (_CRM_LeadsDocumentation)
.CRM_Leads = _ocur.GetObject(_CRM_Opportunities.CRM_Leads)
.FileCreated = GetFileCreatedDate(_FileName)
.FileModified = GetFileModifiedDate(_FileName)
.File = LoadOtherFile(_FileName, New FileData(_ocur.Session))
.ShortName = .File.FileName
End With
System.IO.File.Delete(_FileName)
End If
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
SwitchOutlookPanes(_OL)
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RefreshController).RefreshAction.DoExecute()
End Try
End Sub
Private Sub _ToDragGridControlCRM_Opportunities_MouseMove(sender As Object, e As MouseEventArgs)
If _AllowSelect_CRM_Opportunities Then
Dim view As XafGridView = TryCast(sender, XafGridView)
view.ClearSelection()
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
view.SelectRow(hitInfo.RowHandle)
End If
End Sub
Private Sub CRM_Opportunities_ListView_CRM_Outlook_SelectionChanged(sender As Object, e As EventArgs)
' frissíteni kell a masterdetail view-et! na de hogy a pékbe?
End Sub
Private Sub ToDragGridControlControlCRM_LeadsDocumentation_DragOver(sender As Object, e As DragEventArgs)
'e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If TryCast(_ListView.CollectionSource.Collection, ProxyCollection).Count > 0 Then
If _ToDragGridViewCRM_LeadsDocumentation.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCRM_LeadsDocumentation.ExpandGroupRow(_GridHitInfo.RowHandle)
_ActSelection = Nothing
If Not _ToDragGridViewCRM_LeadsDocumentation.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.None
_ToDragGridViewCRM_LeadsDocumentation.Tag = "NODROPCRM"
ElseIf _ToDragGridViewCRM_LeadsDocumentation.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.Copy
_ToDragGridViewCRM_LeadsDocumentation.ClearSelection()
_ToDragGridViewCRM_LeadsDocumentation.SelectRow(_GridHitInfo.RowHandle)
_ActSelection = _ToDragGridViewCRM_LeadsDocumentation.GetRow(_ToDragGridViewCRM_LeadsDocumentation.GetSelectedRows(0))
_ToDragGridViewCRM_LeadsDocumentation.Tag = ""
End If
Else
e.Effect = DragDropEffects.Copy
End If
End Sub
Private Sub ToDragGridControlCRM_LeadsDocumentation_DragDrop(sender As Object, e As DragEventArgs)
Try
If _ToDragGridViewCRM_LeadsDocumentation.Tag = "NODROPCRM" Then
_ToDragGridViewCRM_LeadsDocumentation.Tag = ""
Return
End If
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
Dim _CRM_LeadsDocumentation As CRM_LeadsDocumentation = Nothing
Dim _CRM_Opportunities As CRM_Opportunities = Nothing
Dim _NoListViewElem As Boolean = False
If _ActSelection IsNot Nothing Then
_CRM_LeadsDocumentation = TryCast(_ActSelection, CRM_LeadsDocumentation)
ElseIf TryCast(_ListView.CollectionSource.Collection, ProxyCollection).Count > 0 Then
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
_CRM_LeadsDocumentation = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), CRM_LeadsDocumentation)
Else
_NoListViewElem = True
End If
If _CRM_LeadsDocumentation Is Nothing And _NoListViewElem = False Then Return
If _CRM_LeadsDocumentation Is Nothing Then
_CRM_Opportunities = TryCast(TryCast(_ListView.CollectionSource, PropertyCollectionSource).MasterObject, CRM_Opportunities)
End If
If _CRM_LeadsDocumentation Is Nothing And _CRM_Opportunities Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _OutlookEMailAttachments_Collection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _OutlookEMailAttachments_Collection IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, _OutlookEMailAttachments_Collection.Count)
If TryCast(_OutlookEMailAttachments_Collection(0), OutlookEMailAttachments) IsNot Nothing Then
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _OutlookEMailAttachments_Collection
Dim _CRM_LeadsDocumentation_New As New CRM_LeadsDocumentation(_ocur.Session)
With _CRM_LeadsDocumentation_New
If _CRM_LeadsDocumentation IsNot Nothing Then
.RowGroup1 = _CRM_LeadsDocumentation.RowGroup1
.RowGroup2 = _CRM_LeadsDocumentation.RowGroup2
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_LeadsDocumentation.CRM_Leads.Oid)
Else
.RowGroup1 = ""
.RowGroup2 = ""
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_Opportunities.CRM_Leads.Oid)
End If
.Status = eProductsDocumentationStatus.ePublic
.File = _ocur.GetObjectByKey(Of FileData)(_OutlookEMailAttachments.DocumentFileData.File.Oid)
.File.FileName = _OutlookEMailAttachments.DocumentFileData.File.FileName
End With
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
ElseIf TryCast(_OutlookEMailAttachments_Collection(0), OutlookEMailIn) IsNot Nothing Then
Dim _OutlookApp As New Outlook.Application()
Dim _OutlookNameSpace As Outlook.NameSpace
_OutlookNameSpace = _OutlookApp.GetNamespace("MAPI")
_OutlookNameSpace.Logon(, , False, True)
For Each _OutlookEMailIn As OutlookEMailIn In _OutlookEMailAttachments_Collection
Dim _CRM_LeadsDocumentation_New As New CRM_LeadsDocumentation(_ocur.Session)
With _CRM_LeadsDocumentation_New
If _CRM_LeadsDocumentation IsNot Nothing Then
.RowGroup1 = _CRM_LeadsDocumentation.RowGroup1
.RowGroup2 = _CRM_LeadsDocumentation.RowGroup2
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_LeadsDocumentation.CRM_Leads.Oid)
Else
.RowGroup1 = ""
.RowGroup2 = ""
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_Opportunities.CRM_Leads.Oid)
End If
Dim _Mail As Outlook.MailItem = TryCast(_OutlookNameSpace.GetItemFromID(_OutlookEMailIn.EntryID), Outlook.MailItem)
_Mail.SaveAs(Path.GetTempPath() + "EmailMessage.msg")
Dim _fs As FileStream
_fs = New FileStream(Path.GetTempPath() + "EmailMessage.msg", FileMode.Open)
.File = New FileData(_ocur.Session)
.File.LoadFromStream("EmailMessage.msg", _fs)
.File.FileName = "E-mail üzenet"
_fs.Close()
If System.IO.File.Exists(Path.GetTempPath() + "EmailMessage.msg") Then
System.IO.File.Delete(Path.GetTempPath() + "EmailMessage.msg")
End If
End With
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
End If
ElseIf e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CRM_LeadsDocumentation_New As New CRM_LeadsDocumentation(_ocur.Session)
With _CRM_LeadsDocumentation_New
If _CRM_LeadsDocumentation IsNot Nothing Then
.RowGroup1 = _CRM_LeadsDocumentation.RowGroup1
.RowGroup2 = _CRM_LeadsDocumentation.RowGroup2
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_LeadsDocumentation.CRM_Leads.Oid)
Else
.RowGroup1 = ""
.RowGroup2 = ""
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_Opportunities.CRM_Leads.Oid)
End If
.Status = eProductsDocumentationStatus.ePublic
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
End With
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
End If
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then 'Email
Dim _OL As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
_WaitFormClass.InitWork(0, 1, _OL.ActiveExplorer.Selection.Count)
If _OL.ActiveExplorer.Selection.Count > 0 Then
For ik As Long = 1 To _OL.ActiveExplorer.Selection.Count
Dim _FileIn As Object = _OL.ActiveExplorer.Selection(ik)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
If _MailItem IsNot Nothing Then
Dim _FileName As String = ""
Dim _Subject As String = ""
If _MailItem.Subject IsNot Nothing Then
_Subject = _MailItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
Else
_Subject = "Nincs tárgy"
End If
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
_FileName = _FileName.Replace("\\", "\")
_MailItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _CRM_LeadsDocumentation_New As New CRM_LeadsDocumentation(_ocur.Session)
With _CRM_LeadsDocumentation_New
If _CRM_LeadsDocumentation IsNot Nothing Then
.RowGroup1 = _CRM_LeadsDocumentation.RowGroup1
.RowGroup2 = _CRM_LeadsDocumentation.RowGroup2
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_LeadsDocumentation.CRM_Leads.Oid)
Else
.RowGroup1 = ""
.RowGroup2 = ""
.CRM_Leads = _ocur.GetObjectByKey(Of CRM_Leads)(_CRM_Opportunities.CRM_Leads.Oid)
End If
.Status = eProductsDocumentationStatus.ePublic
.FileCreated = GetFileCreatedDate(_FileName)
.FileModified = GetFileModifiedDate(_FileName)
.File = LoadOtherFile(_FileName, New FileData(_ocur.Session))
End With
System.IO.File.Delete(_FileName)
End If
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
SwitchOutlookPanes(_OL)
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork
End Try
End Sub
Private Sub ToDragGridView_MouseMove(sender As Object, e As MouseEventArgs)
If _AllowSelect_CRM_Opportunities Then
Dim view As XafGridView = TryCast(sender, XafGridView)
view.ClearSelection()
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
view.SelectRow(hitInfo.RowHandle)
End If
End Sub
Private Sub aDragDrop_CRM_Change_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aDragDrop_CRM_Change.CustomizePopupWindowParams
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = _onew.CreateObject(Of ChangeFileAttachment_PopUp)()
e.View = Application.CreateDetailView(_onew, "ChangeFileAttachment_PopUp_DetailView", True, _ChangeFileAttachment_PopUp)
e.View.Tag = "aCRM_LeadsDocumentation_ChangeGroup"
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub aDragDrop_CRM_Change_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aDragDrop_CRM_Change.Execute
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), ChangeFileAttachment_PopUp)
Dim _CRM_Opportunities As CRM_Opportunities = _onew.GetObject(TryCast(View.SelectedObjects(0), CRM_Opportunities))
_WaitFormClass.InitWork(1, 1, _Selection.Count)
For Each _CRM_LeadsDocumentation_Select As CRM_LeadsDocumentation In _Selection
Dim _CRM_LeadsDocumentation As CRM_LeadsDocumentation = _onew.GetObject(_CRM_LeadsDocumentation_Select)
If _ChangeFileAttachment_PopUp.ChangeRowGroup1 Then
_CRM_LeadsDocumentation.RowGroup1 = _ChangeFileAttachment_PopUp.RowGroup1
End If
If _ChangeFileAttachment_PopUp.ChangeRowGroup2 Then
_CRM_LeadsDocumentation.RowGroup2 = _ChangeFileAttachment_PopUp.RowGroup2
End If
If _ChangeFileAttachment_PopUp.ChangeStatus Then
_CRM_LeadsDocumentation.Status = _ChangeFileAttachment_PopUp.Status
End If
_WaitFormClass.DoWork
Next
_onew.CommitChanges()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork
_Selection.Clear()
End Try
End Sub
'------Subs as Functions-------------
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
Public Sub SwitchOutlookPanes(_OL As Microsoft.Office.Interop.Outlook.Application)
Dim _Explorer As Microsoft.Office.Interop.Outlook.Explorer = _OL.ActiveExplorer
Try
If _OL IsNot Nothing And _Explorer IsNot Nothing Then
Dim nMAPIFOlder As Interop.Outlook.MAPIFolder = _Explorer.CurrentFolder
Dim _NameSpace As Microsoft.Office.Interop.Outlook.NameSpace = _OL.GetNamespace("MAPI")
If _NameSpace.Folders(1) IsNot Nothing Then
If _NameSpace.Folders(1).Folders.Count > 0 Then
If _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count) IsNot Nothing Then
If _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count).Name <> nMAPIFOlder.Name Then
_Explorer.CurrentFolder = _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count)
Else
_Explorer.CurrentFolder = _NameSpace.Folders(1).Folders(1)
End If
End If
End If
End If
System.Threading.Thread.Sleep(1000)
_Explorer.CurrentFolder = nMAPIFOlder
System.Threading.Thread.Sleep(1000)
End If
Catch ex As System.Exception
Finally
Marshal.ReleaseComObject(_Explorer)
Marshal.ReleaseComObject(_OL)
End Try
End Sub
End Class
@@ -0,0 +1,51 @@
Partial Class DragAndDropCRMOutlookCustomers_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.aDragDrop_CRM_Customer_Change = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aDragDrop_CRM_Customer_Change
'
Me.aDragDrop_CRM_Customer_Change.AcceptButtonCaption = Nothing
Me.aDragDrop_CRM_Customer_Change.CancelButtonCaption = Nothing
Me.aDragDrop_CRM_Customer_Change.Caption = "aDragDrop_CRM_Customer_Change"
Me.aDragDrop_CRM_Customer_Change.Category = "aDragDrop_CRM_Customer_Change"
Me.aDragDrop_CRM_Customer_Change.ConfirmationMessage = Nothing
Me.aDragDrop_CRM_Customer_Change.Id = "aDragDrop_CRM_Customer_Change"
Me.aDragDrop_CRM_Customer_Change.ImageName = Nothing
Me.aDragDrop_CRM_Customer_Change.Shortcut = Nothing
Me.aDragDrop_CRM_Customer_Change.Tag = Nothing
Me.aDragDrop_CRM_Customer_Change.TargetObjectsCriteria = Nothing
Me.aDragDrop_CRM_Customer_Change.TargetViewId = Nothing
Me.aDragDrop_CRM_Customer_Change.ToolTip = Nothing
Me.aDragDrop_CRM_Customer_Change.TypeOfView = Nothing
End Sub
Friend WithEvents aDragDrop_CRM_Customer_Change As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,126 @@
<?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="aDragDrop_CRM_Customer_Change.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,504 @@
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.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Win
Imports Microsoft.Office
Imports System.Runtime.InteropServices
Imports DevExpress.ExpressApp.Utils
Public Class DragAndDropCRMOutlookCustomers_VC
Inherits DevExpress.ExpressApp.ViewController
Private _CanEmailDrop As Boolean = True
Private _Selection As New ArrayList
Dim _ActSelection As Object
Private _DoDragGridControl As DevExpress.XtraGrid.GridControl
Private _DoDragGridView As DevExpress.XtraGrid.Views.Grid.GridView
Private _DoDragGridControlOutlookEMailAttachments As DevExpress.XtraGrid.GridControl
Private _DoDragGridViewOutlookEMailAttachments As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControl As DevExpress.XtraGrid.GridControl
Private _ToDragGridView As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlCustomers As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewCustomers As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridViewCustomersFileAttachment As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlCustomersFileAttachment As DevExpress.XtraGrid.GridControl
Private downHitInfo As GridHitInfo = Nothing
Dim _WaitFormClass As New WaitFormClass
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
If View.Id = "OutlookEMailIn_OutlookEMailAttachments_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).Active.SetItemValue("", False)
Frame.GetController(Of Nuvolar.Module.Win.OutlookEmailVC).aAttachFile.Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_DoDragGridViewOutlookEMailAttachments = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_DoDragGridViewOutlookEMailAttachments.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseUp
_DoDragGridControlOutlookEMailAttachments = _DoDragGridViewOutlookEMailAttachments.GridControl
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseDown, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseMove, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove
AddHandler View.SelectionChanged, AddressOf OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged
End If
If View.Id = "Customers_ListView_CRM_Outlook" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCustomers = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCustomers = _ToDragGridViewCustomers.GridControl
AddHandler _ToDragGridControlCustomers.DragOver, AddressOf ToDragGridControlCustomers_DragOver
AddHandler _ToDragGridControlCustomers.DragDrop, AddressOf ToDragGridControlCustomers_DragDrop
End If
If View.Id = "Customers_CustomersFileAttachment_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController).Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCustomersFileAttachment = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCustomersFileAttachment = _ToDragGridViewCustomersFileAttachment.GridControl
AddHandler _ToDragGridControlCustomersFileAttachment.DragOver, AddressOf ToDragGridControlCustomersFileAttachment_DragOver
AddHandler _ToDragGridControlCustomersFileAttachment.DragDrop, AddressOf ToDragGridControlCustomersFileAttachment_DragDrop
End If
End Sub
'Protected Overrides Sub OnDeactivated()
' MyBase.OnDeactivated()
' 'If View.Id = "Customers_CustomersFileAttachment_ListView" Then
' ' Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
' ' _ToDragGridViewCustomersFileAttachment = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
' ' _ToDragGridControlCustomersFileAttachment = _ToDragGridViewCustomersFileAttachment.GridControl
' ' RemoveHandler _ToDragGridControlCustomersFileAttachment.DragOver, AddressOf ToDragGridControlCustomersFileAttachment_DragOver
' ' RemoveHandler _ToDragGridControlCustomersFileAttachment.DragDrop, AddressOf ToDragGridControlCustomersFileAttachment_DragDrop
' 'End If
'End Sub
'------Subs as Functions-------------
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 Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
downHitInfo = Nothing
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If Control.ModifierKeys <> Keys.None Then
Return
End If
If e.Button = MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
downHitInfo = hitInfo
End If
End Sub
Private Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
If e.Button = MouseButtons.Left AndAlso downHitInfo IsNot Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
Dim dragRect As New Rectangle(New Point(downHitInfo.HitPoint.X - dragSize.Width / 2, downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
If (Not dragRect.Contains(New Point(e.X, e.Y))) Then
view.GridControl.DoDragDrop(_Selection, DragDropEffects.All)
downHitInfo = Nothing
End If
End If
End Sub
Private Sub OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged(sender As Object, e As EventArgs)
_Selection.Clear()
_Selection.AddRange(View.SelectedObjects)
End Sub
Private Sub ToDragGridControlCustomers_DragOver(sender As Object, e As DragEventArgs)
e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewCustomers.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomers.CollapseAllGroups()
If _ToDragGridViewCustomers.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomers.ExpandGroupRow(_GridHitInfo.RowHandle)
If _ToDragGridViewCustomers.IsDataRow(_GridHitInfo.RowHandle) Then
_ToDragGridViewCustomers.ClearSelection()
_ToDragGridViewCustomers.SelectRow(_GridHitInfo.RowHandle)
End If
End Sub
Private Sub ToDragGridControlCustomers_DragDrop(sender As Object, e As DragEventArgs)
Try
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
Dim _Customers As Customers = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), Customers)
If _Customers Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
If TryCast(_AttachmentSelection(0), OutlookEMailAttachments) Is Nothing Then Throw New InvalidCastException
_WaitFormClass.InitWork(0, 1, _AttachmentSelection.Count)
_Selection.Clear()
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _CustomersFileAttachment As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachment)
.Customers = _ocur.GetObject(_Customers)
.File = _ocur.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.File.FileName = _OutlookEMailAttachments.DocumentFileData.File.FileName
End With
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
_Selection.Add(_CustomersFileAttachment)
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookCustomers_VC).aDragDrop_CRM_Customer_Change), PopupWindowShowActionHelper).ShowPopupWindow()
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
_Selection.Clear()
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.Customers = _ocur.GetObject(_Customers)
.Status = eProductsDocumentationStatus.ePublic
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
_Selection.Add(_CustomersFileAttachmentNew)
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookCustomers_VC).aDragDrop_CRM_Customer_Change), PopupWindowShowActionHelper).ShowPopupWindow()
Else
If _CanEmailDrop Then
_CanEmailDrop = False
Dim _OL As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
_WaitFormClass.InitWork(0, 1, _OL.ActiveExplorer.Selection.Count)
If _OL.ActiveExplorer.Selection.Count > 0 Then
For ik As Long = 1 To _OL.ActiveExplorer.Selection.Count
_FileIn = _OL.ActiveExplorer.Selection(ik)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
If _MailItem IsNot Nothing Then
Dim _FileName As String = ""
Dim _Subject As String = _MailItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
_FileName = _FileName.Replace("\\", "\")
_MailItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.Customers = _ocur.GetObject(_Customers)
.Status = eProductsDocumentationStatus.ePublic
.File = LoadOtherFile(_FileName, New FileData(_ocur.Session))
.ShortName = _MailItem.Sender.Name
.FileCreated = _MailItem.CreationTime
.FileModified = GetFileModifiedDate(_FileName)
.Description = _MailItem.Subject
End With
_Selection.Add(_CustomersFileAttachmentNew)
System.IO.File.Delete(_FileName)
End If
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
SwitchOutlookPanes(_OL)
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookCustomers_VC).aDragDrop_CRM_Customer_Change), PopupWindowShowActionHelper).ShowPopupWindow()
End If
End If
_CanEmailDrop = True
End If
End If
Catch ex As InvalidCastException
MsgBox("Ügyfélhez nem lehet e-mailt rendeleni!", MsgBoxStyle.OkOnly, "Hiba!")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub ToDragGridControlCustomersFileAttachment_DragOver(sender As Object, e As DragEventArgs)
'e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersFileAttachment.CollapseAllGroups()
If _ToDragGridViewCustomersFileAttachment.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersFileAttachment.ExpandGroupRow(_GridHitInfo.RowHandle)
_ActSelection = Nothing
If Not _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.None
_ToDragGridViewCustomersFileAttachment.Tag = "NODROP"
ElseIf _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.Copy
_ToDragGridViewCustomersFileAttachment.ClearSelection()
_ToDragGridViewCustomersFileAttachment.SelectRow(_GridHitInfo.RowHandle)
_ActSelection = _ToDragGridViewCustomersFileAttachment.GetRow(_ToDragGridViewCustomersFileAttachment.GetSelectedRows(0))
_ToDragGridViewCustomersFileAttachment.Tag = ""
End If
End Sub
Private Sub ToDragGridControlCustomersFileAttachment_DragDrop(sender As Object, e As DragEventArgs)
'Try
If _ToDragGridViewCustomersFileAttachment.Tag = "NODROP" Then
_ToDragGridViewCustomersFileAttachment.Tag = ""
Return
End If
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
Dim _Customer_CustomersFileAttachment As CustomersFileAttachment = Nothing
If _ActSelection IsNot Nothing Then
_Customer_CustomersFileAttachment = TryCast(_ActSelection, CustomersFileAttachment)
Else
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
_Customer_CustomersFileAttachment = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), CustomersFileAttachment)
End If
If _Customer_CustomersFileAttachment Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, _AttachmentSelection.Count)
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _CustomersFileAttachment As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachment)
.RowGroup1 = _Customer_CustomersFileAttachment.RowGroup1
.RowGroup2 = _Customer_CustomersFileAttachment.RowGroup2
.Status = eProductsDocumentationStatus.ePublic
.Customers = _ocur.GetObject(_Customer_CustomersFileAttachment.Customers)
.File = _ocur.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.File.FileName = _OutlookEMailAttachments.DocumentFileData.File.FileName
End With
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.RowGroup1 = _Customer_CustomersFileAttachment.RowGroup1
.RowGroup2 = _Customer_CustomersFileAttachment.RowGroup2
.Status = eProductsDocumentationStatus.ePublic
.Customers = _ocur.GetObject(_Customer_CustomersFileAttachment.Customers)
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
Else
If _CanEmailDrop Then
_CanEmailDrop = False
Dim _OL As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
If _OL.ActiveExplorer.Selection.Count > 0 Then
_WaitFormClass.InitWork(0, 1, _OL.ActiveExplorer.Selection.Count)
For ik = 1 To _OL.ActiveExplorer.Selection.Count
_FileIn = _OL.ActiveExplorer.Selection(ik)
Dim _MailItem As Microsoft.Office.Interop.Outlook.MailItem = TryCast(_FileIn, Microsoft.Office.Interop.Outlook.MailItem)
If _MailItem IsNot Nothing Then
Dim _FileName As String = ""
Dim _Subject As String = ""
If _MailItem.Subject IsNot Nothing Then
_Subject = _MailItem.Subject.Replace(":", "")
_Subject = _Subject.Replace("/", "-")
Else
_Subject = "Nincs tárgy"
End If
If _Subject.Length > 16 Then
_FileName = System.IO.Path.GetTempPath + _Subject.Remove(16, _Subject.Length - 16) + ".msg"
Else
_FileName = System.IO.Path.GetTempPath + _Subject + ".msg"
End If
_MailItem.SaveAs(_FileName, Microsoft.Office.Interop.Outlook.OlSaveAsType.olMSG)
If System.IO.File.Exists(_FileName) Then
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.RowGroup1 = _Customer_CustomersFileAttachment.RowGroup1
.RowGroup2 = _Customer_CustomersFileAttachment.RowGroup2
.Customers = _ocur.GetObject(_Customer_CustomersFileAttachment.Customers)
.Status = eProductsDocumentationStatus.ePublic
.File = LoadOtherFile(_FileName, New FileData(_ocur.Session))
.ShortName = _MailItem.Sender.Name
.FileCreated = _MailItem.ReceivedTime 'Küldés dátuma kell?
.FileModified = GetFileModifiedDate(_FileName)
.Description = _MailItem.Subject
End With
_Selection.Add(_CustomersFileAttachmentNew)
System.IO.File.Delete(_FileName)
End If
End If
_WaitFormClass.DoWork
Next
_ocur.CommitChanges()
_Waitformclass.FinalWork
SwitchOutlookPanes(_OL)
End If
End If
_CanEmailDrop = True
End If
End If
'Catch ex As Exception
'MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
'End Try
End Sub
Private Sub aDragDrop_CRM_Customer_Change_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aDragDrop_CRM_Customer_Change.CustomizePopupWindowParams
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = _onew.CreateObject(Of ChangeFileAttachment_PopUp)()
e.View = Application.CreateDetailView(_onew, "ChangeFileAttachment_PopUp_DetailView", True, _ChangeFileAttachment_PopUp)
e.View.Tag = "aCustomersFileAttachment_ChangeGroup"
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub aDragDrop_CRM_Customer_Change_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aDragDrop_CRM_Customer_Change.Execute
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), ChangeFileAttachment_PopUp)
Dim _Customers As Customers = _onew.GetObject(TryCast(View.SelectedObjects(0), Customers))
_WaitFormClass.InitWork(1, 1, _Selection.Count)
For Each _CustomersFileAttachment_Select As CustomersFileAttachment In _Selection
Dim _CustomersFileAttachment As CustomersFileAttachment = _onew.GetObject(_CustomersFileAttachment_Select)
If _ChangeFileAttachment_PopUp.ChangeRowGroup1 Then
_CustomersFileAttachment.RowGroup1 = _ChangeFileAttachment_PopUp.RowGroup1
End If
If _ChangeFileAttachment_PopUp.ChangeRowGroup2 Then
_CustomersFileAttachment.RowGroup2 = _ChangeFileAttachment_PopUp.RowGroup2
End If
If _ChangeFileAttachment_PopUp.ChangeStatus Then
_CustomersFileAttachment.Status = _ChangeFileAttachment_PopUp.Status
End If
_WaitFormClass.DoWork
Next
_onew.CommitChanges()
View.Refresh()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork
_Selection.Clear()
End Try
End Sub
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
Public Sub SwitchOutlookPanes(_OL As Microsoft.Office.Interop.Outlook.Application)
Dim _Explorer As Microsoft.Office.Interop.Outlook.Explorer = _OL.ActiveExplorer
Try
If _OL IsNot Nothing And _Explorer IsNot Nothing Then
Dim nMAPIFOlder As Interop.Outlook.MAPIFolder = _Explorer.CurrentFolder
Dim _NameSpace As Microsoft.Office.Interop.Outlook.NameSpace = _OL.GetNamespace("MAPI")
If _NameSpace.Folders(1) IsNot Nothing Then
If _NameSpace.Folders(1).Folders.Count > 0 Then
If _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count) IsNot Nothing Then
If _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count).Name <> nMAPIFOlder.Name Then
_Explorer.CurrentFolder = _NameSpace.Folders(1).Folders(_NameSpace.Folders(1).Folders.Count)
Else
_Explorer.CurrentFolder = _NameSpace.Folders(1).Folders(1)
End If
End If
End If
End If
System.Threading.Thread.Sleep(1000)
_Explorer.CurrentFolder = nMAPIFOlder
System.Threading.Thread.Sleep(1000)
End If
Catch ex As System.Exception
Finally
Marshal.ReleaseComObject(_Explorer)
Marshal.ReleaseComObject(_OL)
End Try
End Sub
End Class
@@ -0,0 +1,69 @@
Partial Class DragAndDropCRMOutlookProducts_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.aDragDrop_Products_Change = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aDragDrop_CustomersDoc_Change = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aDragDrop_Products_Change
'
Me.aDragDrop_Products_Change.AcceptButtonCaption = Nothing
Me.aDragDrop_Products_Change.CancelButtonCaption = Nothing
Me.aDragDrop_Products_Change.Caption = "aDragDrop_Products_Change"
Me.aDragDrop_Products_Change.Category = "aDragDrop_Products_Change"
Me.aDragDrop_Products_Change.ConfirmationMessage = Nothing
Me.aDragDrop_Products_Change.Id = "aDragDrop_Products_Change"
Me.aDragDrop_Products_Change.ImageName = Nothing
Me.aDragDrop_Products_Change.Shortcut = Nothing
Me.aDragDrop_Products_Change.Tag = Nothing
Me.aDragDrop_Products_Change.TargetObjectsCriteria = Nothing
Me.aDragDrop_Products_Change.TargetViewId = Nothing
Me.aDragDrop_Products_Change.ToolTip = Nothing
Me.aDragDrop_Products_Change.TypeOfView = Nothing
'
'aDragDrop_CustomersDoc_Change
'
Me.aDragDrop_CustomersDoc_Change.AcceptButtonCaption = Nothing
Me.aDragDrop_CustomersDoc_Change.CancelButtonCaption = Nothing
Me.aDragDrop_CustomersDoc_Change.Caption = "aDragDrop_CustomersDoc_Change"
Me.aDragDrop_CustomersDoc_Change.Category = "aDragDrop_CustomersDoc_Change"
Me.aDragDrop_CustomersDoc_Change.ConfirmationMessage = Nothing
Me.aDragDrop_CustomersDoc_Change.Id = "aDragDrop_CustomersDoc_Change"
Me.aDragDrop_CustomersDoc_Change.ImageName = Nothing
Me.aDragDrop_CustomersDoc_Change.Shortcut = Nothing
Me.aDragDrop_CustomersDoc_Change.Tag = Nothing
Me.aDragDrop_CustomersDoc_Change.TargetObjectsCriteria = Nothing
Me.aDragDrop_CustomersDoc_Change.TargetViewId = Nothing
Me.aDragDrop_CustomersDoc_Change.ToolTip = Nothing
Me.aDragDrop_CustomersDoc_Change.TypeOfView = Nothing
End Sub
Friend WithEvents aDragDrop_Products_Change As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Friend WithEvents aDragDrop_CustomersDoc_Change As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -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="aDragDrop_Products_Change.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="aDragDrop_CustomersDoc_Change.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,633 @@
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.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Win
Imports System.IO
Imports DevExpress.ExpressApp.Utils
Public Class DragAndDropCRMOutlookProducts_VC
Inherits DevExpress.ExpressApp.ViewController
Private _Selection As New ArrayList
Dim _ActSelection As Object
Private downHitInfo As GridHitInfo = Nothing
Dim _WaitFormClass As New WaitFormClass
Private _CRM_Opportunities As CRM_Opportunities = Nothing
Private _AllowSelect_CRM_Opportunities As Boolean = False
Private _DoDragGridViewOutlookEMailAttachments As DevExpress.XtraGrid.Views.Grid.GridView
Private _DoDragGridControlOutlookEMailAttachments As DevExpress.XtraGrid.GridControl
Private _ToDragGridControlProducts As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewProducts As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlProductsDocumentations As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewProductsDocumentations As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlCustomersOrderPriority As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewCustomersOrderPriority As DevExpress.XtraGrid.Views.Grid.GridView
Private _ToDragGridControlCustomersFileAttachment As DevExpress.XtraGrid.GridControl
Private _ToDragGridViewCustomersFileAttachment As DevExpress.XtraGrid.Views.Grid.GridView
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
If View.Id = "OutlookEMailIn_OutlookEMailAttachments_ListView" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_DoDragGridViewOutlookEMailAttachments = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_DoDragGridViewOutlookEMailAttachments.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseUp
_DoDragGridControlOutlookEMailAttachments = _DoDragGridViewOutlookEMailAttachments.GridControl
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseDown, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown
AddHandler _DoDragGridViewOutlookEMailAttachments.MouseMove, AddressOf DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove
AddHandler View.SelectionChanged, AddressOf OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged
End If
If View.Id = "Products_ListView_CRM_Outlook" Then
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewProducts = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlProducts = _ToDragGridViewProducts.GridControl
AddHandler _ToDragGridControlProducts.DragOver, AddressOf ToDragGridControlProducts_DragOver
AddHandler _ToDragGridControlProducts.DragDrop, AddressOf ToDragGridControlProducts_DragDrop
End If
If View.Id = "Products_ProductsDocumentations_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewProductsDocumentations = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlProductsDocumentations = _ToDragGridViewProductsDocumentations.GridControl
AddHandler _ToDragGridControlProductsDocumentations.DragOver, AddressOf ToDragGridControlProductsDocumentations_DragOver
AddHandler _ToDragGridControlProductsDocumentations.DragDrop, AddressOf ToDragGridControlProductsDocumentations_DragDrop
End If
If View.Id = "Products_CustomersOrderPriority_ListView_CRM_Outlook" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController).Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCustomersOrderPriority = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCustomersOrderPriority = _ToDragGridViewCustomersOrderPriority.GridControl
AddHandler _ToDragGridControlCustomersOrderPriority.DragOver, AddressOf ToDragGridControlCustomersOrderPriority_DragOver
AddHandler _ToDragGridControlCustomersOrderPriority.DragDrop, AddressOf ToDragGridControlCustomersOrderPrioritys_DragDrop
End If
If View.Id = "CustomersFileAttachment_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.NewObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController).Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).Active.SetItemValue("", False)
Dim _View As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
_ToDragGridViewCustomersFileAttachment = TryCast(_View.Editor, DevExpress.ExpressApp.Win.Editors.GridListEditor).GridView
_ToDragGridControlCustomersFileAttachment = _ToDragGridViewCustomersFileAttachment.GridControl
AddHandler _ToDragGridControlCustomersFileAttachment.DragOver, AddressOf ToDragGridControlCustomersFileAttachment_DragOver
AddHandler _ToDragGridControlCustomersFileAttachment.DragDrop, AddressOf ToDragGridControlCustomersFileAttachment_DragDrop
End If
End Sub
Private Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseDown(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
downHitInfo = Nothing
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
If Control.ModifierKeys <> Keys.None Then
Return
End If
If e.Button = MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
downHitInfo = hitInfo
End If
End Sub
Private Sub DoDragGridViewOutlookEMailAttachments_MouseDown_MouseMove(sender As Object, e As MouseEventArgs)
Dim view As GridView = TryCast(sender, GridView)
If e.Button = MouseButtons.Left AndAlso downHitInfo IsNot Nothing Then
Dim dragSize As Size = SystemInformation.DragSize
Dim dragRect As New Rectangle(New Point(downHitInfo.HitPoint.X - dragSize.Width / 2, downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
If (Not dragRect.Contains(New Point(e.X, e.Y))) Then
_AllowSelect_CRM_Opportunities = True
view.GridControl.DoDragDrop(_Selection, DragDropEffects.All)
downHitInfo = Nothing
End If
End If
End Sub
Private Sub OutlookEMailIn_OutlookEMailAttachments_ListView_SelectionChanged(sender As Object, e As EventArgs)
_Selection.Clear()
_Selection.AddRange(View.SelectedObjects)
End Sub
Private Sub ToDragGridControlProducts_DragOver(sender As Object, e As DragEventArgs)
e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewProducts.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewProducts.CollapseAllGroups()
If _ToDragGridViewProducts.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewProducts.ExpandGroupRow(_GridHitInfo.RowHandle)
If _ToDragGridViewProducts.IsDataRow(_GridHitInfo.RowHandle) Then
_ToDragGridViewProducts.ClearSelection()
_ToDragGridViewProducts.SelectRow(_GridHitInfo.RowHandle)
End If
End Sub
Private Sub ToDragGridControlProducts_DragDrop(sender As Object, e As DragEventArgs)
Try
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
Dim _Products As Products = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), Products)
If _Products Is Nothing Then Return
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
'_WaitFormClass.InitWork(0, 1, _AttachmentSelection.Count)
_Selection.Clear()
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _ProductsDocumentations As New ProductsDocumentations(_onew.Session)
With (_ProductsDocumentations)
.Products = _onew.GetObject(_Products)
.Status = eProductsDocumentationStatus.ePublic
.File = _onew.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.ShortName = .File.FileName
End With
_Selection.Add(_ProductsDocumentations)
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
'_WaitFormClass.DoWork
Next
_onew.CommitChanges()
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookProducts_VC).aDragDrop_Products_Change), PopupWindowShowActionHelper).ShowPopupWindow()
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
' _WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
_Selection.Clear()
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _ProductsDocumentations As New ProductsDocumentations(_onew.Session)
With (_ProductsDocumentations)
.Products = _onew.GetObject(_Products)
.Status = eProductsDocumentationStatus.ePublic
.File = LoadOtherFile(_ActFile, New FileData(_onew.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
_Selection.Add(_ProductsDocumentations)
End If
' _WaitFormClass.DoWork
Next
_onew.CommitChanges()
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookProducts_VC).aDragDrop_Products_Change), PopupWindowShowActionHelper).ShowPopupWindow()
End If
End If
Catch ex As InvalidCastException
MsgBox("Termékhez nem lehet e-mailt rendeleni!", MsgBoxStyle.OkOnly, "Hiba!")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
' _Waitformclass.FinalWork
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.RefreshController).RefreshAction.DoExecute()
End Try
End Sub
Private Sub ToDragGridControlProductsDocumentations_DragOver(sender As Object, e As DragEventArgs)
' e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If _ToDragGridViewProductsDocumentations.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewProductsDocumentations.ExpandGroupRow(_GridHitInfo.RowHandle)
_ActSelection = Nothing
If Not _ToDragGridViewProductsDocumentations.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.None
_ToDragGridViewProductsDocumentations.Tag = "NODROPDOC"
ElseIf _ToDragGridViewProductsDocumentations.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.Copy
_ToDragGridViewProductsDocumentations.ClearSelection()
_ToDragGridViewProductsDocumentations.SelectRow(_GridHitInfo.RowHandle)
_ActSelection = _ToDragGridViewProductsDocumentations.GetRow(_ToDragGridViewProductsDocumentations.GetSelectedRows(0))
_ToDragGridViewProductsDocumentations.Tag = ""
End If
End Sub
Private Sub ToDragGridControlProductsDocumentations_DragDrop(sender As Object, e As DragEventArgs)
Try
If _ToDragGridViewProductsDocumentations.Tag = "NODROPDOC" Then
_ToDragGridViewProductsDocumentations.Tag = ""
Return
End If
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
Dim _ProductsDocumentations As ProductsDocumentations = Nothing
If _ActSelection IsNot Nothing Then
_ProductsDocumentations = TryCast(_ActSelection, ProductsDocumentations)
Else
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
_ProductsDocumentations = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), ProductsDocumentations)
End If
If _ProductsDocumentations Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
_WaitFormClass.Initwork(1, 1, _AttachmentSelection.Count)
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _ProductsDocumentationsNew As New ProductsDocumentations(_ocur.Session)
With (_ProductsDocumentationsNew)
.RowGroup1 = _ProductsDocumentations.RowGroup1
.RowGroup2 = _ProductsDocumentations.RowGroup2
.Products = _ocur.GetObject(_ProductsDocumentations.Products)
.Status = eProductsDocumentationStatus.ePublic
.File = _ocur.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.ShortName = .File.FileName
End With
_Selection.Add(_ProductsDocumentations)
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
_WaitFormClass.DoWork()
Next
_ocur.CommitChanges()
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _ProductsDocumentationsNew As New ProductsDocumentations(_ocur.Session)
With (_ProductsDocumentationsNew)
.RowGroup1 = _ProductsDocumentations.RowGroup1
.RowGroup2 = _ProductsDocumentations.RowGroup2
.Products = _ocur.GetObject(_ProductsDocumentations.Products)
.Status = eProductsDocumentationStatus.ePublic
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
End If
_WaitFormClass.DoWork()
Next
_ocur.CommitChanges()
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork()
End Try
End Sub
Private Sub ToDragGridControlCustomersOrderPriority_DragOver(sender As Object, e As DragEventArgs)
e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewCustomersOrderPriority.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersOrderPriority.CollapseAllGroups()
If _ToDragGridViewCustomersOrderPriority.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersOrderPriority.ExpandGroupRow(_GridHitInfo.RowHandle)
If _ToDragGridViewCustomersOrderPriority.IsDataRow(_GridHitInfo.RowHandle) Then
_ToDragGridViewCustomersOrderPriority.ClearSelection()
_ToDragGridViewCustomersOrderPriority.SelectRow(_GridHitInfo.RowHandle)
End If
End Sub
Private Sub ToDragGridControlCustomersOrderPrioritys_DragDrop(sender As Object, e As DragEventArgs)
Try
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
Dim _CustomersOrderPriority As CustomersOrderPriority = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), CustomersOrderPriority)
If _CustomersOrderPriority Is Nothing Then Return
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
' _WaitFormClass.InitWork(0, 1, _AttachmentSelection.Count)
_Selection.Clear()
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _CustomersFileAttachment As New CustomersFileAttachment(_onew.Session)
With (_CustomersFileAttachment)
.Customers = _onew.GetObject(TryCast(_CustomersOrderPriority.CustomersOrder, Customers))
.File = _onew.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.File.FileName = _OutlookEMailAttachments.DocumentFileData.File.FileName
.ShortName = .File.FileName
End With
_Selection.Add(_CustomersFileAttachment)
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
' _WaitFormClass.DoWork
Next
_onew.CommitChanges()
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookProducts_VC).aDragDrop_CustomersDoc_Change), PopupWindowShowActionHelper).ShowPopupWindow()
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
' _WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
_Selection.Clear()
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CustomersFileAttachment As New CustomersFileAttachment(_onew.Session)
With (_CustomersFileAttachment)
.Customers = _onew.GetObject(TryCast(_CustomersOrderPriority.CustomersOrder, Customers))
.File = LoadOtherFile(_ActFile, New FileData(_onew.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
_Selection.Add(_CustomersFileAttachment)
End If
' _WaitFormClass.DoWork
Next
_onew.CommitChanges()
CType(New PopupWindowShowActionHelper(Frame.GetController(Of DragAndDropCRMOutlookProducts_VC).aDragDrop_CustomersDoc_Change), PopupWindowShowActionHelper).ShowPopupWindow()
End If
End If
Catch ex As InvalidCastException
MsgBox("Beszállítóhoz nem lehet e-mailt rendeleni!", MsgBoxStyle.OkOnly, "Hiba!")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
' _Waitformclass.FinalWork
End Try
End Sub
Private Sub ToDragGridControlCustomersFileAttachment_DragOver(sender As Object, e As DragEventArgs)
'e.Effect = DragDropEffects.Copy
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
' If Not _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersFileAttachment.CollapseAllGroups()
If _ToDragGridViewCustomersFileAttachment.IsGroupRow(_GridHitInfo.RowHandle) Then _ToDragGridViewCustomersFileAttachment.ExpandGroupRow(_GridHitInfo.RowHandle)
_ActSelection = Nothing
If Not _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.None
_ToDragGridViewCustomersFileAttachment.Tag = "NODROPATTACH"
ElseIf _ToDragGridViewCustomersFileAttachment.IsDataRow(_GridHitInfo.RowHandle) Then
e.Effect = DragDropEffects.Copy
_ToDragGridViewCustomersFileAttachment.ClearSelection()
_ToDragGridViewCustomersFileAttachment.SelectRow(_GridHitInfo.RowHandle)
_ActSelection = _ToDragGridViewCustomersFileAttachment.GetRow(_ToDragGridViewCustomersFileAttachment.GetSelectedRows(0))
_ToDragGridViewCustomersFileAttachment.Tag = ""
End If
End Sub
Private Sub ToDragGridControlCustomersFileAttachment_DragDrop(sender As Object, e As DragEventArgs)
Try
If _ToDragGridViewCustomersFileAttachment.Tag = "NODROPATTACH" Then
_ToDragGridViewCustomersFileAttachment.Tag = ""
Return
End If
Dim _ListView As DevExpress.ExpressApp.ListView = TryCast(View, DevExpress.ExpressApp.ListView)
If _ListView Is Nothing Then Return
Dim _Grid As DevExpress.XtraGrid.GridControl = TryCast(sender, DevExpress.XtraGrid.GridControl)
Dim _GridHitInfo As GridHitInfo = _Grid.MainView.CalcHitInfo(_Grid.PointToClient(New Point(e.X, e.Y)))
Dim _CustomersFileAttachment As CustomersFileAttachment = Nothing
If _ActSelection IsNot Nothing Then
_CustomersFileAttachment = TryCast(_ActSelection, CustomersFileAttachment)
Else
If Not _GridHitInfo.InRow OrElse Not _GridHitInfo.InRowCell Then Return
If Not DirectCast(_Grid.MainView, GridView).IsDataRow(_GridHitInfo.RowHandle) Then Return
_CustomersFileAttachment = TryCast(_Grid.MainView.GetRow(_GridHitInfo.RowHandle), CustomersFileAttachment)
End If
If _CustomersFileAttachment Is Nothing Then Return
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _AttachmentSelection As ArrayList = e.Data.GetData(GetType(ArrayList))
If _AttachmentSelection IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, _AttachmentSelection.Count)
For Each _OutlookEMailAttachments As OutlookEMailAttachments In _AttachmentSelection
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.RowGroup1 = _CustomersFileAttachment.RowGroup1
.RowGroup2 = _CustomersFileAttachment.RowGroup2
.Customers = _ocur.GetObject(_CustomersFileAttachment.Customers)
.File = _ocur.GetObject(_OutlookEMailAttachments.DocumentFileData.File)
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(.File)
.FileModified = GetFileModifiedDate(.File)
End With
_OutlookEMailAttachments.OutlookEMailIn.IsReaded = True
_OutlookEMailAttachments.OutlookEMailIn.Qualified = True
_WaitFormClass.DoWork()
Next
_ocur.CommitChanges()
Else
Dim _FileIn As Object = e.Data.GetData(DataFormats.FileDrop)
If _FileIn IsNot Nothing Then
_WaitFormClass.InitWork(0, 1, TryCast(_FileIn, String()).Length)
For Each _ActFile As String In _FileIn
If System.IO.File.Exists(_ActFile) Then
Dim _CustomersFileAttachmentNew As New CustomersFileAttachment(_ocur.Session)
With (_CustomersFileAttachmentNew)
.RowGroup1 = _CustomersFileAttachment.RowGroup1
.RowGroup2 = _CustomersFileAttachment.RowGroup2
.Customers = _ocur.GetObject(_CustomersFileAttachment.Customers)
.File = LoadOtherFile(_ActFile, New FileData(_ocur.Session))
.ShortName = .File.FileName
.FileCreated = GetFileCreatedDate(_ActFile)
.FileModified = GetFileModifiedDate(_ActFile)
End With
End If
_WaitFormClass.DoWork()
Next
_ocur.CommitChanges()
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork()
End Try
End Sub
Private Sub aDragDrop_Products_Change_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aDragDrop_Products_Change.CustomizePopupWindowParams
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = _onew.CreateObject(Of ChangeFileAttachment_PopUp)()
e.View = Application.CreateDetailView(_onew, "ChangeFileAttachment_PopUp_DetailView", True, _ChangeFileAttachment_PopUp)
e.View.Tag = "aProductsDocumentations_ChangeGroup"
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub aDragDrop_Products_Change_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aDragDrop_Products_Change.Execute
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), ChangeFileAttachment_PopUp)
If TryCast(_Selection(0), ProductsDocumentations) IsNot Nothing Then
_WaitFormClass.InitWork(1, 1, _Selection.Count)
For Each _ProductsDocumentationsAct As ProductsDocumentations In _Selection
Dim _ProductsDocumentations As ProductsDocumentations = _onew.GetObject(_ProductsDocumentationsAct)
If _ChangeFileAttachment_PopUp.ChangeRowGroup1 Then
_ProductsDocumentations.RowGroup1 = _ChangeFileAttachment_PopUp.RowGroup1
End If
If _ChangeFileAttachment_PopUp.ChangeRowGroup2 Then
_ProductsDocumentations.RowGroup2 = _ChangeFileAttachment_PopUp.RowGroup2
End If
If _ChangeFileAttachment_PopUp.ChangeStatus Then
_ProductsDocumentations.Status = _ChangeFileAttachment_PopUp.Status
End If
_WaitFormClass.DoWork()
Next
End If
_onew.CommitChanges()
View.Refresh()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork()
_Selection.Clear()
End Try
End Sub
Private Sub aDragDrop_CustomersDoc_Change_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aDragDrop_CustomersDoc_Change.CustomizePopupWindowParams
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = _onew.CreateObject(Of ChangeFileAttachment_PopUp)()
e.View = Application.CreateDetailView(_onew, "ChangeFileAttachment_PopUp_DetailView", True, _ChangeFileAttachment_PopUp)
e.View.Tag = "aCustomersDocFileAttachment_ChangeGroup"
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub aDragDrop_CustomersDoc_Change_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aDragDrop_CustomersDoc_Change.Execute
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ChangeFileAttachment_PopUp As ChangeFileAttachment_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), ChangeFileAttachment_PopUp)
If TryCast(_Selection(0), CustomersFileAttachment) IsNot Nothing Then
_WaitFormClass.InitWork(1, 1, _Selection.Count)
For Each _CustomersFileAttachmentAct As CustomersFileAttachment In _Selection
Dim _CustomersFileAttachment As CustomersFileAttachment = _onew.GetObject(_CustomersFileAttachmentAct)
If _ChangeFileAttachment_PopUp.ChangeRowGroup1 Then
_CustomersFileAttachment.RowGroup1 = _ChangeFileAttachment_PopUp.RowGroup1
End If
If _ChangeFileAttachment_PopUp.ChangeRowGroup2 Then
_CustomersFileAttachment.RowGroup2 = _ChangeFileAttachment_PopUp.RowGroup2
End If
If _ChangeFileAttachment_PopUp.ChangeStatus Then
_CustomersFileAttachment.Status = _ChangeFileAttachment_PopUp.Status
End If
_WaitFormClass.DoWork()
Next
End If
_onew.CommitChanges()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
_Waitformclass.FinalWork()
_Selection.Clear()
End Try
End Sub
'------Subs as Functions-------------
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
Public Function GetFileCreatedDate(_FileData As FileData) As Date
Try
Dim _FileName As String = System.IO.Path.GetTempPath + _FileData.FileName
Dim _StreamFile As New System.IO.FileStream(_FileName, FileMode.Create)
_FileData.SaveToStream(_StreamFile)
_StreamFile.Close()
Return File.GetCreationTime(_FileName)
Catch ex As Exception
Finally
Dim _FileName As String = System.IO.Path.GetTempPath + _FileData.FileName
If File.Exists(_FileName) Then File.Delete(_FileName)
End Try
End Function
Public Function GetFileCreatedDate(_FileName As String) As Date
Return File.GetCreationTime(_FileName)
End Function
Public Function GetFileModifiedDate(_FileData As FileData) As Date
Try
Dim _FileName As String = System.IO.Path.GetTempPath + _FileData.FileName
Dim _StreamFile As New System.IO.FileStream(_FileName, FileMode.Create)
_FileData.SaveToStream(_StreamFile)
_StreamFile.Close()
Return File.GetLastAccessTime(_FileName)
Catch ex As Exception
Finally
Dim _FileName As String = System.IO.Path.GetTempPath + _FileData.FileName
If File.Exists(_FileName) Then File.Delete(_FileName)
End Try
End Function
Public Function GetFileModifiedDate(_FileName As String) As Date
Return File.GetLastAccessTime(_FileName)
End Function
End Class
@@ -0,0 +1,32 @@
Partial Class FileAttachementsVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,40 @@
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
Public Class FileAttachementsVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "C3CGeneratedInvoice_DocumentFile_ListView" Or
View.Id = "OfferAskIn_OfferAskInDocuments_ListView" Or
View.Id = "OfferAskOut_OfferAskOutDocuments_ListView" Or
View.Id = "OfferAnswerIn_OfferAnswerInDocuments_ListView" Or
View.Id = "Products_ProductsDocumentations_ListView" Or
View.Id = "Customers_CustomersFileAttachment_ListView" Or
View.Id = "OfferAnswerOut_OfferAnswerOutDocuments_ListView" Then
Else
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).AddFromFileAction.Active.SetItemValue("", False)
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
Frame.GetController(Of DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentListViewController).AddFromFileAction.Active.SetItemValue("", True)
End Sub
End Class
@@ -0,0 +1,50 @@
Partial Class FileDataProcess_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.aShowFileData = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aShowFileData
'
Me.aShowFileData.Caption = "aShow File Data"
Me.aShowFileData.ConfirmationMessage = Nothing
Me.aShowFileData.Id = "aShowFileData"
Me.aShowFileData.ImageName = Nothing
Me.aShowFileData.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
Me.aShowFileData.Shortcut = Nothing
Me.aShowFileData.Tag = Nothing
Me.aShowFileData.TargetObjectsCriteria = Nothing
Me.aShowFileData.TargetObjectType = GetType(DevExpress.Persistent.BaseImpl.FileData)
Me.aShowFileData.TargetViewId = Nothing
Me.aShowFileData.ToolTip = Nothing
Me.aShowFileData.TypeOfView = Nothing
End Sub
Friend WithEvents aShowFileData As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -0,0 +1,126 @@
<?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="aShowFileData.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,40 @@
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.Persistent.BaseImpl
Public Class FileDataProcess_VC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Private Sub aShowFileData_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aShowFileData.Execute
Try
Dim _ocur As Xpo.XPObjectSpace = View.ObjectSpace
Dim _FileData As FileData = TryCast(View.SelectedObjects(0), FileData)
Dim _FileName As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetTempPath, _FileData.FileName)
Dim _StreamFile As System.IO.Stream = New System.IO.FileStream(_FileName, System.IO.FileMode.Create)
_FileData.SaveToStream(_StreamFile)
_StreamFile.Close()
Process.Start(_FileName)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly)
End Try
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class GridAutoWidthVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,39 @@
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.Win.Editors
Public Class GridAutoWidthVC
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
AddHandler View.ControlsCreated, AddressOf View_ControlsCreated
End Sub
Private Sub View_ControlsCreated(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
DirectCast(DirectCast(View, ListView).Editor, GridListEditor).GridView.OptionsView.ColumnAutoWidth = False
If TryCast(View, ListView) IsNot Nothing Then
If CType(View.Model, IModelListViewAllowSort) IsNot Nothing Then
DirectCast(DirectCast(View, ListView).Editor, GridListEditor).GridView.OptionsView.RowAutoHeight = CType(View.Model, IModelListViewAllowSort).RowAutoHeight
End If
End If
Catch
End Try
End Sub
End Class
+32
View File
@@ -0,0 +1,32 @@
Partial Class HTMLEditorVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,48 @@
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.XtraEditors
Imports DevExpress.ExpressApp.HtmlPropertyEditor.Win
Public Class HTMLEditorVC
Inherits DevExpress.ExpressApp.ViewController(Of DetailView)
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
For Each editor As HtmlPropertyEditor In View.GetItems(Of HtmlPropertyEditor)()
AddHandler editor.CustomizeHtmlHeader, AddressOf HTMLEditor_CustomizeHtmlHeader
Next editor
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
For Each editor As HtmlPropertyEditor In View.GetItems(Of HtmlPropertyEditor)()
RemoveHandler editor.CustomizeHtmlHeader, AddressOf HTMLEditor_CustomizeHtmlHeader
Next editor
End Sub
Private Sub HTMLEditor_CustomizeHtmlHeader(sender As Object, e As CustomizeHtmlHeaderEventArgs)
e.HeaderInnerHtml = "<style>"
e.HeaderInnerHtml += " * { font-family: Arial; }"
e.HeaderInnerHtml += " h1 { color: #8080a0; font-weight: normal; padding: 0px; margin: 5px 0px; }"
e.HeaderInnerHtml += " p { padding: 0px; margin: 3px 0px; color: #808080; }"
e.HeaderInnerHtml += " </style>"
End Sub
End Class
+32
View File
@@ -0,0 +1,32 @@
Partial Class InLineEditVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,562 @@
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.Win.Editors
Imports DevExpress.ExpressApp.ConditionalAppearance
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.ExpressApp.Model
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp.Utils
Imports DevExpress.ExpressApp.TreeListEditors.Win
Imports DevExpress.ExpressApp.Win.Core
Imports DevExpress.Xpo
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.ExpressApp.Validation
Public Class InLineEditVC
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
Private _GridListEditor As GridListEditor
Private _TreeListEditor As TreeListEditor
Private _HandlerCreated As Boolean = False
Private appearanceController As AppearanceController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
Dim _ListView As ListView = CType(View, ListView)
_GridListEditor = TryCast(_ListView.Editor, GridListEditor)
If _GridListEditor IsNot Nothing Then
_GridListEditor.AllowEdit = True
Dim _ic As New DevExpress.Utils.ImageCollection
_ic.AddImage(ImageLoader.Instance.GetImageInfo("data_edit").Image, "data_edit")
_GridListEditor.GridView.Images = _ic
AddHandler _GridListEditor.ColumnCreated, AddressOf GridListEditor_ColumnCreated
_HandlerCreated = True
For Each column As XafGridColumnWrapper In _GridListEditor.Columns
UpdateColumnProperties(column.Column, column.PropertyName, _GridListEditor)
Next
AddHandler _GridListEditor.GridView.CustomColumnDisplayText, AddressOf GridView_CustomColumnDisplayText
'AddHandler _GridListEditor.GridView.CustomDrawCell
Dim _IModelListViewExtender As IModelListViewExtender = TryCast(View.Model, IModelListViewExtender)
If _IModelListViewExtender IsNot Nothing Then
If _GridListEditor.GridView IsNot Nothing Then
_GridListEditor.GridView.GroupFormat = _IModelListViewExtender.GridViewGroupFormat
End If
End If
End If
_TreeListEditor = TryCast(_ListView.Editor, TreeListEditor)
If _TreeListEditor IsNot Nothing Then
_TreeListEditor.TreeList.OptionsBehavior.Editable = True
_TreeListEditor.TreeList.OptionsFilter.AllowColumnMRUFilterList = True
_TreeListEditor.TreeList.OptionsFilter.AllowFilterEditor = True
_TreeListEditor.TreeList.OptionsFilter.AllowMRUFilterList = True
If TryCast(View.Model, IModelListViewExtender) IsNot Nothing Then
If TryCast(View.Model, IModelListViewExtender).TreeListEnableFiltering Then
_TreeListEditor.TreeList.OptionsBehavior.EnableFiltering = True
End If
End If
For Each _RepositoryItem As RepositoryItem In _TreeListEditor.TreeList.RepositoryItems
_RepositoryItem.ReadOnly = False
Next _RepositoryItem
For Each column As TreeListColumnWrapper In _TreeListEditor.Columns
Dim modelColumn As IModelColumnExtender = Nothing
If column.PropertyName IsNot Nothing Then
DisableInlineEdit(column.Column)
If column.PropertyName.Contains(".") Then
Dim NewName As String() = column.PropertyName.Split(New Char() {"."c}, StringSplitOptions.RemoveEmptyEntries)
modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(NewName(NewName.Length - 1)), IModelColumnExtender)
Else
modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(column.PropertyName), IModelColumnExtender)
End If
If modelColumn IsNot Nothing Then
If modelColumn.InLineEdit = True Then
EnableInlineEdit(column.Column)
End If
If modelColumn.InLineEditAutoCommit Then
AddHandler _TreeListEditor.TreeList.CellValueChanged, AddressOf TreeListEditor_CellValueChanged
AddHandler _TreeListEditor.TreeList.ShownEditor, AddressOf TreeListEditor_ShownEditor
_TreeListEditor.TreeList.OptionsBehavior.ImmediateEditor = True
End If
End If
End If
Next
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If _HandlerCreated Then
If _GridListEditor IsNot Nothing Then
RemoveHandler _GridListEditor.ColumnCreated, AddressOf GridListEditor_ColumnCreated
If _GridListEditor.GridView IsNot Nothing Then RemoveHandler _GridListEditor.GridView.CustomColumnDisplayText, AddressOf GridView_CustomColumnDisplayText
End If
End If
End Sub
Private Sub GridListEditor_ColumnCreated(sender As Object, e As ColumnCreatedEventArgs)
Dim _GridListEditor = DirectCast(sender, GridListEditor)
UpdateColumnProperties(e.Column, e.ColumnInfo.PropertyName, _GridListEditor)
End Sub
Private Sub UpdateColumnProperties(gridColumn As DevExpress.XtraGrid.Columns.GridColumn, name As String, GridListEditor As GridListEditor)
'//Tiltás -----------------------------------------------------------------------------------------
DisableInlineEdit(gridColumn)
'--------------------------------------------------------------------------------------------------
'//Engedélyezés -----------------------------------------------------------------------------------
Select Case View.Id
Case "GLRows_ListView_Account"
Select Case name
Case "NoteRows", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "CRMEstate_Leads_CRMEstate_Leads_Immovables_ListView", "CRMEstate_Opportunity_CRMEstate_Opportunity_Immovables_ListView"
Select Case name
Case "AreaPriceNettoHUF", "AreaPriceNettoDEV", "AreaPriceDivide"
EnableInlineEdit(gridColumn)
End Select
Case "StorageOutRowsInRows_ListView_DeliveryNote_OrderIn", "StorageOutRowsInRows_ListView_DeliveryNote_Transfer", "DeliveryNoteOutRows_ListView_Invoice"
Select Case name
Case "QTT_Will"
EnableInlineEdit(gridColumn)
End Select
Case "ImmovablesPriceListHeader_ImmovablesPriceListRowsA_ListView", "ImmovablesPriceListHeader_ImmovablesPriceListRowsO_ListView", _
"ImmovablesPriceListHeader_ImmovablesPriceListRowsG_ListView", "ImmovablesPriceListHeader_ImmovablesPriceListRowsC_ListView"
Select Case name
Case "ListPriceBruttoDEV", "ListPriceBruttoHUF", "ListPriceBruttoDEVRent", "ListPriceBruttoHUFRent"
EnableInlineEdit(gridColumn)
End Select
Case "InvoiceHeader_InvoiceRows_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _InvoiceHeader As InvoiceHeader = CType(_PropertyCollectionSource.MasterObject, InvoiceHeader)
If _InvoiceHeader.IsEditable = True Then
Select Case name
Case "ShortName", "InvoicePeriod", "CustomsTariffs", "Description", "Units", "Controlling"
EnableInlineEdit(gridColumn)
End Select
End If
Case "OrderInHeader_OrderInRowsOther_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _OrderInHeader As OrderInHeader = CType(_PropertyCollectionSource.MasterObject, OrderInHeader)
If _OrderInHeader.IsEditable = True Then
Select Case name
Case "QTT", "Description"
EnableInlineEdit(gridColumn)
End Select
If _OrderInHeader.OrderInParameters.CurrencyName.ShortName = "HUF" Then
If name = "DiscountPriceHUF" Then
EnableInlineEdit(gridColumn)
End If
Else
If name = "DiscountPriceDEV" Then
EnableInlineEdit(gridColumn)
End If
End If
End If
Case "OfferInHeader_OfferInRows_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _OfferInHeader As OfferInHeader = CType(_PropertyCollectionSource.MasterObject, OfferInHeader)
If _OfferInHeader.IsEditable = True Then
Select Case name
Case "QTT"
EnableInlineEdit(gridColumn)
End Select
If _OfferInHeader.CurrencyName.ShortName = "HUF" Then
If name = "FinalPriceHUF" Then
EnableInlineEdit(gridColumn)
End If
Else
If name = "FinalPriceDEV" Then
EnableInlineEdit(gridColumn)
End If
End If
End If
Case "OfferOutHeader_OfferOutRows_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _OfferOutHeader As OfferOutHeader = CType(_PropertyCollectionSource.MasterObject, OfferOutHeader)
CriteriaOperator.Parse("")
If _OfferOutHeader.IsEditable = True Then
Select Case name
Case "QTT", "Description", "RowGroup1", "RowGroup2", "DescriptionPrivate"
EnableInlineEdit(gridColumn)
End Select
If _OfferOutHeader.CurrencyName.ShortName = "HUF" Then
If name = "FinalPriceHUF" Then
EnableInlineEdit(gridColumn)
End If
Else
If name = "FinalPriceHUF" Then
EnableInlineEdit(gridColumn)
End If
End If
End If
Case "OrderOutHeader_OrderOutRows_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _OrderOutHeader As OrderOutHeader = CType(_PropertyCollectionSource.MasterObject, OrderOutHeader)
If _OrderOutHeader.IsEditable = True Then
Select Case name
Case "Products"
EnableInlineEdit(gridColumn)
End Select
End If
Case "ContractRows_ListView_Invoice_Not_MileStone"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = TryCast(_ListView.CollectionSource, PropertyCollectionSource)
Select Case name
Case "NettoPriceHUF", "NettoPriceDEV", "ShortName", "Description", "InvoicePeriod", "Controlling", "PaymentOption", "VAT", "CurrencyRate", "QTT", "DateExecution"
EnableInlineEdit(gridColumn)
End Select
Case "ProductFinder_ProductSelected_ListView"
Select Case name
Case "QTT", "Description"
EnableInlineEdit(gridColumn)
End Select
Case "InventoryHeader_InventorySC_ListView"
Select Case name
Case "QTT_Found"
EnableInlineEdit(gridColumn)
End Select
Case "StorageInRows_ListView", "StorageInHeader_StorageInRows_ListView"
Select Case name
Case "QTT_Will"
EnableInlineEdit(gridColumn)
End Select
Case "Subcontractor_SubcontractorCustomers_ListView"
Select Case name
Case "Workplace"
EnableInlineEdit(gridColumn)
End Select
Case "WorkSheet_Header_WorkSheet_Rows_ListView"
Select Case name
Case "RowGroup1", "RowGroup2", "ShortName", "Description", "Quantity"
EnableInlineEdit(gridColumn)
End Select
Case "WorkSheet_Header_Worksheet_CostRows_ListView"
Select Case name
Case "FinalPriceHUF_Out", "FinalPriceDEV_Out", "Controlling"
EnableInlineEdit(gridColumn)
End Select
Case "BankImportHeaderSum_BankImportNameParameters_ListView"
Select Case name
Case "Controlling", "ChartOfAccounts"
EnableInlineEdit(gridColumn)
End Select
Case "GLRows_ListView_Bank"
Select Case name
Case "NoteRows", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "GLRowsDivideH_GLRowsDivideR_ListView_ConnectionDivide", "GLRowsDivideH_GLRowsDivideR_ListView"
Select Case name
Case "AmountHUF", "AmountDEV", "Controlling", "CostHolder", "CostPlace", "UniqueObjects", "JobNumberObjects"
EnableInlineEdit(gridColumn)
End Select
Case "GLRows_ListView_Cassa"
Select Case name
Case "NoteRows", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "GLRows_ListView_Compensation"
Select Case name
Case "NoteRows", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "LiquidAssetsReturnHeader_LiquidAssetsReturnDenomination_ListView"
Select Case name
Case "DenominationValue"
EnableInlineEdit(gridColumn)
End Select
Case "GLHeader_GLRows_ListView_Mixed"
Select Case name
Case "NoteRows", "AmountHUF", "AmountDEV", "DebitChartOfAccounts", "CreditChartOfAccounts", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "GLRows_ListView_Mixed"
Select Case name
Case "NoteRows", "Controlling", "CostHolder", "CostPlace", "JobNumberObjects", "UniqueObjects"
EnableInlineEdit(gridColumn)
End Select
Case "GLCardsHeader_GLCardsRows_ListView"
Select Case name
Case "Note_Rows"
EnableInlineEdit(gridColumn)
End Select
Case "GLRows_ListView_Bank"
Select Case name
Case "CurrencyRate2"
EnableInlineEdit(gridColumn)
End Select
Case "PermissionMatrix_ListView"
Select Case name
Case "IsCreate", "IsRead", "IsWrite", "IsNavigate", "IsDelete"
EnableInlineEdit(gridColumn)
End Select
Case "Corner_InvoiceNameParameters_ListView"
Select Case name
Case "Controlling"
EnableInlineEdit(gridColumn)
End Select
Case "Corner_CustomerNameParameters_ListView"
Select Case name
Case "Customers"
EnableInlineEdit(gridColumn)
End Select
Case "Vivaldi_InvoiceNameParameters_ListView"
Select Case name
Case "Controlling"
EnableInlineEdit(gridColumn)
End Select
Case "Vivaldi_CustomerNameParameters_ListView"
Select Case name
Case "Customers"
EnableInlineEdit(gridColumn)
End Select
Case "StorageOutRows_ListView_DeliveryNote"
Select Case name
Case "QTT_Will"
EnableInlineEdit(gridColumn)
End Select
Case "StorageInfromDeliveryNoteInRowsHeader_StorageInfromDeliveryNoteInRowsRows_ListView", _
"DeliveryNoteInFromOrderOutRowsHeader_DeliveryNoteInFromOrderOutRowsRows_ListView"
Select Case name
Case "QTT_Process"
EnableInlineEdit(gridColumn)
End Select
Case "DeliveryNoteInHeader_DeliveryNoteInrows_ListView"
Dim _ListView As ListView = CType(View, ListView)
Dim _PropertyCollectionSource As PropertyCollectionSource = CType(_ListView.CollectionSource, PropertyCollectionSource)
Dim _DeliveryNoteInHeader As DeliveryNoteInHeader = CType(_PropertyCollectionSource.MasterObject, DeliveryNoteInHeader)
If _DeliveryNoteInHeader.IsEditable = True Then
Select Case name
Case "QTT", "NoteRows"
EnableInlineEdit(gridColumn)
End Select
If _DeliveryNoteInHeader.CurrencyName.ShortName = "HUF" Then
If name = "ListPriceHUF" Then
EnableInlineEdit(gridColumn)
End If
Else
If name = "ListPriceDEV" Then
EnableInlineEdit(gridColumn)
End If
End If
End If
End Select
'// ModelEditor InLineEdit, InLineEditCriteria alapján
Dim modelColumn As IModelColumnExtender = Nothing
If name IsNot Nothing Then
If name.Contains(".") Then
Dim NewName As String() = name.Split(New Char() {"."c}, StringSplitOptions.RemoveEmptyEntries)
modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(NewName(NewName.Length - 1)), IModelColumnExtender)
Else
modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(name), IModelColumnExtender)
End If
If modelColumn IsNot Nothing Then
If modelColumn.InLineEdit = True Then
EnableInlineEdit(gridColumn)
End If
If modelColumn.InLineEditAutoCommit Then
AddHandler GridListEditor.GridView.CellValueChanged, AddressOf GridListEditor_CellValueChanged
End If
End If
End If
End Sub
Sub DisableInlineEdit(gridColumn As DevExpress.XtraGrid.Columns.GridColumn)
gridColumn.OptionsColumn.ReadOnly = True
gridColumn.OptionsColumn.AllowEdit = False
gridColumn.OptionsColumn.TabStop = False
gridColumn.ImageIndex = -1
If Mid(gridColumn.FieldName, 1, 4) = "row_" Then
gridColumn.OptionsColumn.AllowShowHide = False
End If
End Sub
Sub DisableInlineEdit(_TreeListColumn As DevExpress.XtraTreeList.Columns.TreeListColumn)
_TreeListColumn.OptionsColumn.ReadOnly = True
_TreeListColumn.OptionsColumn.AllowEdit = False
End Sub
Sub EnableInlineEdit(gridColumn As DevExpress.XtraGrid.Columns.GridColumn)
gridColumn.OptionsColumn.ReadOnly = False
gridColumn.OptionsColumn.AllowEdit = True
gridColumn.OptionsColumn.TabStop = True
gridColumn.ImageIndex = 0
End Sub
Sub EnableInlineEdit(_TreeListColumn As DevExpress.XtraTreeList.Columns.TreeListColumn)
_TreeListColumn.OptionsColumn.ReadOnly = False
_TreeListColumn.OptionsColumn.AllowEdit = True
End Sub
Private Sub GridListEditor_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
Try
Dim nestedFrame As NestedFrame = TryCast(Frame, NestedFrame)
Dim modelColumn As IModelColumnExtender = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(e.Column.FieldName.Trim("!")), IModelColumnExtender)
If modelColumn Is Nothing Then Exit Sub
If nestedFrame IsNot Nothing Then
If modelColumn.InLineEditAutoCommit Then
Frame.GetController(Of PersistenceValidationController)().Active.SetItemValue("", False)
Dim parentView As View = nestedFrame.View
TryCast(parentView.ObjectSpace, Xpo.XPObjectSpace).CommitChanges()
Frame.GetController(Of PersistenceValidationController)().Active.SetItemValue("", True)
parentView.ObjectSpace.Refresh()
End If
ElseIf Frame IsNot Nothing Then
If modelColumn.InLineEditAutoCommit Then
Frame.GetController(Of PersistenceValidationController)().Active.SetItemValue("", False)
TryCast(View.ObjectSpace, Xpo.XPObjectSpace).CommitChanges()
Frame.GetController(Of PersistenceValidationController)().Active.SetItemValue("", True)
View.ObjectSpace.Refresh()
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub GridView_CustomColumnDisplayText(sender As Object, e As DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs)
Dim modelColumn As IModelColumnExtender = Nothing
If View IsNot Nothing Then
If e.Column.FieldName <> "" Then
'If e.Column.FieldName.Contains(".") Then
' Dim NewName As String() = e.Column.FieldName.Split(New Char() {"."c}, StringSplitOptions.RemoveEmptyEntries)
' modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(NewName(NewName.Length - 1)), IModelColumnExtender)
'Else
modelColumn = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(e.Column.FieldName), IModelColumnExtender)
'End If
If modelColumn IsNot Nothing Then
If modelColumn.HideValueIfZero = True Then
If e.Value = 0 Then e.DisplayText = ""
End If
End If
End If
End If
End Sub
Private Sub TreeListEditor_CellValueChanged(sender As Object, e As DevExpress.XtraTreeList.CellValueChangedEventArgs)
Try
Dim nestedFrame As NestedFrame = TryCast(Frame, NestedFrame)
Dim newValue As Object = e.Value
If TypeOf e.Value Is IXPSimpleObject Then
newValue = ObjectSpace.GetObject(e.Value)
End If
Dim focusedObject As Object = _TreeListEditor.FocusedObject
If focusedObject IsNot Nothing Then
Dim focusedColumnMemberInfo As DevExpress.ExpressApp.DC.IMemberInfo = ObjectSpace.TypesInfo.FindTypeInfo(focusedObject.GetType()).FindMember(e.Column.FieldName)
If focusedColumnMemberInfo IsNot Nothing Then
focusedColumnMemberInfo.SetValue(focusedObject, Convert.ChangeType(newValue, focusedColumnMemberInfo.MemberType))
End If
End If
If nestedFrame IsNot Nothing Then
Frame.GetController(Of DevExpress.ExpressApp.Validation.PersistenceValidationController)().Active.SetItemValue("", False)
Dim parentView As View = nestedFrame.View
TryCast(parentView.ObjectSpace, Xpo.XPObjectSpace).CommitChanges()
Frame.GetController(Of DevExpress.ExpressApp.Validation.PersistenceValidationController)().Active.SetItemValue("", True)
'parentView.ObjectSpace.Refresh()
ElseIf Frame IsNot Nothing Then
Frame.GetController(Of DevExpress.ExpressApp.Validation.PersistenceValidationController)().Active.SetItemValue("", False)
TryCast(View.ObjectSpace, Xpo.XPObjectSpace).CommitChanges()
Frame.GetController(Of DevExpress.ExpressApp.Validation.PersistenceValidationController)().Active.SetItemValue("", True)
'View.ObjectSpace.Refresh()
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
End Try
End Sub
Private Sub TreeListEditor_ShownEditor(sender As Object, e As EventArgs)
'Dim activeEditor As IGridInplaceEdit = TryCast(_TreeListEditor.TreeList.ActiveEditor, IGridInplaceEdit)
'If activeEditor IsNot Nothing AndAlso TypeOf _TreeListEditor.TreeList.FocusedObject Is IXPSimpleObject Then
' activeEditor.GridEditingObject = _TreeListEditor.TreeList.FocusedObject
'End If
End Sub
End Class
@@ -0,0 +1,148 @@
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
Imports DevExpress.ExpressApp.ConditionalAppearance
Public Enum eEditMode
eCentralXML = 0
eUserXML = 1
End Enum
<Appearance("ListViewCustomization - Hide SQLServer when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="SQLServer", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide SQLDatabase when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="SQLDatabase", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide SQLUser when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="SQLUser", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide SQLPassword when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="SQLPassword", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide SQLType when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="SQLType", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide User when eEditMode = 0", AppearanceItemType.ViewItem, "eEditMode = 0", TargetItems:="User", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide XMLFileName when eEditMode = 1", AppearanceItemType.ViewItem, "eEditMode = 1", TargetItems:="XMLFileName", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("ListViewCustomization - Hide aListViewModelManager_FileBrowser when eEditMode = 1", AppearanceItemType.Action, " eEditMode = 1", TargetItems:="aListViewModelManager_FileBrowser", visibility:=Editors.ViewItemVisibility.Hide)> _
<DefaultClassOptions()> _
<NonPersistent()> _
<CreatableItem(False)> _
<NavigationItem(False)> _
Public Class ListViewCustomization
Inherits BaseObject
Private _eEditMode As eEditMode
Private _SQLServer As String
Private _SQLDatabase As String
Private _SQLUser As String
Private _SQLPassword As String
Private _SQLType As eSQLType
Private _XMLFileName As String
Private _User As User
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
XMLFileName = ""
eEditMode = eEditMode.eCentralXML
SQLType = eSQLType.MSSQL
End Sub
<ImmediatePostData()> _
Property eEditMode As eEditMode
Get
Return _eEditMode
End Get
Set(value As eEditMode)
SetPropertyValue("eEditMode", _eEditMode, value)
End Set
End Property
Property SQLServer As String
Get
Return _SQLServer
End Get
Set(value As String)
SetPropertyValue("SQLServer", _SQLServer, value)
End Set
End Property
Property SQLDatabase As String
Get
Return _SQLDatabase
End Get
Set(value As String)
SetPropertyValue("SQLDatabase", _SQLDatabase, value)
End Set
End Property
Property SQLUser As String
Get
Return _SQLUser
End Get
Set(value As String)
SetPropertyValue("SQLUser", _SQLUser, value)
End Set
End Property
Property SQLPassword As String
Get
Return _SQLPassword
End Get
Set(value As String)
SetPropertyValue("SQLPassword", _SQLPassword, value)
End Set
End Property
Property SQLType As eSQLType
Get
Return _SQLType
End Get
Set(value As eSQLType)
SetPropertyValue("SQLType", _SQLType, value)
End Set
End Property
Property XMLFileName As String
Get
Return _XMLFileName
End Get
Set(value As String)
SetPropertyValue("XMLFileName", _XMLFileName, value)
End Set
End Property
<ImmediatePostData(True), DataSourceProperty("XMLDatabaseUser", DataSourcePropertyIsNullMode.SelectNothing)>
Property User As User
Get
Return _User
End Get
Set(value As User)
SetPropertyValue("User", _User, value)
End Set
End Property
Private ReadOnly Property XMLDatabaseUser As XPCollection(Of User)
Get
Dim _UserCollection As XPCollection(Of User) = Nothing
Dim _Session As New Session
Try
_Session.ConnectionString = GetConnectionString()
_Session.Connect()
If _Session.IsConnected Then
_UserCollection = New XPCollection(Of User)(_Session)
End If
Catch ex As Exception
Finally
If _Session.IsConnected Then _Session.Disconnect()
End Try
Return _UserCollection
End Get
End Property
Private Function GetConnectionString()
Dim _ConnectionString As String = ""
Select Case SQLType
Case eSQLType.MSSQL
_ConnectionString = DevExpress.Xpo.DB.MSSqlConnectionProvider.GetConnectionString(SQLServer, SQLUser, SQLPassword, SQLDatabase)
Case eSQLType.MySQL
_ConnectionString = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString(SQLServer, SQLUser, SQLPassword, SQLDatabase)
Case eSQLType.PostgreSQL
_ConnectionString = DevExpress.Xpo.DB.PostgreSqlConnectionProvider.GetConnectionString(SQLServer, SQLUser, SQLPassword, SQLDatabase)
End Select
Return _ConnectionString
End Function
End Class
@@ -0,0 +1,67 @@
Partial Class ListViewModelManagerVC
<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.aManageListViewModel = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aListViewModelManager_FileBrowser = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aManageListViewModel
'
Me.aManageListViewModel.AcceptButtonCaption = Nothing
Me.aManageListViewModel.CancelButtonCaption = Nothing
Me.aManageListViewModel.Caption = "aManage List View Model"
Me.aManageListViewModel.Category = "Menu"
Me.aManageListViewModel.ConfirmationMessage = Nothing
Me.aManageListViewModel.Id = "aManageListViewModel"
Me.aManageListViewModel.ImageName = Nothing
Me.aManageListViewModel.Shortcut = Nothing
Me.aManageListViewModel.Tag = Nothing
Me.aManageListViewModel.TargetObjectsCriteria = Nothing
Me.aManageListViewModel.TargetViewId = Nothing
Me.aManageListViewModel.ToolTip = Nothing
Me.aManageListViewModel.TypeOfView = GetType(DevExpress.ExpressApp.View)
'
'aListViewModelManager_FileBrowser
'
Me.aListViewModelManager_FileBrowser.Caption = "aListViewModelManager_FileBrowser"
Me.aListViewModelManager_FileBrowser.Category = "aListViewModelManager_FileBrowser"
Me.aListViewModelManager_FileBrowser.ConfirmationMessage = Nothing
Me.aListViewModelManager_FileBrowser.Id = "aListViewModelManager_FileBrowser"
Me.aListViewModelManager_FileBrowser.ImageName = Nothing
Me.aListViewModelManager_FileBrowser.Shortcut = Nothing
Me.aListViewModelManager_FileBrowser.Tag = Nothing
Me.aListViewModelManager_FileBrowser.TargetObjectsCriteria = Nothing
Me.aListViewModelManager_FileBrowser.TargetViewId = ""
Me.aListViewModelManager_FileBrowser.ToolTip = Nothing
Me.aListViewModelManager_FileBrowser.TypeOfView = Nothing
End Sub
Friend WithEvents aManageListViewModel As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Private WithEvents aListViewModelManager_FileBrowser As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -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="aManageListViewModel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="aListViewModelManager_FileBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>184, 135</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,173 @@
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.Model
Imports DevExpress.ExpressApp.Model.Core
Imports System.IO
Imports System.Xml
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.BaseImpl
Public Class ListViewModelManagerVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If SecuritySystemHelper.IsUserInRoleCurrentUser("ListViewModelManager") = False Then
Frame.GetController(Of ListViewModelManagerVC).aManageListViewModel.Active.SetItemValue("", False)
End If
If View.Id = "ListViewCustomization_DetailView" Then
AddHandler Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DialogController)().AcceptAction.Executing, AddressOf ListViewCustomization_DetailView_AcceptAction_Executing
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
Frame.GetController(Of ListViewModelManagerVC).aManageListViewModel.Active.SetItemValue("", True)
If View.Id = "ListViewCustomization_DetailView" Then
RemoveHandler Frame.GetController(Of DevExpress.ExpressApp.SystemModule.DialogController)().AcceptAction.Executing, AddressOf ListViewCustomization_DetailView_AcceptAction_Executing
End If
End Sub
Private Sub aManageListViewModel_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aManageListViewModel.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ListViewCustomization As ListViewCustomization
_ListViewCustomization = _onew.CreateObject(Of ListViewCustomization)()
e.View = Application.CreateDetailView(_onew, "ListViewCustomization_DetailView", True, _ListViewCustomization)
End Sub
Private Sub aManageListViewModel_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aManageListViewModel.Execute
Dim _ListViewCustomization As ListViewCustomization = TryCast(e.PopupWindow.View.SelectedObjects(0), ListViewCustomization)
View.SaveModel()
Dim _Model As ModelApplicationBase = TryCast(Application.Model, ModelApplicationBase)
Dim xmlWriter As New ModelXmlWriter()
Dim aspect As String = _Model.GetAspect(0)
Dim xmlContent As String = xmlWriter.WriteToString(_Model, 0)
Dim _FileName As String = System.IO.Path.GetTempPath + View.Id + LTrim(RTrim(CStr(0))) + ".xml"
Dim _StreamFile As System.IO.Stream = New System.IO.FileStream(_FileName, System.IO.FileMode.Create)
Dim _StreamWriter As New StreamWriter(_StreamFile, System.Text.Encoding.UTF8)
_StreamWriter.Write(xmlContent)
_StreamWriter.Close()
Select Case _ListViewCustomization.eEditMode
Case eEditMode.eCentralXML
If IO.File.Exists(_FileName) Then
Dim _XmlDocument_From As New XmlDocument
_XmlDocument_From.Load(_FileName)
Dim _ListViewNode_From As XmlNode = _XmlDocument_From.SelectSingleNode("/Application/Views/ListView[@Id='" + View.Id + "']")
Dim _XmlDocument_To As New XmlDocument
_XmlDocument_To.Load(_ListViewCustomization.XMLFileName)
Dim _ListViewNode_To As XmlNode = _XmlDocument_To.SelectSingleNode("/Application/Views/ListView[@Id='" + View.Id + "']")
Dim _ListViewNode_To_Parent As XmlNode = Nothing
If _ListViewNode_To IsNot Nothing Then
_ListViewNode_To_Parent = _ListViewNode_To.ParentNode
_ListViewNode_To.ParentNode.RemoveChild(_ListViewNode_To)
_XmlDocument_To.Save(_ListViewCustomization.XMLFileName)
Else
_ListViewNode_To_Parent = _XmlDocument_To.SelectSingleNode("/Application/Views")
End If
Dim _ListViewNode_To_ImportNode As XmlNode = _XmlDocument_To.ImportNode(_ListViewNode_From, True)
_ListViewNode_To_Parent.AppendChild(_ListViewNode_To_ImportNode)
_XmlDocument_To.Save(_ListViewCustomization.XMLFileName)
End If
Case eEditMode.eUserXML
Dim _Session As New Session
_Session.ConnectionString = GetConnectionString(_ListViewCustomization)
_Session.Connect()
If _Session.IsConnected Then
_Session.BeginTransaction()
Dim _XmlUser As XmlUser = _Session.FindObject(Of XmlUser)(CriteriaOperator.Parse("User=?", _Session.GetObjectByKey(Of User)(_ListViewCustomization.User.Oid)))
Dim _XmlStore As XmlStore = _Session.FindObject(Of XmlStore)(CriteriaOperator.Parse("User=?", _Session.GetObjectByKey(Of XmlUser)(_XmlUser.Oid)))
Dim _FileStream As FileStream = File.Create(IO.Path.GetTempPath + View.Id + ".xml")
Dim info As Byte() = New UTF8Encoding(True).GetBytes(_XmlStore.XmlData)
_FileStream.Write(info, 0, info.Length)
_FileStream.Close()
Dim _XmlDocument_To As New XmlDocument
_XmlDocument_To.Load(IO.Path.GetTempPath + View.Id + ".xml")
Dim _ListViewNode_To As XmlNode = _XmlDocument_To.SelectSingleNode("/Application/Views/ListView[@Id='" + View.Id + "']")
Dim _ListViewNode_To_Parent As XmlNode = Nothing
If _ListViewNode_To IsNot Nothing Then
_ListViewNode_To_Parent = _ListViewNode_To.ParentNode
_ListViewNode_To.ParentNode.RemoveChild(_ListViewNode_To)
_XmlDocument_To.Save(IO.Path.GetTempPath + View.Id + ".xml")
Else
_ListViewNode_To_Parent = _XmlDocument_To.SelectSingleNode("/Application/Views")
End If
Dim _XmlDocument_From As New XmlDocument
_XmlDocument_From.Load(_FileName)
Dim _ListViewNode_From As XmlNode = _XmlDocument_From.SelectSingleNode("/Application/Views/ListView[@Id='" + View.Id + "']")
Dim _ListViewNode_To_ImportNode As XmlNode = _XmlDocument_To.ImportNode(_ListViewNode_From, True)
_ListViewNode_To_Parent.AppendChild(_ListViewNode_To_ImportNode)
_XmlDocument_To.Save(IO.Path.GetTempPath + View.Id + ".xml")
_XmlStore.XmlData = _XmlDocument_To.InnerXml
_XmlStore.Save()
_Session.CommitTransaction()
End If
End Select
End Sub
Private Sub aListViewModelManager_FileBrowser_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aListViewModelManager_FileBrowser.Execute
Dim _ListViewCustomization As ListViewCustomization = TryCast(View.SelectedObjects(0), ListViewCustomization)
If _ListViewCustomization IsNot Nothing Then
Dim _OpenFileDialog As New Windows.Forms.OpenFileDialog
_OpenFileDialog.Filter = "XAFML file (.xafml)|*.xafml|All Files (*.*)|*.*"
If _OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
_ListViewCustomization.XMLFileName = _OpenFileDialog.FileName
End If
End If
End Sub
Private Sub ListViewCustomization_DetailView_AcceptAction_Executing(sender As Object, e As CancelEventArgs)
Dim _ListViewCustomization As ListViewCustomization = TryCast(View.SelectedObjects(0), ListViewCustomization)
If String.IsNullOrEmpty(_ListViewCustomization.XMLFileName) And _ListViewCustomization.eEditMode = eEditMode.eCentralXML Then
e.Cancel = True
MsgBox("Nincs kiválasztva Model XML file!")
ElseIf Not IO.File.Exists(_ListViewCustomization.XMLFileName) And _ListViewCustomization.eEditMode = eEditMode.eCentralXML Then
e.Cancel = True
MsgBox("A kiválasztott Model XML file nem létezik!")
End If
End Sub
Private Function GetConnectionString(_ListViewCustomization As ListViewCustomization)
Dim _ConnectionString As String = ""
Select Case _ListViewCustomization.SQLType
Case eSQLType.MSSQL
_ConnectionString = DevExpress.Xpo.DB.MSSqlConnectionProvider.GetConnectionString(_ListViewCustomization.SQLServer, _ListViewCustomization.SQLUser, _ListViewCustomization.SQLPassword, _ListViewCustomization.SQLDatabase)
Case eSQLType.MySQL
_ConnectionString = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString(_ListViewCustomization.SQLServer, _ListViewCustomization.SQLUser, _ListViewCustomization.SQLPassword, _ListViewCustomization.SQLDatabase)
Case eSQLType.PostgreSQL
_ConnectionString = DevExpress.Xpo.DB.PostgreSqlConnectionProvider.GetConnectionString(_ListViewCustomization.SQLServer, _ListViewCustomization.SQLUser, _ListViewCustomization.SQLPassword, _ListViewCustomization.SQLDatabase)
End Select
Return _ConnectionString
End Function
End Class
@@ -0,0 +1,31 @@
Partial Class ShowFilterDialogController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,103 @@
' Developer Express Code Central Example:
' How to show filter dialog before showing ListView
'
' When the ListView contains a large amount of data, it is useful to provide a
' capability for the end-user to set a filter for this View before loading it. To
' accomplish this task, I've performed the following actions in this example:
' 1.
' Extended the Application Model with the AdditionalCriteria attribute for the
' ListView node via the WinSampleModule.GetSchema overridden method. This
' attribute should store the filter, selected by the user.
' 2. Implemented the
' ViewFilterContainer class, whose DetailView is used as a filter dialog.
' 3.
' Implemented the ViewFilterObject class, which is used to store filters.
' 4.
' Implemented a ShowFilterDialogController, which shows the DetailView of the
' ViewFilterContainer object before showing ListView, and then shows the filtered
' ListView.
' 5. Implemented the ViewFilterContainerModificationsController, which
' sets the ObjectType property of the ViewFilterObject class, created by the
' lookup's New action.
'
' See Also:
' How to: Use Criteria Property Editors
' (ms-help://DevExpress.Xaf/CustomDocument3014.htm)
' How to: Extend the
' Application Model and Schema
' (ms-help://DevExpress.Xaf/CustomDocument2785.htm)
' ShowNavigationItemController
' Class
' (ms-help://DevExpress.Xaf/clsDevExpressExpressAppSystemModuleShowNavigationItemControllertopic.htm)
' Dialog
' Controller
' (ms-help://DevExpress.Xaf/clsDevExpressExpressAppSystemModuleDialogControllertopic.htm)
'
' You can find sample updates and versions for different programming languages here:
' http://www.devexpress.com/example=E1554
Imports Microsoft.VisualBasic
Imports DevExpress.ExpressApp.DC
Imports System
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.Data.Filtering
Public Class ShowFilterDialogController
Inherits WindowController
Private dialogCotnroller As DialogController
Public Sub New()
TargetWindowType = WindowType.Main
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
AddHandler Frame.GetController(Of ShowNavigationItemController)().ShowNavigationItemAction.Execute, AddressOf ShowNavigationItemAction_Execute
End Sub
Private oldListView As View
Private Sub ShowNavigationItemAction_Execute(ByVal sender As Object, ByVal e As SingleChoiceActionExecuteEventArgs)
Dim showViewParameters As ShowViewParameters = e.ShowViewParameters
If TypeOf showViewParameters.CreatedView Is ListView Then
oldListView = showViewParameters.CreatedView
If (CType(oldListView.Model, IModelListViewExtender)).RequireCriteriaBeforeView = True Then
Dim objectSpace As IObjectSpace = Application.CreateObjectSpace()
Dim newViewFilterContainer As ViewFilterContainer = objectSpace.CreateObject(Of ViewFilterContainer)()
newViewFilterContainer.ObjectType = oldListView.ObjectTypeInfo.Type
newViewFilterContainer.ViewID = oldListView.Id
If (CType(oldListView.Model, IModelListViewExtender)).RequireCriteriaBeforeViewCriteria <> "" And (CType(oldListView.Model, IModelListViewExtender)).AdditionalCriteria = "" Then
newViewFilterContainer.Criteria = (CType(oldListView.Model, IModelListViewExtender)).RequireCriteriaBeforeViewCriteria
Else
newViewFilterContainer.Criteria = (CType(oldListView.Model, IModelListViewExtender)).AdditionalCriteria
End If
showViewParameters.CreatedView = Application.CreateDetailView(objectSpace, newViewFilterContainer)
showViewParameters.CreatedView.Caption = String.Format((CType(oldListView.Model, IModelListViewExtender)).RequireCriteriaBeforeViewCaption, oldListView.Caption)
showViewParameters.TargetWindow = TargetWindow.Current
dialogCotnroller = Application.CreateController(Of DialogController)()
AddHandler dialogCotnroller.AcceptAction.Execute, AddressOf AcceptAction_Execute
showViewParameters.Controllers.Add(dialogCotnroller)
End If
End If
End Sub
Private Sub AcceptAction_Execute(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs)
Try
Dim currentViewFilterContainer As ViewFilterContainer = CType(e.CurrentObject, ViewFilterContainer)
CType(oldListView, ListView).CollectionSource.BeginUpdateCriteria()
CType(oldListView, ListView).CollectionSource.Criteria("ByViewFilterObject") = CriteriaEditorHelper.GetCriteriaOperator(currentViewFilterContainer.Criteria, currentViewFilterContainer.ObjectType, oldListView.ObjectSpace)
CType(oldListView, ListView).CollectionSource.EndUpdateCriteria()
CType(oldListView.Model, IModelListViewExtender).AdditionalCriteria = currentViewFilterContainer.Criteria
e.ShowViewParameters.CreatedView = Application.CreateListView(oldListView.Id, CType(oldListView, ListView).CollectionSource, False)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Hiba")
End Try
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class ViewFilterContainerVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,44 @@
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.XtraFilterEditor
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.XtraEditors
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.Data.Filtering
Public Class ViewFilterContainerVC
Inherits Nuvolar.Module.ViewFilterContainerVC
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
If View.Id = "ViewFilterContainer_DetailView" Then
Dim _CriteriaPropertyEditor As CriteriaPropertyEditor = TryCast(View, DetailView).FindItem("Criteria")
If _CriteriaPropertyEditor IsNot Nothing Then
Dim _FilterEditorControl As FilterEditorControl = TryCast(_CriteriaPropertyEditor.Control, FilterEditorControl)
_FilterEditorControl.Font = New System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold)
_FilterEditorControl.ViewMode = FilterEditorViewMode.Visual
End If
End If
If View.Id = "ViewFilterContainer_ViewFilterContainerSaved_ListView" Then
CType(View, ListView).CollectionSource.Criteria("ByUser") = CriteriaOperator.Parse("IsPublic=? or UserCreated.UserName=?", True, SecuritySystem.CurrentUserName)
End If
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class LockObjectBeforeEditVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,59 @@
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.Model
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.ExpressApp.Win.SystemModule
Imports DevExpress.Xpo
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Data.Filtering
Public Class LockObjectBeforeEditVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If TryCast(View, ListView) IsNot Nothing Then
Dim _ListView As ListView = TryCast(View, ListView)
Dim _IModelClass As IModelClass
_IModelClass = _ListView.Model.ModelClass
AddHandler Frame.GetController(Of OpenObjectController).CustomOpenObject, AddressOf ListView_CustomOpenObject
End If
End Sub
Private Sub ListView_CustomOpenObject(sender As Object, e As CustomOpenObjectEventArgs)
Try
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _uow_lock As New UnitOfWork(_onew.Session.DataLayer)
Dim _User As User = _onew.GetObject(TryCast(SecuritySystem.CurrentUser, User))
Dim _ActBusinessObject As Object = e.ObjectToOpen
If TryCast(Application.Model.BOModel.GetNode(e.ObjectToOpen.GetType().FullName), IModelClassAllowSort).LockObjectBeforeEdit = True Then
If Not LockingModule.LockObject(_uow_lock, e.ObjectToOpen.GetType, _ActBusinessObject.Oid.ToString, _User) Then
e.Handled = True
Dim _LockingObject As LockingObject = _onew.FindObject(Of LockingObject)(CriteriaOperator.Parse("ObjectKey=?", _ActBusinessObject.Oid.ToString))
Throw New Exception(String.Format(TryCast(Application.Model.BOModel.GetNode(e.ObjectToOpen.GetType().FullName), IModelClassAllowSort).LockObjectBeforeEditErrorString, _
_LockingObject.User.FullName, _LockingObject.ObjectCreated))
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
End Try
End Sub
End Class
+31
View File
@@ -0,0 +1,31 @@
Partial Class LogOnDB
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
+25
View File
@@ -0,0 +1,25 @@
Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Win
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.ExpressApp.Security
Imports DevExpress.ExpressApp.Win.SystemModule
Public Interface IApplicationFactory
Function CreateApplication() As WinApplication
End Interface
Public Class LogOnDB
Inherits DevExpress.ExpressApp.WindowController
Public changeDatabaseAction As SingleChoiceAction
Public Shared NewApplication As WinApplication = Nothing
Public Sub New()
Me.TargetWindowType = WindowType.Main
'changeDatabaseAction = New SingleChoiceAction(Me, "ChangeDatabase", PredefinedCategory.View)
'changeDatabaseAction.Items.Add(New ChoiceActionItem("KUTYA", Nothing))
'changeDatabaseAction.Items.Add(New ChoiceActionItem("MACSKA", Nothing))
End Sub
End Class
+45
View File
@@ -0,0 +1,45 @@
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
Imports DevExpress.ExpressApp.Security
Public Class WinChangeDatabaseHelper
Public Shared DatabaseName As String
Public Shared AuthenticatedUserLogonFailed As Boolean = False
Public Shared SkipLogonDialog As Boolean = False
End Class
Public Class WinChangeDatabaseStandardAuthentication
Inherits AuthenticationStandard(Of SimpleUser, ChangeLogon)
Public Shared AuthenticatedUserName As String
Public Overloads Overrides ReadOnly Property AskLogonParametersViaUI() As Boolean
Get
If WinChangeDatabaseHelper.SkipLogonDialog Then
Return False
End If
Return MyBase.AskLogonParametersViaUI
End Get
End Property
Public Overloads Function Authenticate(ByVal objectSpace As DevExpress.ExpressApp.IObjectSpace) As Object
WinChangeDatabaseHelper.AuthenticatedUserLogonFailed = False
If String.IsNullOrEmpty(AuthenticatedUserName) Then
Return MyBase.Authenticate(objectSpace)
Else
Dim logonParameters As ChangeLogon = CType(Me.LogonParameters, ChangeLogon)
Dim result As Object = objectSpace.FindObject(UserType, New BinaryOperator("UserName", logonParameters.UserName))
If result Is Nothing Then
WinChangeDatabaseHelper.AuthenticatedUserLogonFailed = True
WinChangeDatabaseHelper.SkipLogonDialog = False
Throw New AuthenticationException(logonParameters.UserName, SecurityExceptionLocalizer.GetExceptionMessage(SecurityExceptionId.RetypeTheInformation))
End If
AuthenticatedUserName = ""
Return result
End If
End Function
End Class
@@ -0,0 +1,32 @@
Partial Class MasterDetailVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,361 @@
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.XtraGrid
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraEditors.Controls
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.ExpressApp.Model
Imports DevExpress.Utils.Drawing
Imports System.Drawing
Public Class MasterDetailVC
Inherits ViewController(Of ListView)
Private edit As RepositoryItemCheckEdit
Protected selection As ArrayList
Private column As GridColumn
Private Const CheckboxIndent As Integer = 4
Private _view As GridView
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
selection = New ArrayList()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
Dim gridListEditor As GridListEditor = TryCast(View.Editor, GridListEditor)
If gridListEditor IsNot Nothing Then
Dim grid As GridControl = gridListEditor.Grid
_view = gridListEditor.GridView
_view.OptionsPrint.PrintDetails = True
_view.OptionsDetail.ShowDetailTabs = True
_view.OptionsView.ShowDetailButtons = True
_view.OptionsDetail.EnableMasterViewMode = True
'iew.OptionsSelection.
If View.Id = "RegistryTasks_ListView_Not_Completed" Then
' InitCheckBoxColumn(_view) 'Úgy tűnik, mégsincs szükség erre.
End If
If View.Id = "AssetsHandling_ListView_Active" Then
InitCheckBoxColumn(_view)
End If
AddHandler _view.MasterRowExpanded, AddressOf view_MasterRowExpanded
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "InitCheckBoxColumn(_view)" Then
DetachCheckBoxColumn(_view)
End If
End Sub
Private Sub DetachCheckBoxColumn(ByVal _view As GridView)
If _view Is Nothing Then
Return
End If
If column IsNot Nothing Then
column.Dispose()
End If
If edit IsNot Nothing Then
_view.GridControl.RepositoryItems.Remove(edit)
edit.Dispose()
End If
RemoveHandler _view.Click, AddressOf View_Click
RemoveHandler _view.CustomDrawColumnHeader, AddressOf View_CustomDrawColumnHeader
RemoveHandler _view.CustomDrawGroupRow, AddressOf View_CustomDrawGroupRow
RemoveHandler _view.CustomUnboundColumnData, AddressOf view_CustomUnboundColumnData
RemoveHandler _view.KeyDown, AddressOf view_KeyDown
RemoveHandler _view.RowStyle, AddressOf view_RowStyle
_view = Nothing
End Sub
Private Sub InitCheckBoxColumn(ByVal view As GridView)
If view Is Nothing Then
Return
End If
selection.Clear()
view.BeginUpdate()
Try
edit = TryCast(view.GridControl.RepositoryItems.Add("CheckEdit"), RepositoryItemCheckEdit)
column = view.Columns.Add()
column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False
column.Visible = True
column.VisibleIndex = 0
column.FieldName = "CheckMarkSelection"
column.Caption = "Mark"
column.OptionsColumn.ShowCaption = False
column.OptionsColumn.AllowEdit = False
column.OptionsColumn.AllowSize = False
column.UnboundType = DevExpress.Data.UnboundColumnType.Boolean
column.Width = GetCheckBoxWidth()
column.ColumnEdit = edit
AddHandler view.Click, AddressOf View_Click
AddHandler view.CustomDrawColumnHeader, AddressOf View_CustomDrawColumnHeader
AddHandler view.CustomDrawGroupRow, AddressOf View_CustomDrawGroupRow
AddHandler view.CustomUnboundColumnData, AddressOf view_CustomUnboundColumnData
AddHandler view.KeyDown, AddressOf view_KeyDown
AddHandler view.RowStyle, AddressOf view_RowStyle
Finally
view.EndUpdate()
End Try
End Sub
Protected Function GetCheckBoxWidth() As Integer
Dim info As DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo = TryCast(edit.CreateViewInfo(), DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo)
Dim width As Integer = 0
GraphicsInfo.Default.AddGraphics(Nothing)
Try
width = info.CalcBestFit(GraphicsInfo.Default.Graphics).Width
Finally
GraphicsInfo.Default.ReleaseGraphics()
End Try
Return width + CheckboxIndent * 2
End Function
Protected Sub DrawCheckBox(ByVal g As Graphics, ByVal r As Rectangle, ByVal Checked As Boolean)
Dim info As DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo
Dim painter As DevExpress.XtraEditors.Drawing.CheckEditPainter
Dim args As DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs
info = TryCast(edit.CreateViewInfo(), DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo)
painter = TryCast(edit.CreatePainter(), DevExpress.XtraEditors.Drawing.CheckEditPainter)
info.EditValue = Checked
info.Bounds = r
info.CalcViewInfo(g)
args = New DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, New DevExpress.Utils.Drawing.GraphicsCache(g), r)
painter.Draw(args)
args.Cache.Dispose()
End Sub
Private Sub Invalidate()
_view.BeginUpdate()
_view.EndUpdate()
End Sub
Private Sub SelectRow(ByVal rowHandle As Integer, ByVal [select] As Boolean, ByVal invalidate As Boolean)
If IsRowSelected(rowHandle) = [select] Then
Return
End If
Dim row As Object = _view.GetRow(rowHandle)
If [select] Then
selection.Add(row)
Else
selection.Remove(row)
End If
If invalidate Then
Me.Invalidate()
End If
End Sub
Private Sub view_CustomUnboundColumnData(ByVal sender As Object, ByVal e As CustomColumnDataEventArgs)
If e.Column Is CheckMarkColumn Then
If e.IsGetData Then
e.Value = IsRowSelected(e.ListSourceRowIndex)
Else
SelectRow(e.ListSourceRowIndex, CBool(e.Value))
End If
End If
End Sub
Private Sub view_KeyDown(ByVal sender As Object, ByVal e As Windows.Forms.KeyEventArgs)
If _view.FocusedColumn IsNot column OrElse e.KeyCode <> Windows.Forms.Keys.Space Then
Return
End If
InvertRowSelection(_view.FocusedRowHandle)
End Sub
Private Sub View_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim info As GridHitInfo
Dim pt As Point = _view.GridControl.PointToClient(Windows.Forms.Control.MousePosition)
info = _view.CalcHitInfo(pt)
If info.Column Is column Then
If info.InColumn Then
If SelectedCount = _view.DataRowCount Then
ClearSelection()
Else
SelectAll()
End If
End If
If info.InRowCell Then
InvertRowSelection(info.RowHandle)
End If
End If
If info.InRow AndAlso _view.IsGroupRow(info.RowHandle) AndAlso info.HitTest <> GridHitTest.RowGroupButton Then
InvertRowSelection(info.RowHandle)
End If
End Sub
Private Sub View_CustomDrawColumnHeader(ByVal sender As Object, ByVal e As ColumnHeaderCustomDrawEventArgs)
If e.Column Is column Then
e.Info.InnerElements.Clear()
e.Painter.DrawObject(e.Info)
DrawCheckBox(e.Graphics, e.Bounds, SelectedCount = _view.DataRowCount)
e.Handled = True
End If
End Sub
Private Sub View_CustomDrawGroupRow(ByVal sender As Object, ByVal e As RowObjectCustomDrawEventArgs)
Dim info As DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo
info = TryCast(e.Info, DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo)
info.GroupText = " " & info.GroupText.TrimStart()
e.Info.Paint.FillRectangle(e.Graphics, e.Appearance.GetBackBrush(e.Cache), e.Bounds)
e.Painter.DrawObject(e.Info)
Dim r As Rectangle = info.ButtonBounds
r.Offset(r.Width + CheckboxIndent * 2 - 1, 0)
DrawCheckBox(e.Graphics, r, IsGroupRowSelected(e.RowHandle))
e.Handled = True
End Sub
Private Sub view_RowStyle(ByVal sender As Object, ByVal e As RowStyleEventArgs)
If IsRowSelected(e.RowHandle) Then
e.Appearance.BackColor = SystemColors.Highlight
e.Appearance.ForeColor = SystemColors.HighlightText
End If
End Sub
Public ReadOnly Property CheckMarkColumn() As GridColumn
Get
Return column
End Get
End Property
Public ReadOnly Property SelectedCount() As Integer
Get
Return selection.Count
End Get
End Property
Public Function GetSelectedRow(ByVal index As Integer) As Object
Return selection(index)
End Function
Public Function GetSelectedIndex(ByVal row As Object) As Integer
Return selection.IndexOf(row)
End Function
Public Sub ClearSelection()
selection.Clear()
Invalidate()
End Sub
Public Sub SelectAll()
selection.Clear()
' fast (won't work if the grid is filtered)
'if(_view.DataSource is ICollection)
' selection.AddRange(((ICollection)_view.DataSource));
'else
' slow:
For i As Integer = 0 To _view.DataRowCount - 1
selection.Add(_view.GetRow(i))
Next i
Invalidate()
End Sub
Public Sub SelectGroup(ByVal rowHandle As Integer, ByVal [select] As Boolean)
If IsGroupRowSelected(rowHandle) AndAlso [select] Then
Return
End If
For i As Integer = 0 To _view.GetChildRowCount(rowHandle) - 1
Dim childRowHandle As Integer = _view.GetChildRowHandle(rowHandle, i)
If _view.IsGroupRow(childRowHandle) Then
SelectGroup(childRowHandle, [select])
Else
SelectRow(childRowHandle, [select], False)
End If
Next i
Invalidate()
End Sub
Public Sub SelectRow(ByVal rowHandle As Integer, ByVal [select] As Boolean)
SelectRow(rowHandle, [select], True)
End Sub
Public Sub InvertRowSelection(ByVal rowHandle As Integer)
If _view.IsDataRow(rowHandle) Then
SelectRow(rowHandle, (Not IsRowSelected(rowHandle)))
End If
If _view.IsGroupRow(rowHandle) Then
SelectGroup(rowHandle, (Not IsGroupRowSelected(rowHandle)))
End If
End Sub
Public Function IsGroupRowSelected(ByVal rowHandle As Integer) As Boolean
For i As Integer = 0 To _view.GetChildRowCount(rowHandle) - 1
Dim row As Integer = _view.GetChildRowHandle(rowHandle, i)
If _view.IsGroupRow(row) Then
If (Not IsGroupRowSelected(row)) Then
Return False
End If
Else
If (Not IsRowSelected(row)) Then
Return False
End If
End If
Next i
Return True
End Function
Public Function IsRowSelected(ByVal rowHandle As Integer) As Boolean
If _view.IsGroupRow(rowHandle) Then
Return IsGroupRowSelected(rowHandle)
End If
Dim row As Object = _view.GetRow(rowHandle)
Return GetSelectedIndex(row) <> -1
End Function
Private Sub view_MasterRowExpanded(ByVal sender As Object, ByVal e As CustomMasterRowEventArgs)
Dim masterView As GridView = TryCast(sender, GridView)
Dim detailView As GridView = TryCast(masterView.GetDetailView(e.RowHandle, e.RelationIndex), GridView)
Dim i As Integer
Dim _Exists As Boolean = False
Try
detailView.BeginUpdate()
detailView.OptionsDetail.EnableMasterViewMode = False
detailView.OptionsBehavior.Editable = False
Dim tlist As ITypedList = detailView.DataSource
For Each col As GridColumn In detailView.Columns
If col.FieldName.Contains("!") Then
col.Visible = True
col.OptionsColumn.ShowInCustomizationForm = True
'Dim pd As PropertyDescriptor = tlist.GetItemProperties(Nothing)(Replace(col.FieldName, "!", ""))
'If pd IsNot Nothing Then
' Dim modelClass As IModelClass = Application.Model.BOModel.GetClass(pd.ComponentType)
' If modelClass Is Nothing Then Exit Sub
' Dim modelMember As IModelMember = modelClass.FindMember(col.FieldName)
' If modelMember Is Nothing Then Exit Sub
' col.Caption = modelMember.Caption
'End If
ElseIf Not tlist Is Nothing Then
Dim pd As PropertyDescriptor = tlist.GetItemProperties(Nothing)(col.FieldName)
If pd Is Nothing Then Exit Sub
Dim modelClass As IModelClass = Application.Model.BOModel.GetClass(pd.ComponentType)
If modelClass Is Nothing Then Exit Sub
Dim modelMember As IModelMember = modelClass.FindMember(col.FieldName)
If modelMember Is Nothing Then Exit Sub
col.Caption = modelMember.Caption
_Exists = False
For i = 0 To modelClass.DefaultListView.Columns.Count - 1
If col.FieldName = modelClass.DefaultListView.Columns.Item(i).PropertyName Then
_Exists = True
End If
Next
col.Visible = _Exists
End If
Next col
detailView.EndUpdate()
Catch
End Try
End Sub
Private Sub view_MasterRowExpanded_PCI(ByVal sender As Object, ByVal e As CustomMasterRowEventArgs)
Dim masterView As GridView = TryCast(sender, GridView)
Dim detailView As GridView = TryCast(masterView.GetDetailView(e.RowHandle, e.RelationIndex), GridView)
End Sub
End Class
@@ -0,0 +1,31 @@
Partial Class NavbarTreeList
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,98 @@
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.Win.Templates.ActionContainers
Imports DevExpress.ExpressApp.Model
Imports DevExpress.XtraTreeList.Nodes
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.XtraTreeList
Imports System.Drawing
Imports DevExpress.Data.Filtering
Partial Public Class NavbarTreeList
Inherits WindowController
Private navActionContainer As NavigationActionContainer
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
_ObjectSpace = Application.CreateObjectSpace()
_ListViewModel = CType(Application.FindModelView("RegistryTasks_ListView_Not_Completed"), IModelListView)
AddHandler Window.ProcessActionContainer, AddressOf Window_ProcessActionContainer
End Sub
Protected Overrides Sub OnDeactivated()
RemoveHandler Window.ProcessActionContainer, AddressOf Window_ProcessActionContainer
UnsubscribeFromContainerEvents()
navActionContainer = Nothing
MyBase.OnDeactivated()
End Sub
Private Sub Window_ProcessActionContainer(ByVal sender As Object, ByVal e As ProcessActionContainerEventArgs)
UnsubscribeFromContainerEvents()
If TypeOf e.ActionContainer Is NavigationActionContainer Then
navActionContainer = TryCast(e.ActionContainer, NavigationActionContainer)
SubscribeToContainerEvents()
SetupNavBar()
End If
End Sub
Private Sub SubscribeToContainerEvents()
If navActionContainer IsNot Nothing Then
AddHandler navActionContainer.NavigationControlCreated, AddressOf navigationControlCreated
End If
End Sub
Private Sub UnsubscribeFromContainerEvents()
If navActionContainer IsNot Nothing Then
RemoveHandler navActionContainer.NavigationControlCreated, AddressOf navigationControlCreated
End If
End Sub
Private Sub navigationControlCreated(ByVal sender As Object, ByVal e As EventArgs)
SetupNavBar()
End Sub
Private _TreeNode As TreeListNode
Private _ObjectSpace As Xpo.XPObjectSpace
Private _ListViewModel As IModelListView
Private Sub SetupNavBar()
If navActionContainer IsNot Nothing AndAlso TypeOf navActionContainer.NavigationControl Is TreeListNavigationControl Then
Dim treeListNavigationControl As TreeListNavigationControl = CType(navActionContainer.NavigationControl, TreeListNavigationControl)
Dim navItem As ChoiceActionItem = Window.GetController(Of ShowNavigationItemController)().ShowNavigationItemAction.Items.Find("@RegistryTask_ListView_Not_Completed", ChoiceActionItemFindType.Recursive, ChoiceActionItemFindTarget.Any)
If navItem IsNot Nothing Then
_TreeNode = treeListNavigationControl.FindNodeByActionItem(navItem)
AddHandler treeListNavigationControl.AfterExpand, AddressOf NavigationTreeList_AfterExpand
AddHandler treeListNavigationControl.NodeCellStyle, AddressOf NavigationTreeList_NodeCellStyle
End If
End If
End Sub
Private Sub NavigationTreeList_NodeCellStyle(ByVal sender As Object, ByVal e As GetCustomNodeCellStyleEventArgs)
If e.Node.GetDisplayText(e.Node.TreeList.Columns(0)).Contains(" [") Then
e.Appearance.Font = New Font(e.Appearance.Font, FontStyle.Bold)
End If
End Sub
Private Sub NavigationTreeList_AfterExpand(ByVal sender As Object, ByVal e As NodeEventArgs)
For Each node As TreeListNode In e.Node.Nodes
If node.Equals(_TreeNode) Then
Dim caption As String = _TreeNode.GetValue(_TreeNode.TreeList.Columns(0))
If caption.Contains(" [") Then
caption = caption.Remove(caption.IndexOf(" ["))
End If
Dim count As Integer = CInt(_ObjectSpace.Session.Evaluate(_ListViewModel.ModelClass.TypeInfo.Type, New AggregateOperand("", Aggregate.Count), CriteriaOperator.Parse("Status<>4 and HRPerson.User.UserName=?", SecuritySystem.CurrentUserName)))
If count > 0 Then
caption &= String.Format(" [{0}]", count)
End If
node.SetValue(_TreeNode.TreeList.Columns(0), caption)
End If
Next
End Sub
End Class
@@ -0,0 +1,126 @@
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports DevExpress.XtraEditors
Imports System.Windows.Forms
Imports DevExpress.ExpressApp.Demos
Imports System.Drawing
Public Class ProgressForm
Implements IProgressControl
Public Const FormName As String = "ProgressForm"
Private _form As XtraForm
Private _progressbar As ProgressBarControl = New ProgressBarControl()
Private _cancelbutton As SimpleButton = New SimpleButton()
Private _label As Label = New Label()
Private _longOperation As LongOperation
Private _minimumProgressValue As Long
Private _maximumProgressValue As Long
Private _progressFormCaption As String
Private Delegate Sub UpdateProgressFormDelegate(value As Long, message As String)
Private Sub CreateProgressForm()
_form = New XtraForm()
_form.Name = FormName
_form.Width = 350
_form.Height = 125
_form.StartPosition = FormStartPosition.CenterScreen
_form.FormBorderStyle = FormBorderStyle.FixedDialog
_form.MinimizeBox = False
_form.MaximizeBox = False
_form.ControlBox = False
_form.ShowInTaskbar = False
_label.Parent = _form
_label.Location = New Point(10, 10)
_label.Size = New Size(_form.ClientSize.Width - 20, 13)
_progressbar.Parent = _form
_progressbar.Location = New Point(10, 30)
_progressbar.Name = "progressBar"
_progressbar.Size = New Size(_form.ClientSize.Width - 20, 15)
_progressbar.Properties.Minimum = _minimumProgressValue
_progressbar.Properties.Maximum = _maximumProgressValue
_progressbar.Properties.Step = 1
_cancelbutton.Parent = _form
_cancelbutton.DialogResult = DialogResult.Cancel
_cancelbutton.Size = New Size(75, 23)
_cancelbutton.Location = New Point((_form.Width - _cancelbutton.Width) / 2, 55)
_cancelbutton.Text = "&Cancel"
AddHandler _cancelbutton.Click, AddressOf cancelButton_Click
AddHandler _cancelbutton.LostFocus, AddressOf DoOnFormLostFocus
_form.CancelButton = _cancelbutton
_form.Text = _progressFormCaption
End Sub
Public Sub ShowProgress(longOperation As DevExpress.ExpressApp.Demos.LongOperation) Implements IProgressControl.ShowProgress
_form.Show()
Me._longOperation = longOperation
AddHandler Me._longOperation.ProgressChanged, AddressOf LongOperation_ProgressChanged
AddHandler Me._longOperation.Completed, AddressOf LongOperation_Completed
End Sub
Private Sub DoOnFormLostFocus(sender As Object, e As EventArgs)
_form.Focus()
End Sub
Private Sub LongOperation_Completed(sender As Object, e As LongOperationCompletedEventArgs)
If _form IsNot Nothing Then
_form.Invoke(New MethodInvoker(AddressOf _form.Close))
End If
End Sub
Private Sub UpdateProgressForm(value As Long, message As String)
_progressbar.EditValue = value
_progressbar.Update()
_label.Text = message
End Sub
Private Sub LongOperation_ProgressChanged(sender As Object, e As LongOperationProgressChangedEventArgs)
Dim value As Long = e.ProgressPercentage
If _form IsNot Nothing Then
_form.Invoke(New UpdateProgressFormDelegate(AddressOf UpdateProgressForm), value, e.Message)
End If
End Sub
Private Sub cancelButton_Click(sender As Object, e As EventArgs)
_longOperation.CancelAsync()
End Sub
Public Sub ProgressForm(caption As String, minimum As Integer, maximum As Integer)
_progressFormCaption = caption
_minimumProgressValue = minimum
_maximumProgressValue = maximum
CreateProgressForm()
End Sub
#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
End If
_label = Nothing
RemoveHandler _cancelbutton.LostFocus, AddressOf DoOnFormLostFocus
RemoveHandler _longOperation.ProgressChanged, AddressOf LongOperation_ProgressChanged
RemoveHandler _longOperation.Completed, AddressOf LongOperation_Completed
_longOperation = Nothing
If _form IsNot Nothing Then
_form.Invoke(New MethodInvoker(AddressOf _form.Dispose))
_form = Nothing
End If
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
+54
View File
@@ -0,0 +1,54 @@
Partial Class RTFCopy_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.aGetGridToRTFText = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aGetGridToRTFText
'
Me.aGetGridToRTFText.Caption = "aGet Grid To RTFText"
Me.aGetGridToRTFText.ConfirmationMessage = Nothing
Me.aGetGridToRTFText.Id = "aGetGridToRTFText"
Me.aGetGridToRTFText.ImageName = Nothing
Me.aGetGridToRTFText.Shortcut = Nothing
Me.aGetGridToRTFText.Tag = Nothing
Me.aGetGridToRTFText.TargetObjectsCriteria = Nothing
Me.aGetGridToRTFText.TargetViewId = Nothing
Me.aGetGridToRTFText.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
Me.aGetGridToRTFText.ToolTip = Nothing
Me.aGetGridToRTFText.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
'
'RTFCopy_VC
'
Me.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
Me.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
End Sub
Friend WithEvents aGetGridToRTFText As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -0,0 +1,126 @@
<?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="aGetGridToRTFText.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,182 @@
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.Win.Editors
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.Persistent.BaseImpl
Imports System.IO
Public Class RTFCopy_VC
Inherits DevExpress.ExpressApp.ViewController
'-----------------------Csak LISTVIEW-n mûködik!-------------------
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
' Frame.GetController(Of RTFCopy_VC).aGetGridToRTFText.Active.SetItemValue("", False)
End Sub
Private Sub aGetGridToRTFText_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aGetGridToRTFText.Execute
Dim _ListView As ListView = TryCast(View, ListView)
If _ListView IsNot Nothing Then
Dim _GridListEditor As GridListEditor = TryCast(_ListView.Editor, GridListEditor)
If _GridListEditor IsNot Nothing Then
Dim _GridView As GridView = TryCast(_GridListEditor.GridView, GridView)
If _GridView IsNot Nothing Then
Dim _FileName As String = Path.GetTempPath + "Grid.html"
_GridView.ExportToHtml(_FileName)
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _UserCreated As User = SecuritySystem.CurrentUser
Dim _RTFCopy As RTFCopy = _onew.FindObject(Of RTFCopy)(DevExpress.Data.Filtering.CriteriaOperator.Parse("UserCreated=?", _onew.GetObject(_UserCreated)))
If _RTFCopy Is Nothing Then
_RTFCopy = New RTFCopy(_onew.Session)
End If
_RTFCopy.RTFString = File.ReadAllText(_FileName)
_onew.CommitChanges()
End If
End If
End If
End Sub
Function RTFTableCreator(_Grid As GridView, Optional _FontSize As String = "8", Optional _FontType As String = "Tahoma") As String
Dim _RTFtext As New StringBuilder
Dim _HeaderFillColor As Int32 ' -- Current table header fill color index in colot table
_HeaderFillColor = 2
If _Grid.DataRowCount > 0 Then
Dim _FontSizeNUM As Int32 = (Convert.ToInt32(_FontSize) * 2) ' -- Font size in half-points (the default is 16). => Size 8!!!
Dim _RowNumFull As Integer = _Grid.RowCount
Dim _RowNum As Integer = _Grid.DataRowCount
Dim _ColumnsNum As Integer = _Grid.Columns.Count
Dim irowIndex As Int32 = 0
Dim _LastCellIndex As Int32 = 0
'--Header to RTF format--
'=================================================================================
_RTFtext.Append("\pard\plain\ql\par\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10" & _
"\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\trleft-108\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108")
For _ik As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
_RTFtext.Append("\clvertalt\clcbpat2\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10" &
"\cltxlrtb\clftsWidth3\clwWidth3302\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _ik)
If _LastCellIndex < _ik Then
_LastCellIndex = _ik
End If
Next
For _ik As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
_RTFtext.Append("\pard\plain\ql\intbl{\b\fs" & _FontSizeNUM & "\cf0 " & _Grid.Columns.View.VisibleColumns(_ik).Caption & "}\b\cell")
Next
_RTFtext.Append("\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10" & _
"\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10\trleft-108\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108")
For _ik As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
_RTFtext.Append("\clvertalt\clcbpat" & _HeaderFillColor & "\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10" &
"\cltxlrtb\clftsWidth3\clwWidth3302\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _ik)
Next
irowIndex += 1
'' --Data to RTF format--
'=================================================================================
For _ik As Int16 = 0 To _RowNumFull - 2
If _Grid.IsGroupRow(_Grid.Columns.View.GetVisibleRowHandle(_ik)) = True Then
_RTFtext.Append("\row")
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & (_Grid.GetGroupRowDisplayText(_Grid.Columns.View.GetVisibleRowHandle(_ik)).ToString) & "}\cell")
_RTFtext.Append("\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10" & _
"\trleft-108\trftsWidth1\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108\tblindtype3\tblind0")
_RTFtext.Append("\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cltxlrtb\clftsWidth3\clwWidth9619" & _
"\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _LastCellIndex)
irowIndex += 1
Else
_RTFtext.Append("\row")
For _jk As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
If _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName <> "System.Double" And _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName <> "System.Boolean" Then
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & (_Grid.GetRowCellDisplayText(_Grid.Columns.View.GetVisibleRowHandle(_ik), _Grid.Columns.View.VisibleColumns(_jk))) & "}\cell")
ElseIf _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName = "System.Boolean" Then
If _Grid.GetRowCellValue(_Grid.Columns.View.GetVisibleRowHandle(_ik), _Grid.Columns.View.VisibleColumns(_jk)) = True Then
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & "Van" & "}\cell")
Else
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & "Nincs" & "}\cell")
End If
Else
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0\qr " & LTrim(RTrim(Format(_Grid.Columns.View.GetRowCellValue(_Grid.Columns.View.GetVisibleRowHandle(_ik), _Grid.Columns.View.VisibleColumns(_jk)), "#,##0.00"))) & "}\qr\cell")
End If
Next
_RTFtext.Append("\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10" & _
"\trleft-108\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108")
For _jk As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
_RTFtext.Append("\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cltxlrtb\clftsWidth3\clwWidth3302" & _
"\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _jk)
Next
irowIndex += 1
End If
Next
'--Last row --
'=================================================================================
If _Grid.IsGroupRow(_Grid.Columns.View.GetVisibleRowHandle(_RowNumFull - 1)) = True Then
_RTFtext.Append("\row")
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & (_Grid.GetGroupRowDisplayText(_Grid.Columns.View.GetVisibleRowHandle(_RowNumFull - 1)).ToString) & "}\cell")
_RTFtext.Append("\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10" & _
"\trleft-108\trftsWidth1\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108\tblindtype3\tblind0")
_RTFtext.Append("\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cltxlrtb\clftsWidth3\clwWidth9619" & _
"\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _LastCellIndex)
Else
_RTFtext.Append("\row")
For _jk As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
If _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName <> "System.Double" And _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName <> "System.Boolean" Then
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & (_Grid.Columns.View.GetRowCellDisplayText(_RowNum - 1, _Grid.Columns.View.VisibleColumns(_jk))) & "}\cell")
ElseIf _Grid.Columns.View.VisibleColumns(_jk).ColumnType.FullName = "System.Boolean" Then
If _Grid.IsGroupRow(_Grid.Columns.View.GetVisibleRowHandle(_RowNumFull - 1)) = True Then
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & "Van" & "}\cell")
Else
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0 " & "Nincs" & "}\cell")
End If
Else
_RTFtext.Append("\pard\plain\ql\intbl{\fs" & _FontSizeNUM & "\cf0\qr " & LTrim(RTrim(Format(_Grid.Columns.View.GetRowCellValue(_Grid.Columns.View.GetVisibleRowHandle(_RowNumFull - 1), _Grid.Columns.View.VisibleColumns(_jk)), "#,##0.00"))) & "}\qr\cell")
End If
Next
_RTFtext.Append("\trowd\irow" & irowIndex & "\irowband" & irowIndex & "\lastrow\trbrdrt\brdrs\brdrw10\trbrdrl\brdrs\brdrw10\trbrdrb\brdrs\brdrw10\trbrdrr\brdrs\brdrw10" & _
"\trleft-108\trautofit1\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108")
''---
For _jk As Integer = 0 To _Grid.Columns.View.VisibleColumns.Count - 1
_RTFtext.Append("\clvertalt\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cltxlrtb\clftsWidth3\clwWidth3302" & _
"\clpadfr3\clpadr108\clpadft3\clpadt108\cellx" & _jk)
Next
End If
_RTFtext.Append("\row\pard\plain\ql")
End If
Return _RTFtext.ToString
End Function
End Class
+32
View File
@@ -0,0 +1,32 @@
Partial Class SchedulerVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,76 @@
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.Win.Editors
Imports DevExpress.ExpressApp.Scheduler.Win
Imports DevExpress.XtraScheduler
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Persistent.Base.General
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.BaseImpl
Public Class SchedulerVC
Inherits DevExpress.ExpressApp.ViewController
Private scheduler As SchedulerControl
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
If View.Id = "Contacts_CRM_Leads_Activity_ListView" Then
' Access the current List View
Dim currentView As ListView = CType(View, ListView)
' Access the View's List Editor as a SchedulerListEditor
Dim listEditor As SchedulerListEditor = CType(currentView.Editor, SchedulerListEditor)
' Access the LOist Editor's ScheudlerControl
scheduler = listEditor.SchedulerControl
' Set the desired time to be visible
If Not scheduler Is Nothing Then
AddHandler scheduler.Storage.AppointmentInserting, AddressOf AppointmentInserting
End If
End If
End Sub
Sub AppointmentInserting(sender As Object, e As DevExpress.XtraScheduler.PersistentObjectCancelEventArgs)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Appointment As Appointment
Dim _CRM_Leads_Activity As CRM_Leads_Activity
Dim _Contacts As Contacts = TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, Contacts)
Dim _CRM_Leads As CRM_Leads
Dim currentUser As User = _ocur.GetObjectByKey(Of User)(_ocur.GetKeyValue(SecuritySystem.CurrentUser))
If _Contacts IsNot Nothing Then
_Appointment = TryCast(e.Object, Appointment)
If _Contacts.CRM_Leads Is Nothing Then
_CRM_Leads = _ocur.CreateObject(Of CRM_Leads)()
_CRM_Leads.Contacts = _Contacts
_CRM_Leads.FirstName = _Contacts.FirstName
_CRM_Leads.LastName = _Contacts.LastName
_CRM_Leads.HRPerson = _ocur.FindObject(Of HRPerson)(CriteriaOperator.Parse("User=?", currentUser))
_CRM_Leads.CRM_FirstMeet = _ocur.FindObject(Of CRM_FirstMeet)(CriteriaOperator.Parse("DefaultforBusiness=True"))
_CRM_Leads.LeadStatus = eLeadStatus.Qualified
End If
_CRM_Leads_Activity = _ocur.CreateObject(Of CRM_Leads_Activity)()
_CRM_Leads_Activity.CRM_Leads = _Contacts.CRM_Leads
_CRM_Leads_Activity.EventType = eEventType.eMeeting
_CRM_Leads_Activity.Subject = _Appointment.Subject
_CRM_Leads_Activity.StartOn = _Appointment.Start
_CRM_Leads_Activity.EndOn = _Appointment.End
End If
_ocur.CommitChanges()
End Sub
End Class
@@ -0,0 +1,31 @@
Partial Class ShowAlertControlMainWindowController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,54 @@
Imports System
Imports System.Windows.Forms
Imports DevExpress.ExpressApp
Imports DevExpress.XtraBars.Alerter
Imports DevExpress.ExpressApp.Utils
Public Class ShowAlertControlMainWindowController
Inherits WindowController
Private alertControlCore As AlertControl
Private alertTimerCore As Timer
Public Sub New()
TargetWindowType = WindowType.Main
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
'InitAlertControlCore()
'InitAlertTimerCore()
End Sub
Protected Overridable Sub InitAlertControlCore()
alertControlCore = New AlertControl()
End Sub
Protected Overridable Sub InitAlertTimerCore()
alertTimerCore = New Timer()
AddHandler alertTimerCore.Tick, AddressOf alertTimerCore_Tick
alertTimerCore.Interval = 5000
alertTimerCore.Start()
End Sub
Private Sub alertTimerCore_Tick(ByVal sender As Object, ByVal e As EventArgs)
ShowAlertInfo()
End Sub
Protected Overrides Sub OnDeactivated()
If alertTimerCore IsNot Nothing Then
alertTimerCore.Stop()
End If
MyBase.OnDeactivated()
End Sub
Protected Overridable Sub ShowAlertInfo()
Dim mainForm As Form = CType(Application.MainWindow.Template, Form)
Dim info As New AlertInfo("Késésben vagy vaze !!!!", "", DateTime.Now.ToString(), ImageLoader.Instance.GetImageInfo("document_into").Image)
AlertControl.Show(mainForm, info)
End Sub
Public ReadOnly Property AlertControl() As AlertControl
Get
Return alertControlCore
End Get
End Property
Public ReadOnly Property AlertTimer() As Timer
Get
Return alertTimerCore
End Get
End Property
End Class
@@ -0,0 +1,31 @@
Partial Class SISShowNavigationItemController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,47 @@
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Data.Filtering
Public Class SISShowNavigationItemController
Inherits ShowNavigationItemController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub ShowNavigationItem(args As DevExpress.ExpressApp.Actions.SingleChoiceActionExecuteEventArgs)
If args.SelectedChoiceActionItem IsNot Nothing AndAlso args.SelectedChoiceActionItem.Enabled = True Then
If args.SelectedChoiceActionItem.Id = "@OrderInToDispose" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _UserCreated = _onew.GetObjectByKey(Of User)(_onew.GetKeyValue(SecuritySystem.CurrentUser))
Dim _OrderInToDispose As OrderInToDispose = _onew.FindObject(Of OrderInToDispose)(CriteriaOperator.Parse("UserCreated=?", _UserCreated))
If _OrderInToDispose Is Nothing Then
_OrderInToDispose = _onew.CreateObject(Of OrderInToDispose)()
_onew.CommitChanges()
End If
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "OrderInToDispose_DetailView", True, _OrderInToDispose)
ElseIf args.SelectedChoiceActionItem.Id = "@ProductFinder" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ProductFinder As ProductFinder = _onew.CreateObject(Of ProductFinder)()
_ProductFinder.MasterKey = Guid.NewGuid
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ProductFinder_DetailView", True, _ProductFinder)
ElseIf args.SelectedChoiceActionItem.Id = "@ServiceFinder" Then
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ServiceFinder As ServiceFinder = _onew.CreateObject(Of ServiceFinder)()
_ServiceFinder.MasterKey = Guid.NewGuid
args.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "ServiceFinder_DetailView", True, _ServiceFinder)
Else
MyBase.ShowNavigationItem(args)
End If
End If
End Sub
End Class
+32
View File
@@ -0,0 +1,32 @@
Partial Class SplitterVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,30 @@
Imports System.Linq
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Win.Layout
Imports DevExpress.ExpressApp.Model
Imports DevExpress.XtraEditors
Partial Public Class SplitterVC
Inherits ViewController(Of ListView)
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Model.MasterDetailMode = MasterDetailMode.ListViewAndDetailView Then
AddHandler View.ControlsCreated, AddressOf View_ControlCreated
End If
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
End Sub
Private Sub View_ControlCreated(sender As Object, e As EventArgs)
Dim splitContainer As SplitContainer = CType(View.Control, SplitContainer)
splitContainer.FixedPanel = SplitFixedPanel.None
splitContainer.SplitterPosition = TryCast(View.Model.SplitLayout, IModelListViewSplitLayout).SplitterPosition
End Sub
End Class
+65
View File
@@ -0,0 +1,65 @@
Partial Class TreeListVC
<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.aTreeCollapseAll = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
Me.aTreeExpandAll = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aTreeCollapseAll
'
Me.aTreeCollapseAll.Caption = "Collapse all"
Me.aTreeCollapseAll.Category = "View"
Me.aTreeCollapseAll.ConfirmationMessage = Nothing
Me.aTreeCollapseAll.Id = "aTreeCollapseAll"
Me.aTreeCollapseAll.ImageName = "arrow_up_blue"
Me.aTreeCollapseAll.Shortcut = Nothing
Me.aTreeCollapseAll.Tag = Nothing
Me.aTreeCollapseAll.TargetObjectsCriteria = Nothing
Me.aTreeCollapseAll.TargetViewId = Nothing
Me.aTreeCollapseAll.ToolTip = Nothing
Me.aTreeCollapseAll.TypeOfView = Nothing
'
'aTreeExpandAll
'
Me.aTreeExpandAll.Caption = "Expand all"
Me.aTreeExpandAll.Category = "View"
Me.aTreeExpandAll.ConfirmationMessage = Nothing
Me.aTreeExpandAll.Id = "aTreeExpandAll"
Me.aTreeExpandAll.ImageName = "arrow_down_blue"
Me.aTreeExpandAll.Shortcut = Nothing
Me.aTreeExpandAll.Tag = Nothing
Me.aTreeExpandAll.TargetObjectsCriteria = Nothing
Me.aTreeExpandAll.TargetViewId = Nothing
Me.aTreeExpandAll.ToolTip = Nothing
Me.aTreeExpandAll.TypeOfView = Nothing
End Sub
Friend WithEvents aTreeCollapseAll As DevExpress.ExpressApp.Actions.SimpleAction
Friend WithEvents aTreeExpandAll As DevExpress.ExpressApp.Actions.SimpleAction
End Class
@@ -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="aTreeCollapseAll.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>21, 16</value>
</metadata>
<metadata name="aTreeExpandAll.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>159, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,49 @@
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.TreeListEditors.Win
Imports DevExpress.XtraTreeList
Imports DevExpress.Persistent.Base.General
Public Class TreeListVC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
TargetViewType = ViewType.ListView
TargetObjectType = GetType(ITreeNode)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
End Sub
Private Sub aTreeCollapseAll_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aTreeCollapseAll.Execute
Dim _ListView As ListView = CType(View, ListView)
Dim _ListEditor As TreeListEditor = CType(_ListView.Editor, TreeListEditor)
Dim _TreeList As TreeList = _ListEditor.TreeList
_TreeList.CollapseAll()
End Sub
Private Sub aTreeExpandAll_Execute(ByVal sender As System.Object, ByVal e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aTreeExpandAll.Execute
Dim _ListView As ListView = CType(View, ListView)
Dim _ListEditor As TreeListEditor = CType(_ListView.Editor, TreeListEditor)
Dim _TreeList As TreeList = _ListEditor.TreeList
_TreeList.ExpandAll()
End Sub
End Class
@@ -0,0 +1,42 @@
Imports Microsoft.VisualBasic
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.Win.Editors
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.Utils
Public Class WinAllowSortListViewController
Inherits AllowSortListViewController
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
UpdateAllowSort()
End Sub
Protected Overrides Sub UpdateAllowSort()
'Dim gridListEditor As GridListEditor = TryCast(View.Editor, GridListEditor)
'If gridListEditor IsNot Nothing Then
' Dim allowSortListView As Boolean = GetAllowSortListView()
' gridListEditor.GridView.OptionsCustomization.AllowSort = allowSortListView
' If allowSortListView Then
' For Each column As GridColumn In gridListEditor.GridView.Columns
' Dim xafColumn As GridColumn = TryCast(column, GridColumn)
' If xafColumn IsNot Nothing Then
' If GetAllowSortColumn(xafColumn) Then
' xafColumn.OptionsColumn.AllowSort = DefaultBoolean.True
' Else
' xafColumn.OptionsColumn.AllowSort = DefaultBoolean.False
' End If
' End If
' Next column
' End If
'End If
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class WinGroupFooterViewController
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,80 @@
Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.Data
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Model
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Columns
Public Class WinGroupFooterViewController
Inherits ViewController(Of ListView)
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Private Sub View_InfoSynchronized(ByVal sender As Object, ByVal e As EventArgs)
Dim modelListView As IModelListViewExtender = TryCast(View.Model, IModelListViewExtender)
If modelListView IsNot Nothing AndAlso modelListView.IsGroupFooterVisible Then
Dim gridListEditor As GridListEditor = TryCast(View.Editor, GridListEditor)
If gridListEditor IsNot Nothing Then
Dim gridView As GridView = gridListEditor.GridView
If gridView IsNot Nothing Then
For i As Integer = 0 To gridView.GroupSummary.Count - 1
Dim modelColumn As IModelColumnExtender = TryCast(CType(View.Model.Columns, IModelList(Of IModelColumn))(gridView.GroupSummary(i).FieldName), IModelColumnExtender)
If modelColumn IsNot Nothing Then
modelColumn.GroupFooterSummaryType = gridView.GroupSummary(i).SummaryType
End If
Next i
End If
End If
End If
End Sub
Protected Overloads Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
Dim displayFormat As String
Dim modelListView As IModelListViewExtender = TryCast(View.Model, IModelListViewExtender)
If modelListView IsNot Nothing AndAlso modelListView.IsGroupFooterVisible Then
Dim gridListEditor As GridListEditor = TryCast(View.Editor, GridListEditor)
If gridListEditor IsNot Nothing Then
Dim gridView As GridView = gridListEditor.GridView
gridView.OptionsView.GroupFooterShowMode = GroupFooterShowMode.VisibleAlways
For Each modelColumn As IModelColumn In View.Model.Columns
Dim modelColumnExtender As IModelColumnExtender = TryCast(modelColumn, IModelColumnExtender)
If modelColumnExtender IsNot Nothing AndAlso modelColumnExtender.GroupFooterSummaryType <> SummaryItemType.None Then
Dim gridColumn As GridColumn = gridView.Columns(modelColumn.ModelMember.MemberInfo.BindingName)
If modelColumn.DisplayFormat.ToString <> "" Then
If Mid(modelColumn.DisplayFormat, 1, 1) = "{" Then
displayFormat = modelColumn.DisplayFormat
gridView.GroupSummary.Add(modelColumnExtender.GroupFooterSummaryType, modelColumn.Id, gridColumn, displayFormat)
Else
displayFormat = String.Format("{{0:{0}}}", modelColumn.DisplayFormat)
gridView.GroupSummary.Add(modelColumnExtender.GroupFooterSummaryType, modelColumn.Id, gridColumn, displayFormat)
End If
Else
gridView.GroupSummary.Add(modelColumnExtender.GroupFooterSummaryType, modelColumn.Id, gridColumn)
End If
End If
Next modelColumn
End If
End If
End Sub
Protected Overloads Overrides Sub OnActivated()
MyBase.OnActivated()
AddHandler View.ModelSaved, AddressOf View_InfoSynchronized
End Sub
Protected Overloads Overrides Sub OnDeactivated()
RemoveHandler View.ModelSaved, AddressOf View_InfoSynchronized
MyBase.OnDeactivated()
End Sub
End Class
@@ -0,0 +1,32 @@
Partial Class WinNewObjectViewVC
<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()
components = New System.ComponentModel.Container()
End Sub
End Class
@@ -0,0 +1,81 @@
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.Win.SystemModule
Imports DevExpress.ExpressApp.SystemModule
Public Class WinNewObjectViewVC
Inherits WinNewObjectViewController
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
'Get the ShowNavigationItemController,
'then get its ShowNavigationItemAction and subscribe the SelectedItemChanged event
AddHandler Frame.GetController(Of ShowNavigationItemController)().ShowNavigationItemAction.SelectedItemChanged, AddressOf ShowNavigationItemAction_SelectedItemChanged
AddHandler CollectCreatableItemTypes, AddressOf MyController_CollectCreatableItemTypes
AddHandler CollectDescendantTypes, AddressOf MyController_CollectDescendantTypes
End Sub
Private Sub MyController_CollectDescendantTypes(ByVal sender As Object, _
ByVal e As DevExpress.ExpressApp.SystemModule.CollectTypesEventArgs)
CustomizeList(e.Types)
End Sub
Private Sub MyController_CollectCreatableItemTypes(ByVal sender As Object, _
ByVal e As DevExpress.ExpressApp.SystemModule.CollectTypesEventArgs)
CustomizeList(e.Types)
End Sub
Private Sub ShowNavigationItemAction_SelectedItemChanged(ByVal sender As Object, ByVal e As EventArgs)
Me.UpdateActionState()
End Sub
Public Sub CustomizeList(ByVal types As ICollection(Of Type))
'Get the ShowNavigationItemController, then get its ShowNavigationItemAction
Dim showNavigationItemAction As SingleChoiceAction = _
Frame.GetController(Of ShowNavigationItemController)().ShowNavigationItemAction
'Get the item selected in the navigation control
Dim selectedItem As ChoiceActionItem = showNavigationItemAction.SelectedItem
Dim currentGroup As ChoiceActionItem = Nothing
If Not selectedItem Is Nothing Then
'Get the selected item's parent group
currentGroup = selectedItem.ParentItem
Dim unusableTypes As List(Of Type) = New List(Of Type)()
'Collect the types that must be deleted
For Each type As Type In types
Dim deletionRequired As Boolean = True
For Each item As ChoiceActionItem In currentGroup.Items
Dim shortcut As ViewShortcut = TryCast(item.Data, ViewShortcut)
If shortcut.ViewId = Application.FindListViewId(type) Then
deletionRequired = False
End If
Next item
If deletionRequired = True Then
unusableTypes.Add(type)
End If
Next type
'Remove the collected types
For Each type As Type In unusableTypes
types.Remove(type)
Next type
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
RemoveHandler Frame.GetController(Of ShowNavigationItemController)().ShowNavigationItemAction.SelectedItemChanged, _
AddressOf ShowNavigationItemAction_SelectedItemChanged
RemoveHandler CollectCreatableItemTypes, AddressOf MyController_CollectCreatableItemTypes
RemoveHandler CollectDescendantTypes, AddressOf MyController_CollectDescendantTypes
End Sub
End Class
+48
View File
@@ -0,0 +1,48 @@
Partial Class ZIPHUVC
<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.aAddress_LoadZIPHUFromXLS = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aAddress_LoadZIPHUFromXLS
'
Me.aAddress_LoadZIPHUFromXLS.Caption = "aAddress_LoadZIPHUFromXLS"
Me.aAddress_LoadZIPHUFromXLS.ConfirmationMessage = Nothing
Me.aAddress_LoadZIPHUFromXLS.Id = "aAddress_LoadZIPHUFromXLS"
Me.aAddress_LoadZIPHUFromXLS.ImageName = Nothing
Me.aAddress_LoadZIPHUFromXLS.Shortcut = Nothing
Me.aAddress_LoadZIPHUFromXLS.Tag = Nothing
Me.aAddress_LoadZIPHUFromXLS.TargetObjectsCriteria = Nothing
Me.aAddress_LoadZIPHUFromXLS.TargetViewId = "ZIPHU_ListView"
Me.aAddress_LoadZIPHUFromXLS.ToolTip = Nothing
Me.aAddress_LoadZIPHUFromXLS.TypeOfView = Nothing
End Sub
Friend WithEvents aAddress_LoadZIPHUFromXLS As DevExpress.ExpressApp.Actions.SimpleAction
End Class
+126
View File
@@ -0,0 +1,126 @@
<?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="aAddress_LoadZIPHUFromXLS.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
+166
View File
@@ -0,0 +1,166 @@
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 System.Windows.Forms
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.BaseImpl
Imports System.Data.OleDb
Public Class ZIPHUVC
Inherits DevExpress.ExpressApp.ViewController
Dim _WaitFormClass As New WaitFormClass
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overloads Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "Address_DetailView" Then
For Each editor As PropertyEditor In (CType(View, DetailView)).GetItems(Of PropertyEditor)()
If editor.PropertyName = "ZipPostal" Then
AddHandler editor.ControlCreated, AddressOf editor_ControlCreated
Exit For
End If
Next editor
End If
End Sub
Private Sub editor_ControlCreated(ByVal sender As Object, ByVal e As EventArgs)
' You can access the corresponding property editor control by the following code:
Dim editorControl As Control = TryCast((CType(sender, PropertyEditor)).Control, Control)
AddHandler editorControl.HandleCreated, AddressOf editorControl_HandleCreated
Dim _ZipPostal As DevExpress.XtraEditors.TextEdit = TryCast(editorControl, DevExpress.XtraEditors.TextEdit)
If _ZipPostal IsNot Nothing Then
AddHandler _ZipPostal.TextChanged, AddressOf ZipPostal_TextChanged
End If
End Sub
Private Sub editorControl_HandleCreated(ByVal sender As Object, ByVal e As EventArgs)
' Sometimes it is necessary to access editor's control after it is visible (its handle is created).
RemoveHandler (CType(sender, Control)).HandleCreated, AddressOf editorControl_HandleCreated
End Sub
Private Sub ZipPostal_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _StringEdit As DevExpress.ExpressApp.Win.Editors.StringEdit = TryCast(sender, DevExpress.ExpressApp.Win.Editors.StringEdit)
If _StringEdit.Text.Length = 4 Then
Dim _ZIPHU As ZIPHU = _ocur.FindObject(Of ZIPHU)(CriteriaOperator.Parse("Zip=?", _StringEdit.Text))
If _ZIPHU IsNot Nothing Then
Dim _Address As Address = TryCast(View.SelectedObjects(0), Address)
_Address.ZipPostal = _StringEdit.Text
_Address.City = _ZIPHU.City
_Address.StateProvince = _ZIPHU.County
End If
End If
End Sub
Private Sub aAddress_LoadZIPHUFromXLS_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aAddress_LoadZIPHUFromXLS.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ZIP As New ArrayList
Dim _City As New ArrayList
Dim _Country As New ArrayList
Dim _OpenFileDialog As New OpenFileDialog
_OpenFileDialog.Filter = "XLS file (.xls)|*.xls|XLSX file (.xlsx)|*.xlsx|All Files (*.*)|*.*"
If _OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim _xlsFile As String = _OpenFileDialog.FileName
Dim _cs As String = "Provider=Microsoft.ACE.OLEDB.12.0;"
_cs += "Data Source=" & _xlsFile.ToString & ";"
_cs += "Extended Properties=""Excel 12.0 Xml;HDR=YES;"""
Dim conn As New OleDbConnection(_cs)
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
Dim dr1 As OleDbDataReader
Dim mSQL As String
Dim _UpdatedCount As Long = 0
Try
mSQL = "select * from [Munka1$]"
cmd.CommandTimeout = 60
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = mSQL
conn.Open()
If conn.State = ConnectionState.Open Then
Dim _Count As Long = 0
dr1 = cmd.ExecuteReader(CommandBehavior.SingleResult)
While dr1.Read
If dr1(0).ToString <> "" And dr1(0).ToString <> "ZIP" Then
_Count += 1
End If
End While
dr1.Close()
dr = cmd.ExecuteReader(CommandBehavior.SingleResult)
_WaitFormClass.Initwork(1, 1, _Count)
While dr.Read
If dr(0).ToString <> "" And dr(0).ToString <> "ZIP" Then
_ZIP.Add(dr(0).ToString)
_City.Add(dr(1).ToString)
_Country.Add(dr(2).ToString)
_WaitFormClass.DoWork
System.Windows.Forms.Application.DoEvents()
End If
End While
dr.Close()
End If
conn.Close()
Catch ex As Exception
MsgBox(ex.Message)
conn.Close()
End Try
_WaitFormClass.Finalwork
End If
Dim _LineIndex As Long = 0
For Each _ZIP_String As String In _ZIP
System.Windows.Forms.Application.DoEvents()
Dim _ZIPHU As ZIPHU = _onew.FindObject(Of ZIPHU)(CriteriaOperator.Parse("Zip=? AND City=? AND County=?", _ZIP(_LineIndex), _City(_LineIndex), _Country(_LineIndex)))
If _ZIPHU Is Nothing Then
With _ZIPHU
.ID = _LineIndex + 1
.Zip = _ZIP(_LineIndex)
.City = _City(_LineIndex)
.County = _Country(_LineIndex)
End With
End If
Dim _Country_O As Country = _onew.FindObject(Of Country)(CriteriaOperator.Parse("Name=?", _Country(_LineIndex)), True)
If _Country_O Is Nothing Then
_Country_O = New Country(_onew.Session)
With _Country_O
.Name = _Country(_LineIndex)
End With
End If
_LineIndex += 1
Next
_WaitFormClass.Finalwork
_onew.CommitChanges()
End Sub
End Class