First create solution
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
Partial Class GLRowsVC
|
||||
|
||||
<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
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
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 Nuvolar.Module
|
||||
Imports DevExpress.ExpressApp.Win.Editors
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
|
||||
Public Class GLRowsVC
|
||||
Inherits Nuvolar.Module.GLRowsVC
|
||||
Dim _WaitFormClass As New WaitFormClass
|
||||
Private _GridListEditor As GridListEditor
|
||||
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 DoWork, AddressOf _WaitFormClass.DoWork
|
||||
AddHandler InitWork, AddressOf _WaitFormClass.Initwork
|
||||
AddHandler FinalWork, AddressOf _WaitFormClass.FinalWork
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
|
||||
RemoveHandler DoWork, AddressOf _WaitFormClass.DoWork
|
||||
RemoveHandler InitWork, AddressOf _WaitFormClass.Initwork
|
||||
RemoveHandler FinalWork, AddressOf _WaitFormClass.FinalWork
|
||||
|
||||
If _GridListEditor IsNot Nothing Then
|
||||
If _GridListEditor.GridView IsNot Nothing Then
|
||||
RemoveHandler _GridListEditor.GridView.CellValueChanged, AddressOf GLRows_ListView_Bank_CellValueChanged
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Sub OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
|
||||
If View.Id = "GLRows_ListView_Bank" Then
|
||||
_GridListEditor = TryCast(TryCast(View, ListView).Editor, GridListEditor)
|
||||
|
||||
If _GridListEditor IsNot Nothing Then
|
||||
AddHandler _GridListEditor.GridView.CellValueChanged, AddressOf GLRows_ListView_Bank_CellValueChanged
|
||||
End If
|
||||
|
||||
'If _GridListEditor IsNot Nothing Then
|
||||
' _GridListEditor.AllowEdit = True
|
||||
' For i As Integer = 0 To _GridListEditor.Columns.Count - 1
|
||||
' If _GridListEditor.GridView.Columns(i).FieldName <> "CurrencyRate2" Then
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
||||
' End If
|
||||
' Next i
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GLRows_ListView_Bank_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
|
||||
If TryCast(e.Column, GridColumn).FieldName = "CurrencyRate2" Then
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _uow As New UnitOfWork(_ocur.Session.DataLayer)
|
||||
Dim _GLRows As GLRows = View.SelectedObjects(0)
|
||||
If _GLRows IsNot Nothing Then
|
||||
_GLRows.InAmountDEV2 = Math.Round(_GLRows.InAmountDEV * e.Value, 2, MidpointRounding.AwayFromZero)
|
||||
_GLRows.OutAmountDEV2 = Math.Round(_GLRows.OutAmountDEV * e.Value, 2, MidpointRounding.AwayFromZero)
|
||||
_GLRows.CurrencyRate2 = e.Value
|
||||
_ocur.CommitChanges()
|
||||
|
||||
If _GLRows.GLHeader IsNot Nothing Then
|
||||
GLFunctions.ReconfigurePCI(_uow, _GLRows.GLHeader.CustomersFrom, _GLRows.Customer, _GLRows.PartnerType, _GLRows.ConnectInfo)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user