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
@@ -0,0 +1,247 @@
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
<DefaultClassOptions()> _
<CreatableItem(False)> _
<NavigationItem(False)> _
<Appearance("OperationalLog - Disable UserCreated all time", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
<Appearance("OperationalLog - Disable ObjectCreated all time", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
<Appearance("OperationalLog - Disable DocumentNumber all time", AppearanceItemType.ViewItem, "1=1", TargetItems:="DocumentNumber", Enabled:=False)> _
<Appearance("OperationalLog - Disable Save,SaveAndNew", AppearanceItemType.Action, "1=1", TargetItems:="Save;SaveAndNew", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class OperationalLog
Inherits BaseObject
Private _CustomersFrom As CustomersFrom
Private _Customers As Customers
Private _DocumentNumber As String 'Bejegyzés sorszáma
Private _WorkPlace As WorkPlace 'Munkahely
Private _WorkState As WorkState 'Munkafolyamat
Private _OperationalLogParameters As OperationalLogParameters
Private _Description As String 'Esemény leírása
Private _WorkDescription As String 'Elvégzett munka leírása
Private _WorkUsedMaterialDescription As String 'Felhasznált anyag leírása (nem kötelezõ WEB)
Private _WorkDescriptionOther As String 'Egyéb az alvállalkozó által megadott megjegyzés (nem kötelezõ WEB)
Private _ObjectCreated As Date
Private _UserCreated As User
Dim _LoggedUser As User
Dim _LoggedContacts As Contacts
Dim _LoggedSubcontractor As Subcontractor
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
WorkState = Session.FindObject(Of WorkState)(CriteriaOperator.Parse("IsOperationalLog = True"))
_LoggedUser = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
_LoggedContacts = Session.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _LoggedUser))
_LoggedSubcontractor = Session.FindObject(Of Subcontractor)(CriteriaOperator.Parse("Customers=?", _LoggedContacts.Customers))
End Sub
Protected Overrides Sub OnSaving()
MyBase.OnSaving()
If Session.IsNewObject(Me) Then
ObjectCreated = GetSQLTime(Session)
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
End If
If String.IsNullOrEmpty(DocumentNumber) Then
DocumentNumber = OperationalLogParameters.NumberGenerator.GetNewNumber(OperationalLogParameters.NumberGenerator)
End If
End Sub
<RuleRequiredField("OperationalLog - CustomersFrom", DefaultContexts.Save)> _
<ImmediatePostData()> _
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
<RuleRequiredField("OperationalLog - Customers", DefaultContexts.Save)>
<ImmediatePostData()>
Property Customers As Customers
Get
Return _Customers
End Get
Set(value As Customers)
SetPropertyValue("Customers", _Customers, value)
End Set
End Property
Property DocumentNumber As String
Get
Return _DocumentNumber
End Get
Set(value As String)
SetPropertyValue("DocumentNumber", _DocumentNumber, value)
End Set
End Property
<RuleRequiredField("OperationalLog - WorkPlace", DefaultContexts.Save)>
<ImmediatePostData(True), DataSourceCriteria("CustomersFrom='@This.CustomersFrom' and Customers='@This.Customers'")>
<DataSourceProperty("WorkPlace_Collection")>
Property WorkPlace As WorkPlace
Get
Return _WorkPlace
End Get
Set(value As WorkPlace)
SetPropertyValue("WorkPlace", _WorkPlace, value)
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And CustomersFrom IsNot Nothing Then
OperationalLogParameters = Session.FindObject(Of OperationalLogParameters)(CriteriaOperator.Parse("WorkPlace=? AND CustomersFrom=?", value, CustomersFrom))
End If
End Set
End Property
Property WorkState As WorkState
Get
Return _WorkState
End Get
Set(value As WorkState)
SetPropertyValue("WorkState", _WorkState, value)
End Set
End Property
<RuleRequiredField("OperationalLog - OperationalLogParameters", DefaultContexts.Save)> _
<VisibleInListView(False)> _
<VisibleInDetailView(False)> _
Property OperationalLogParameters As OperationalLogParameters
Get
Return _OperationalLogParameters
End Get
Set(value As OperationalLogParameters)
SetPropertyValue("OperationalLogParameters", _OperationalLogParameters, value)
End Set
End Property
<Size(-1)> _
<RuleRequiredField("OperationalLog - Description", DefaultContexts.Save)> _
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
<Size(-1)> _
Property WorkDescription As String
Get
Return _WorkDescription
End Get
Set(value As String)
SetPropertyValue("WorkDescription", _WorkDescription, value)
End Set
End Property
<Size(-1)> _
Property WorkUsedMaterialDescription As String
Get
Return _WorkUsedMaterialDescription
End Get
Set(value As String)
SetPropertyValue("WorkUsedMaterialDescription", _WorkUsedMaterialDescription, value)
End Set
End Property
<Size(-1)> _
Property WorkDescriptionOther As String
Get
Return _WorkDescriptionOther
End Get
Set(value As String)
SetPropertyValue("WorkDescriptionOther", _WorkDescriptionOther, value)
End Set
End Property
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
<VisibleInListView(False)> _
<Association("OperationalLog-OperationalLogDocuments", GetType(OperationalLogDocuments))> _
ReadOnly Property OperationalLogDocuments As XPCollection(Of OperationalLogDocuments)
Get
Return GetCollection(Of OperationalLogDocuments)("OperationalLogDocuments")
End Get
End Property
<VisibleInListView(False), VisibleInDetailView(False), VisibleInLookupListView(False)> _
ReadOnly Property FirstDocument As OperationalLogDocuments
Get
Dim _FirstDocument As OperationalLogDocuments = Nothing
For Each _FirstDocument In Me.OperationalLogDocuments
Exit For
Next
Return _FirstDocument
End Get
End Property
<VisibleInListView(False)> _
Private ReadOnly Property WorkPlace_Collection As XPCollection(Of WorkPlace)
Get
If Me.CustomersFrom Is Nothing Then
Return Nothing
End If
Dim _WorkPlace_Collection_All As New XPCollection(Of WorkPlace)(Session, CriteriaOperator.Parse("CustomersFrom.Oid=?", Me.CustomersFrom.Oid))
Dim _WorkPlace_Collection As New XPCollection(Of WorkPlace)(Session, CriteriaOperator.Parse("1=2"))
Dim _WorkPlace As WorkPlace
Dim _WorkPlace_ArrayList As New ArrayList
Dim _SubcontractorCustomers_Collection As New XPCollection(Of SubcontractorCustomers)(Session, CriteriaOperator.Parse("Subcontractor.Oid=?", _LoggedSubcontractor.Oid))
Dim _SubcontractorCustomers As SubcontractorCustomers
'_SubcontractorCustomers.Customers.Contacts
_WorkPlace_ArrayList.Clear()
For Each _WorkPlace In _WorkPlace_Collection_All
For Each _SubcontractorCustomers In _SubcontractorCustomers_Collection
If _SubcontractorCustomers.Workplace IsNot Nothing Then
If _WorkPlace.Oid = _SubcontractorCustomers.Workplace.Oid Then
If _WorkPlace_ArrayList.Contains(_WorkPlace) Then
Else
_WorkPlace_ArrayList.Add(_WorkPlace)
End If
End If
End If
Next
Next
For Each _WorkPlace In _WorkPlace_ArrayList
_WorkPlace_Collection.Add(_WorkPlace)
Next
Return _WorkPlace_Collection
End Get
End Property
<VisibleInListView(False)> _
Private ReadOnly Property Customers_Collection As XPCollection(Of Customers)
Get
If _LoggedSubcontractor IsNot Nothing Then
Dim _Customers_Collection As New XPCollection(Of Customers)(Session, CriteriaOperator.Parse("1=2"))
Dim _SubcontractorCustomers_Collection As New XPCollection(Of SubcontractorCustomers)(Session, CriteriaOperator.Parse("Subcontractor.Oid=?", _LoggedSubcontractor.Oid))
For Each _SubcontractorCustomers As SubcontractorCustomers In _SubcontractorCustomers_Collection
_Customers_Collection.Add(_SubcontractorCustomers.Customers)
Next
Return _Customers_Collection
Else
Return Nothing
End If
End Get
End Property
End Class
@@ -0,0 +1,28 @@
Imports DevExpress.Xpo
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
Public Class OperationalLogDocuments
Inherits FileAttachmentBase
Private _OperationalLog As OperationalLog
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("OperationalLog-OperationalLogDocuments", GetType(OperationalLog))>
Property OperationalLog As OperationalLog
Get
Return _OperationalLog
End Get
Set(value As OperationalLog)
SetPropertyValue("OperationalLog", _OperationalLog, value)
End Set
End Property
End Class
@@ -0,0 +1,73 @@
Imports DevExpress.Xpo
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()>
<CreatableItem(False)>
<NavigationItem(False)>
Public Class OperationalLogParameters 'Rendszer üzemeltetési napló paraméter
Inherits BaseObject
Private _CustomersFrom As CustomersFrom
Private _NumberGenerator As NumberGenerator
Private _WorkPlace As WorkPlace 'Munkahely
Private _ReportData As ReportData
Private _OperationalLogType As eOperationalLogType
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
OperationalLogType = eOperationalLogType.General
End Sub
<RuleRequiredField("OperationalLogParameters - CustomersFrom", DefaultContexts.Save)>
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
<RuleRequiredField("OperationalLogParameters - NumberGenerator", DefaultContexts.Save)>
Property NumberGenerator As NumberGenerator
Get
Return _NumberGenerator
End Get
Set(value As NumberGenerator)
SetPropertyValue("NumberGenerator", _NumberGenerator, value)
End Set
End Property
<ImmediatePostData(True), DataSourceCriteria("CustomersFrom='@This.CustomersFrom'")>
<RuleRequiredField("OperationalLogParameters - WorkPlace - RequiredField", DefaultContexts.Save)>
<RuleUniqueValue("OperationalLogParameters - WorkPlace - UniqueValue", DefaultContexts.Save)>
Property WorkPlace As WorkPlace
Get
Return _WorkPlace
End Get
Set(value As WorkPlace)
SetPropertyValue("WorkPlace", _WorkPlace, value)
End Set
End Property
<RuleRequiredField("OperationalLogParameters - ReportData", DefaultContexts.Save)>
Property ReportData As ReportData
Get
Return _ReportData
End Get
Set(value As ReportData)
SetPropertyValue("ReportData", _ReportData, value)
End Set
End Property
Property OperationalLogType As eOperationalLogType
Get
Return _OperationalLogType
End Get
Set(value As eOperationalLogType)
SetPropertyValue("OperationalLogType", _OperationalLogType, value)
End Set
End Property
End Class
@@ -0,0 +1,51 @@
Partial Class OperationalLog_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.aOperationLog_CreateQuestion = New DevExpress.ExpressApp.Actions.SimpleAction(Me.components)
'
'aOperationLog_CreateQuestion
'
Me.aOperationLog_CreateQuestion.Caption = "aOperationLog_CreateQuestion"
Me.aOperationLog_CreateQuestion.ConfirmationMessage = Nothing
Me.aOperationLog_CreateQuestion.Id = "aOperationLog_CreateQuestion"
Me.aOperationLog_CreateQuestion.ImageName = Nothing
Me.aOperationLog_CreateQuestion.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject
Me.aOperationLog_CreateQuestion.Shortcut = Nothing
Me.aOperationLog_CreateQuestion.Tag = Nothing
Me.aOperationLog_CreateQuestion.TargetObjectsCriteria = Nothing
Me.aOperationLog_CreateQuestion.TargetObjectType = GetType(Nuvolar.[Module].OperationalLog)
Me.aOperationLog_CreateQuestion.TargetViewId = Nothing
Me.aOperationLog_CreateQuestion.TargetViewType = DevExpress.ExpressApp.ViewType.ListView
Me.aOperationLog_CreateQuestion.ToolTip = Nothing
Me.aOperationLog_CreateQuestion.TypeOfView = GetType(DevExpress.ExpressApp.ListView)
End Sub
Friend WithEvents aOperationLog_CreateQuestion 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="aOperationLog_CreateQuestion.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</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,130 @@
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.CloneObject
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.Persistent.BaseImpl
Public Class OperationalLog_VC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "OperationalLog_ListView_Subconractor" Or
View.Id = "OperationalLog_ListView_Subconractor_HFR" Then
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _User As User = _ocur.GetObjectByKey(Of User)(_ocur.GetKeyValue(SecuritySystem.CurrentUser))
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
Dim _Subcontractor As Subcontractor = _ocur.FindObject(Of Subcontractor)(CriteriaOperator.Parse("Customers=?", _Contacts.Customers))
Dim _OperationalLog_CollectionSource As CollectionSource = TryCast(View, ListView).CollectionSource
Dim _Criteria As String = "WorkPlace.Oid in('"
If _Subcontractor.SubcontractorCustomers.Count > 0 Then
For Each _SubcontractorCustomers As SubcontractorCustomers In _Subcontractor.SubcontractorCustomers
If _SubcontractorCustomers.Workplace IsNot Nothing Then
_Criteria += _SubcontractorCustomers.Workplace.Oid.ToString + "','"
End If
Next
Else
_Criteria = "1=2"
End If
If _Criteria.Length > 18 Then
_Criteria = _Criteria.Remove(_Criteria.Length - 2, 2)
_Criteria += ")"
Else
_Criteria = "1=2"
End If
_OperationalLog_CollectionSource.BeginUpdateCriteria()
_OperationalLog_CollectionSource.Criteria("First") = CriteriaOperator.Parse(_Criteria)
_OperationalLog_CollectionSource.EndUpdateCriteria()
End If
If View.Id = "OperationalLog_ListView_Support" Then
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _User As User = _ocur.GetObjectByKey(Of User)(_ocur.GetKeyValue(SecuritySystem.CurrentUser))
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
Dim _Workplace As WorkPlace = _ocur.FindObject(Of WorkPlace)(CriteriaOperator.Parse("Customers=? and OperationalLogType='General'", _Contacts.Customers))
Dim _OperationalLog_CollectionSource As CollectionSource = TryCast(View, ListView).CollectionSource
Dim _Criteria As String = ""
If _Workplace IsNot Nothing Then
_Criteria = "WorkPlace.Oid='" + _Workplace.Oid.ToString + "'"
Else
_Criteria = "1=2"
End If
_OperationalLog_CollectionSource.BeginUpdateCriteria()
_OperationalLog_CollectionSource.Criteria("First") = CriteriaOperator.Parse(_Criteria)
_OperationalLog_CollectionSource.EndUpdateCriteria()
End If
If View.Id = "OperationalLog_ListView_Support_HFR" Then
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _User As User = _ocur.GetObjectByKey(Of User)(_ocur.GetKeyValue(SecuritySystem.CurrentUser))
Dim _Contacts As Contacts = _ocur.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
Dim _Workplace As WorkPlace = _ocur.FindObject(Of WorkPlace)(CriteriaOperator.Parse("Customers=? and OperationalLogType='HFR'", _Contacts.Customers))
Dim _OperationalLog_CollectionSource As CollectionSource = TryCast(View, ListView).CollectionSource
Dim _Criteria As String = ""
If _Workplace IsNot Nothing Then
_Criteria = "WorkPlace.Oid='" + _Workplace.Oid.ToString + "'"
Else
_Criteria = "1=2"
End If
_OperationalLog_CollectionSource.BeginUpdateCriteria()
_OperationalLog_CollectionSource.Criteria("First") = CriteriaOperator.Parse(_Criteria)
_OperationalLog_CollectionSource.EndUpdateCriteria()
End If
If View.Id = "OperationalLog_OperationalLogDocuments_ListView" Then
Frame.GetController(Of CloneObjectViewController)().Active.SetItemValue("", False)
Frame.GetController(Of ListViewProcessCurrentObjectController)().Active.SetItemValue("", False)
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", False)
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "OperationalLog_ListView_Subconractor" Then
End If
If View.Id = "OperationalLog_OperationalLogDocuments_ListView" Then
Frame.GetController(Of CloneObjectViewController)().Active.SetItemValue("", True)
Frame.GetController(Of ListViewProcessCurrentObjectController)().Active.SetItemValue("", True)
Frame.GetController(Of LinkUnlinkController)().Active.SetItemValue("", True)
End If
End Sub
Private Sub aOperationLog_CreateQuestion_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aOperationLog_CreateQuestion.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _User As DevExpress.Persistent.BaseImpl.User = _onew.GetObjectByKey(Of DevExpress.Persistent.BaseImpl.User)(_onew.Session.GetKeyValue(SecuritySystem.CurrentUser))
Dim _Question As New Question(_onew.Session)
With _Question
.AliasUser = _User
End With
e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "Question_DetailView_User", True, _Question)
End Sub
End Class
@@ -0,0 +1,141 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
<NonPersistent()> _
Public Class OperationLog_ViewLogs_PopUp
Inherits BaseObject
Private _WorkPlace As WorkPlace
Private _FromDate As Date
Private _FromDateHour As Long
Private _FromDateMin As Long
Private _ToDate As Date
Private _ToDateHour As Long
Private _ToDateMin As Long
Private _CollectionSource As CollectionSource
Private _CustomersFrom As CustomersFrom
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
ToDate = GetSQLTime(Session).Date
ToDateHour = GetSQLTime(Session).Hour
ToDateMin = GetSQLTime(Session).Minute
FromDate = ToDate.AddDays(-7)
FromDateHour = ToDateHour
FromDateMin = ToDateMin
End Sub
<ImmediatePostData(True), DataSourceProperty("WorkPlace_Collection")>
Property WorkPlace As WorkPlace
Get
Return _WorkPlace
End Get
Set(value As WorkPlace)
SetPropertyValue("WorkPlace", _WorkPlace, value)
End Set
End Property
Property FromDate As Date
Get
Return _FromDate
End Get
Set(value As Date)
SetPropertyValue("FromDate", _FromDate, value)
End Set
End Property
<RuleRange("OperationLog_ViewLogs_PopUp - FromDateHour", DefaultContexts.Save, 0, 23)> _
Property FromDateHour As Long
Get
Return _FromDateHour
End Get
Set(value As Long)
SetPropertyValue("FromDateHour", _FromDateHour, value)
End Set
End Property
<RuleRange("OperationLog_ViewLogs_PopUp - FromDateMin", DefaultContexts.Save, 0, 59)> _
Property FromDateMin As Long
Get
Return _FromDateMin
End Get
Set(value As Long)
SetPropertyValue("FromDateMin", _FromDateMin, value)
End Set
End Property
Property ToDate As Date
Get
Return _ToDate
End Get
Set(value As Date)
SetPropertyValue("ToDate", _ToDate, value)
End Set
End Property
<RuleRange("OperationLog_ViewLogs_PopUp - ToDateHour", DefaultContexts.Save, 0, 23)> _
Property ToDateHour As Long
Get
Return _ToDateHour
End Get
Set(value As Long)
SetPropertyValue("ToDateHour", _ToDateHour, value)
End Set
End Property
<RuleRange("OperationLog_ViewLogs_PopUp - ToDateMin", DefaultContexts.Save, 0, 59)> _
Property ToDateMin As Long
Get
Return _ToDateMin
End Get
Set(value As Long)
SetPropertyValue("ToDateMin", _ToDateMin, value)
End Set
End Property
<VisibleInListView(False)> _
<VisibleInDetailView(False)> _
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
<VisibleInListView(False)> _
<VisibleInDetailView(False)> _
Private ReadOnly Property WorkPlace_Collection As XPCollection(Of WorkPlace)
Get
Dim _User As User = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
Dim _Contacts As Contacts = Session.FindObject(Of Contacts)(CriteriaOperator.Parse("User=?", _User))
Dim _Subcontractor As Subcontractor = Session.FindObject(Of Subcontractor)(CriteriaOperator.Parse("Customers=?", _Contacts.Customers))
Dim _SubcontractorCustomers As SubcontractorCustomers
Dim _Criteria As String = "1=2"
If _Subcontractor IsNot Nothing Then
If _Subcontractor.SubcontractorCustomers.Count > 0 Then
For Each _SubcontractorCustomers In _Subcontractor.SubcontractorCustomers
If _Criteria = "1=2" Then
_Criteria = "Customers.Oid in ('" & _SubcontractorCustomers.Customers.Oid.ToString & "'"
Else
_Criteria += ",'" & _SubcontractorCustomers.Customers.Oid.ToString & "'"
End If
Next
End If
If _Criteria <> "1=2" Then _Criteria += ")"
Else
_Criteria = "Customers.Oid='" + _Contacts.Customers.Oid.ToString + "' AND CustomersFrom.Oid='" + CustomersFrom.Oid.ToString + "'"
End If
Dim _WorkPlace_Collection As New XPCollection(Of WorkPlace)(Session, CriteriaOperator.Parse(_Criteria))
Return _WorkPlace_Collection
End Get
End Property
End Class
@@ -0,0 +1,5 @@
Public Enum eOperationalLogType
General = 0
HFR = 1
End Enum