First create solution
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
Partial Class OfferInHeaderVC
|
||||
|
||||
<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
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
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 System.IO
|
||||
Imports FarPoint.Win.Spread
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports DevExpress.ExpressApp.Reports
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.ExpressApp.Editors
|
||||
|
||||
Public Class OfferInHeaderVC
|
||||
Inherits DevExpress.ExpressApp.ViewController
|
||||
Private _FpSpread As FpSpread
|
||||
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 = "OfferInHeader_DetailView" Then
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndCloseAction.Executing, AddressOf SaveAction_Executing
|
||||
AddHandler Frame.GetController(Of ModificationsController)().SaveAndNewAction.Executing, AddressOf SaveAction_Executing
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If View.Id = "OffersInHeader_DetailView" Then
|
||||
RemoveHandler Frame.GetController(Of ModificationsController)().SaveAction.Executing, AddressOf SaveAction_Executing
|
||||
RemoveHandler Frame.GetController(Of ModificationsController)().SaveAndCloseAction.Executing, AddressOf SaveAction_Executing
|
||||
RemoveHandler Frame.GetController(Of ModificationsController)().SaveAndNewAction.Executing, AddressOf SaveAction_Executing
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub ExcelControlViewItem_ControlCreated(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim itemControl As Object = (CType(sender, ViewItem)).Control
|
||||
|
||||
_FpSpread = TryCast(itemControl, ExcelUserControl).FpSpreadControl
|
||||
|
||||
Dim _FileName As String = Path.GetTempPath & "Out.xls"
|
||||
Dim _StreamFile As New FileStream(_FileName, FileMode.Create)
|
||||
Dim _OfferInHeader As OfferInHeader = TryCast(View.SelectedObjects(0), OfferInHeader)
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
If _ocur.Session.IsNewObject(_OfferInHeader) = False Then
|
||||
If _OfferInHeader IsNot Nothing Then
|
||||
If _OfferInHeader.ExcelFile IsNot Nothing Then
|
||||
_OfferInHeader.ExcelFile.SaveToStream(_StreamFile)
|
||||
_StreamFile.Close()
|
||||
_FpSpread.OpenExcel(_FileName)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
If View.Id = "OfferInHeader_DetailView" Then
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
Dim _ExcelControlViewItem As ViewItem
|
||||
If _DetailView IsNot Nothing Then
|
||||
If _DetailView.GetItems(Of ExcelPropertyEditor).Count > 0 Then
|
||||
_ExcelControlViewItem = _DetailView.GetItems(Of ExcelPropertyEditor)(0)
|
||||
If _ExcelControlViewItem IsNot Nothing Then
|
||||
AddHandler _ExcelControlViewItem.ControlCreated, AddressOf ExcelControlViewItem_ControlCreated
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Sub SaveAction_Executing(sender As Object, e As System.ComponentModel.CancelEventArgs)
|
||||
Dim _FileName As String = Path.GetTempPath & "In.xls"
|
||||
Dim _StreamFile As New FileStream(_FileName, FileMode.Create)
|
||||
Dim _OfferInHeader As OfferInHeader = TryCast(View.SelectedObjects(0), OfferInHeader)
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
If _OfferInHeader IsNot Nothing Then
|
||||
If _FpSpread IsNot Nothing Then
|
||||
_FpSpread.SaveExcel(_StreamFile)
|
||||
_StreamFile.Close()
|
||||
Dim _StreamFile2 As New FileStream(_FileName, FileMode.Open)
|
||||
_OfferInHeader.ExcelFile = New FileData(_ocur.Session)
|
||||
_OfferInHeader.ExcelFile.LoadFromStream("Excel worksheet", _StreamFile2)
|
||||
_OfferInHeader.Save()
|
||||
_StreamFile2.Close()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
Partial Class OfferInRowsVC
|
||||
|
||||
<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
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
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 OfferInRowsVC
|
||||
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
|
||||
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 OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
|
||||
'If View.Id = "OfferInHeader_OfferInRows_ListView" Then
|
||||
' 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
|
||||
' _GridListEditor = TryCast(View.Editor, GridListEditor)
|
||||
' If _GridListEditor IsNot Nothing Then
|
||||
' _GridListEditor.AllowEdit = True
|
||||
' For i As Integer = 0 To _GridListEditor.Columns.Count - 1
|
||||
' If _OfferInHeader.CurrencyName.ShortName = "HUF" Then
|
||||
' If _GridListEditor.GridView.Columns(i).FieldName <> "QTT" And _
|
||||
' _GridListEditor.GridView.Columns(i).FieldName <> "FinalPriceHUF" Then
|
||||
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
||||
' End If
|
||||
' Else
|
||||
' If _GridListEditor.GridView.Columns(i).FieldName <> "QTT" And _
|
||||
' _GridListEditor.GridView.Columns(i).FieldName <> "FinalPriceDEV" Then
|
||||
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
||||
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
||||
' End If
|
||||
' End If
|
||||
' Next i
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user