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 System.Data.SqlClient Imports DevExpress.ExpressApp.ConditionalAppearance Imports System.Linq Imports System.Linq.Expressions '-- POPUP-HOZ osztályok------------------------------------------------------------- _ _ _ _ _ _ Public Class InvoiceAdvancePopup 'Előlegszámla készítő, ez csinál InvoiceHeader és InvoiceRows-t Inherits BaseObject Private _CustomersFrom As CustomersFrom ' -- Saját cég Private _Customers As Customers ' -- Ügyfél Private _CurrencyRate As Double ' -- Árfolyam Private _CurrencyName As CurrencyName ' -- Deviza Private _Description As String ' -- Leírás Private _DateExecution As Date ' -- Teljesítés dátuma Private _DatePayment As Date ' -- Fizetési határidő Private _PaymentOption As PaymentOption ' -- Fizetési opció Private _AmountHUF As Double ' -- Összeg HUF (Bruttó!!!) Private _AmountDEV As Double ' -- Összeg DEV (Bruttó!!!) Private _Controlling As Controlling ' -- Kontroll szám Private _CostHolder As CostHolder ' -- Költségviselő Private _CostPlace As CostPlace ' -- Költséghely Private _UniqueObjects As UniqueObjects Private _JobNumberObjects As JobNumberObjects Private _VAT As VAT ' -- ÁFA kód Private _BankInformation As BankInformation ' -- Bankszámlaszám Private _InvoiceType As InvoiceType ' -- Számla típusa Private _IsEditable As Boolean Public Sub New(ByVal session As Session) MyBase.New(session) End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() VAT = Session.FindObject(Of VAT)(CriteriaOperator.Parse("DefaultForBusinnes=True")) CurrencyName = Session.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'")) CurrencyRate = 1 IsEditable = True End Sub _ Property CustomersFrom As CustomersFrom Get Return _CustomersFrom End Get Set(ByVal value As CustomersFrom) SetPropertyValue("CustomersFrom", _CustomersFrom, value) End Set End Property _ Property Customers As Customers Get Return _Customers End Get Set(ByVal value As Customers) SetPropertyValue("Customers", _Customers, value) End Set End Property Property CurrencyRate As Double Get Return _CurrencyRate End Get Set(ByVal value As Double) SetPropertyValue("CurrencyRate", _CurrencyRate, value) End Set End Property _ _ Property CurrencyName As CurrencyName Get Return _CurrencyName End Get Set(ByVal value As CurrencyName) SetPropertyValue("CurrencyName", _CurrencyName, value) End Set End Property _ Property Description As String Get Return _Description End Get Set(ByVal value As String) SetPropertyValue("Description", _Description, value) End Set End Property _ _ Property DateExecution As Date Get Return _DateExecution End Get Set(ByVal value As Date) SetPropertyValue("DateExecution", _DateExecution, value) If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then Me.DatePayment = value End If End Set End Property Property DatePayment As Date Get Return _DatePayment End Get Set(ByVal value As Date) SetPropertyValue("DatePayment", _DatePayment, value) End Set End Property _ _ Property PaymentOption As PaymentOption Get Return _PaymentOption End Get Set(ByVal value As PaymentOption) SetPropertyValue("PaymentOption", _PaymentOption, value) If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then If value.PayMode = ePayMode.InCash Then Me.DateExecution = GetSQLTime(Session) End If End If End Set End Property Property AmountHUF As Double Get Return _AmountHUF End Get Set(ByVal value As Double) SetPropertyValue("AmountHUF", _AmountHUF, value) End Set End Property Property AmountDEV As Double Get Return _AmountDEV End Get Set(ByVal value As Double) SetPropertyValue("AmountDEV", _AmountDEV, value) If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then If CurrencyName.ShortName <> "HUF" Then AmountHUF = Math.Round(AmountDEV * CurrencyRate, 0, MidpointRounding.AwayFromZero) End If End Set End Property '-- Rule5DMatrix ------------------------------------ Property Controlling As Controlling Get Return _Controlling End Get Set(ByVal value As Controlling) SetPropertyValue("Controlling", _Controlling, value) End Set End Property Property CostHolder As CostHolder Get Return _CostHolder End Get Set(value As CostHolder) SetPropertyValue("CostHolder", _CostHolder, value) End Set End Property Property CostPlace As CostPlace Get Return _CostPlace End Get Set(value As CostPlace) SetPropertyValue("CostPlace", _CostPlace, value) End Set End Property Property UniqueObjects As UniqueObjects Get Return _UniqueObjects End Get Set(value As UniqueObjects) SetPropertyValue("UniqueObjects", _UniqueObjects, value) End Set End Property Property JobNumberObjects As JobNumberObjects Get Return _JobNumberObjects End Get Set(value As JobNumberObjects) SetPropertyValue("JobNumberObjects", _JobNumberObjects, value) End Set End Property Property VAT As VAT Get Return _VAT End Get Set(ByVal value As VAT) SetPropertyValue("VAT", _VAT, value) End Set End Property Property BankInformation As BankInformation Get Return _BankInformation End Get Set(ByVal value As BankInformation) SetPropertyValue("BankInformation", _BankInformation, value) End Set End Property _ Property InvoiceType As InvoiceType Get Return _InvoiceType End Get Set(ByVal value As InvoiceType) SetPropertyValue("InvoiceType", _InvoiceType, value) End Set End Property _ Property IsEditable As Boolean Get Return _IsEditable End Get Set(value As Boolean) SetPropertyValue("IsEditable", _IsEditable, value) End Set End Property End Class #Region "Cool Codes" ' _ 'Public Shared Function OrdersLinq(ByVal s As Session) As IQueryable ' Dim orders As New XPQuery(Of Order)(s) ' Dim queryOrders = _ ' From o In orders _ ' Order By o.Employee.FirstName Ascending _ ' Group o By GroupKey = o.Employee.FirstName & " " & o.Employee.LastName Into oo = Group _ ' Where oo.Sum(Function(o) o.Freight) > 10000 _ ' Select New With {Key .OrderID = oo.Sum(Function(o) o.OrderID), Key .Employee_Linq = GroupKey, Key .Orders_Sum_Linq = oo.Sum(Function(o) o.Freight)} ' Return queryOrders 'End Function #End Region