First create solution
This commit is contained in:
+123
@@ -0,0 +1,123 @@
|
||||
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
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
|
||||
'<EditorStateRule("Disable all properties", "RegistryHeader;BruttoAmount;Note;VAT", ViewType.DetailView, Criteria:="RegistryHeader.BruttoAmountRemaining = 0", EditorState:=DevExpress.ExpressApp.ConditionalEditorState.EditorState.Disabled)> _
|
||||
|
||||
<Appearance("Disable actions if currentstep is not eCheckVAT", AppearanceItemType:="Action", Criteria:="not (RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType in (1,5))", TargetItems:="Save;SaveAndNew;SaveAndClose;Delete", Enabled:=False, Context:="Any")> _
|
||||
<Appearance("Disable all properties", TargetItems:="RegistryHeader;BruttoAmount;Note;VAT", Criteria:="RegistryHeader.BruttoAmountRemaining = 0", Enabled:=False, Context:="DetailView")> _
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem(False), CreatableItem(False)> _
|
||||
Public Class RegistryRowsFinancial '-- Iktatórendszer sorai, ha p.ü. kapcsolat van.
|
||||
Inherits BaseObject
|
||||
Private _RegistryHeader As RegistryHeader
|
||||
Private _BruttoAmount As Double 'Bruttó összeg
|
||||
Private _Note As String 'Megjegyzés
|
||||
Private _VAT As VAT 'ÁFA kód
|
||||
Private _DateVAT As Date
|
||||
Private _F_ReadyforBookEntryRows As Boolean
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
Public Overrides Sub AfterConstruction()
|
||||
MyBase.AfterConstruction()
|
||||
If Me.RegistryHeader IsNot Nothing Then
|
||||
|
||||
End If
|
||||
F_ReadyforBookEntryRows = False
|
||||
End Sub
|
||||
<Association("RegistryHeader-RegistryRowsFinancial", GetType(RegistryHeader))> _
|
||||
Property RegistryHeader() As RegistryHeader
|
||||
Get
|
||||
Return _RegistryHeader
|
||||
'Me.RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType = eStepFinancialType.eCheckVAT
|
||||
End Get
|
||||
Set(ByVal value As RegistryHeader)
|
||||
SetPropertyValue("RegistryHeader", _RegistryHeader, value)
|
||||
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And value IsNot Nothing Then
|
||||
If IsDate(Me.RegistryHeader.F_DateVAT) Then
|
||||
DateVAT = Me.RegistryHeader.F_DateExecution
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
<RuleRequiredField("RegistryRows-BruttoAmount", DefaultContexts.Save)> _
|
||||
Property BruttoAmount As Double
|
||||
Get
|
||||
Return _BruttoAmount
|
||||
End Get
|
||||
Set(ByVal value As Double)
|
||||
SetPropertyValue("BruttoAmount", _BruttoAmount, value)
|
||||
End Set
|
||||
End Property
|
||||
<Size(-1)> _
|
||||
Property Note As String
|
||||
Get
|
||||
Return _Note
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
|
||||
End Set
|
||||
End Property
|
||||
<ImmediatePostData(True)> _
|
||||
<RuleRequiredField("RegistryRowsFinancial.VAT", DefaultContexts.Save)> _
|
||||
Property VAT As VAT
|
||||
Get
|
||||
Return _VAT
|
||||
End Get
|
||||
Set(ByVal value As VAT)
|
||||
SetPropertyValue("VAT", _VAT, value)
|
||||
End Set
|
||||
End Property
|
||||
ReadOnly Property VATAmount As Double
|
||||
Get
|
||||
If Me.VAT IsNot Nothing Then
|
||||
Dim _VATAmount As Double = Me.BruttoAmount / (100 + Me.VAT.KeyValuePercent) * Me.VAT.KeyValuePercent
|
||||
Return Math.Round(_VATAmount, 0, MidpointRounding.AwayFromZero)
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
ReadOnly Property NettoAmount As Double
|
||||
Get
|
||||
If Me.VAT IsNot Nothing Then
|
||||
Return Me.BruttoAmount - Me.VATAmount
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Property DateVAT As Date
|
||||
Get
|
||||
Return _DateVAT
|
||||
End Get
|
||||
Set(ByVal value As Date)
|
||||
SetPropertyValue("DateVAT", _DateVAT, value)
|
||||
If Not Session.IsObjectsSaving And Not Session.IsObjectsLoading And Me.RegistryHeader IsNot Nothing Then
|
||||
If Not Me.RegistryHeader.F_DateVAT = value Then
|
||||
Me.RegistryHeader.F_DateVAT = value
|
||||
' Me.RegistryHeader.Save()
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Property F_ReadyforBookEntryRows As Boolean
|
||||
Get
|
||||
Return _F_ReadyforBookEntryRows
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
SetPropertyValue("F_ReadyforBookEntryRows", _F_ReadyforBookEntryRows, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
Partial Class RegistryRowsFinancialVC
|
||||
|
||||
<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
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
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
|
||||
|
||||
Public Class RegistryRowsFinancialVC
|
||||
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 = "RegistryRowsFinancial_DetailView" Then
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", False)
|
||||
End If
|
||||
If View.Id = "RegistryHeader_RegistryRowsFinancial_ListView" Then
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", False)
|
||||
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
|
||||
|
||||
'If TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject IsNot Nothing Then
|
||||
' Dim _RegistryHeader As RegistryHeader = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject
|
||||
' If _RegistryHeader IsNot Nothing Then
|
||||
' Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
' 'AddHandler _RegistryHeader.Changed, AddressOf RegistryHeader_RegistryRowsFinancial_ListView_MasterObjectChanged
|
||||
' AddHandler View.ObjectSpace.ObjectChanged, AddressOf _RegistryRowsFinancial_ListView_ObjectChanged
|
||||
' AddHandler View.ObjectSpace.ObjectSaved, AddressOf _RegistryRowsFinancial_ListView_ObjectSaved
|
||||
' AddHandler View.ObjectSpace.ObjectReloaded, AddressOf _RegistryRowsFinancial_ListView_ObjectReloaded
|
||||
' AddHandler View.ObjectSpace.ObjectDeleted, AddressOf _RegistryRowsFinancial_ListView_ObjectDeleted
|
||||
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If View.Id = "RegistryRowsFinancial_DetailView" Then
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", True)
|
||||
End If
|
||||
If View.Id = "RegistryHeader_RegistryRowsFinancial_ListView" Then
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", True)
|
||||
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", True)
|
||||
|
||||
'If TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject IsNot Nothing Then
|
||||
' Dim _RegistryHeader As RegistryHeader = TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject
|
||||
' If _RegistryHeader IsNot Nothing Then
|
||||
' RemoveHandler _RegistryHeader.Changed, AddressOf RegistryHeader_RegistryRowsFinancial_ListView_MasterObjectChanged
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RegistryHeader_RegistryRowsFinancial_ListView_MasterObjectChanged(sender As Object, e As DevExpress.Xpo.ObjectChangeEventArgs)
|
||||
Dim _RegistryHeader As RegistryHeader = TryCast(e.Object, RegistryHeader)
|
||||
Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
End Sub
|
||||
|
||||
Private Sub _RegistryRowsFinancial_ListView_ObjectChanged(sender As Object, e As ObjectChangedEventArgs)
|
||||
Dim _RegistryHeader As RegistryHeader = TryCast(e.Object, RegistryHeader)
|
||||
Dim _RegistryRowsFinancial As RegistryRowsFinancial = TryCast(e.Object, RegistryRowsFinancial)
|
||||
If _RegistryHeader IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
If _RegistryRowsFinancial IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryRowsFinancial.RegistryHeader)
|
||||
End Sub
|
||||
Private Sub _RegistryRowsFinancial_ListView_ObjectReloaded(sender As Object, e As ObjectManipulatingEventArgs)
|
||||
Dim _RegistryHeader As RegistryHeader = TryCast(e.Object, RegistryHeader)
|
||||
Dim _RegistryRowsFinancial As RegistryRowsFinancial = TryCast(e.Object, RegistryRowsFinancial)
|
||||
If _RegistryHeader IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
If _RegistryRowsFinancial IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryRowsFinancial.RegistryHeader)
|
||||
End Sub
|
||||
Private Sub _RegistryRowsFinancial_ListView_ObjectSaved(sender As Object, e As ObjectManipulatingEventArgs)
|
||||
Dim _RegistryHeader As RegistryHeader = TryCast(e.Object, RegistryHeader)
|
||||
Dim _RegistryRowsFinancial As RegistryRowsFinancial = TryCast(e.Object, RegistryRowsFinancial)
|
||||
If _RegistryHeader IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
If _RegistryRowsFinancial IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryRowsFinancial.RegistryHeader)
|
||||
End Sub
|
||||
Private Sub _RegistryRowsFinancial_ListView_ObjectDeleted(sender As Object, e As ObjectsManipulatingEventArgs)
|
||||
If e.Objects.Count <= 0 Then Exit Sub
|
||||
Dim _Object As Object = Nothing
|
||||
For Each _Object In e.Objects
|
||||
|
||||
Next
|
||||
Dim _RegistryHeader As RegistryHeader = TryCast(_Object, RegistryHeader)
|
||||
Dim _RegistryRowsFinancial As RegistryRowsFinancial = TryCast(_Object, RegistryRowsFinancial)
|
||||
If _RegistryHeader IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader)
|
||||
If _RegistryRowsFinancial IsNot Nothing Then Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryRowsFinancial.RegistryHeader)
|
||||
End Sub
|
||||
Private Sub Action_NEW_DELETE_Hide_RegistryHeader_RegistryRowsFinancial(_RegistryHeader As RegistryHeader)
|
||||
If _RegistryHeader Is Nothing Then Exit Sub
|
||||
If _RegistryHeader.CurrentWorkflowSystemSteps Is Nothing Then Exit Sub
|
||||
'// Mikor NE látszódjon a NEW action
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", False)
|
||||
If _RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType = eStepFinancialType.eCheckVAT Or _
|
||||
_RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType = eStepFinancialType.eCheckVATPlusControlling Then
|
||||
If _RegistryHeader.IsEditable = True Then
|
||||
If _RegistryHeader.BruttoAmountRemaining <> 0.0 Then
|
||||
Frame.GetController(Of NewObjectViewController).Active.SetItemValue("", True)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'// Mikor NE látszódjon a törlés gomb
|
||||
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", False)
|
||||
If _RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType = eStepFinancialType.eCheckVAT Or _
|
||||
_RegistryHeader.CurrentWorkflowSystemSteps.StepFinancialType = eStepFinancialType.eCheckVATPlusControlling Then
|
||||
If _RegistryHeader.IsEditable = True Then
|
||||
Frame.GetController(Of DeleteObjectsViewController).Active.SetItemValue("", True)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user