44 lines
2.0 KiB
VB.net
44 lines
2.0 KiB
VB.net
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
|
|
|
|
Public Class CustomersFileAttachment_VC
|
|
Inherits DevExpress.ExpressApp.ViewController
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
InitializeComponent()
|
|
RegisterActions(components)
|
|
End Sub
|
|
|
|
Private Sub aCustomersFileAttachment_OpenDefaultFolder_Execute(sender As Object, e As SimpleActionExecuteEventArgs) Handles aCustomersFileAttachment_OpenDefaultFolder.Execute
|
|
Try
|
|
Dim _DefaultFolder As String = TryCast(Application.Model.Options, IModelOptionsExtender).DefaultCustomersFileFolder
|
|
Dim _Customers As Customers = TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, Customers)
|
|
If _Customers Is Nothing Then Throw New Exception("*Váratlan hiba történt, a folyamat megszakadt!")
|
|
Dim _CustomersFolderName As String = ""
|
|
If _Customers.FullName.Length < 13 Then
|
|
_CustomersFolderName = _Customers.FullName + " " + _Customers.Address1.City + " " + _Customers.CustomerNumber
|
|
Else
|
|
_CustomersFolderName = _Customers.FullName.Remove(12, _Customers.FullName.Length - 12) + _
|
|
" " + _Customers.Address1.City + " " + _Customers.CustomerNumber
|
|
End If
|
|
|
|
If System.IO.Directory.Exists(_DefaultFolder + _CustomersFolderName) Then
|
|
Process.Start("explorer.exe", _DefaultFolder + _CustomersFolderName)
|
|
Else
|
|
System.IO.Directory.CreateDirectory(_DefaultFolder + _CustomersFolderName)
|
|
Process.Start("explorer.exe", _DefaultFolder + _CustomersFolderName)
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Hiba!")
|
|
End Try
|
|
End Sub
|
|
End Class
|