Constraints for search export documents
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports DevExpress.Utils
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.Config
|
||||
@@ -17,7 +18,6 @@ Public Class frmMain
|
||||
Private TemplateLoader As TemplateLoader
|
||||
Private GridBuilder As GridBuilder
|
||||
Private FormHelper As FormHelper
|
||||
Private WinLine As WinlineData
|
||||
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Try
|
||||
@@ -64,53 +64,20 @@ Public Class frmMain
|
||||
End If
|
||||
End If
|
||||
|
||||
SplashScreenManager.SetWaitFormDescription("Initialisierung der Datenbankverbindung")
|
||||
|
||||
' Initialize Database
|
||||
SplashScreenManager.SetWaitFormDescription("Initialisierung der Datenbankverbindung")
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
|
||||
Database = New MSSQLServer(LogConfig, oConnectionString)
|
||||
|
||||
SplashScreenManager.SetWaitFormDescription("Initialisierung der Vorlagen")
|
||||
|
||||
' Initialize Schemas
|
||||
TemplateLoader = New TemplateLoader(LogConfig, Database)
|
||||
Await TemplateLoader.LoadTemplates()
|
||||
Await TemplateLoader.LoadTemplateConfiguration()
|
||||
Await TemplateLoader.LoadGeneralConfiguration()
|
||||
Await TemplateLoader.LoadMappingConfiguration()
|
||||
Await TemplateLoader.LoadMandatorConfiguration()
|
||||
|
||||
' Save Schema data in 'My' Namespace
|
||||
My.MappingConfiguration = TemplateLoader.MappingConfiguration
|
||||
My.TemplateConfiguration = TemplateLoader.TemplateConfiguration
|
||||
My.MandatorConfiguration = TemplateLoader.MandatorConfiguration
|
||||
My.GeneralConfiguration = TemplateLoader.GeneralConfiguration
|
||||
My.Helpers = New [Shared].Helpers(LogConfig)
|
||||
|
||||
Dim oBindingSource = New BindingList(Of Template)
|
||||
For Each oTemplate As Template In TemplateLoader.TemplateList
|
||||
oBindingSource.Add(oTemplate)
|
||||
Next
|
||||
SplashScreenManager.SetWaitFormDescription("Lade Vorlagen")
|
||||
Await LoadTemplateData()
|
||||
|
||||
SplashScreenManager.SetWaitFormDescription("Lade Winline Stammdaten")
|
||||
WinLine = New WinlineData(LogConfig, Database, My.GeneralConfiguration, My.MappingConfiguration, My.MandatorConfiguration)
|
||||
WinLine.Mandators.Clear()
|
||||
WinLine.LoadEconomicYears()
|
||||
Await WinLine.LoadMandators()
|
||||
|
||||
For Each oMandator As Mandator In WinLine.Mandators
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Konten, oMandator.Id))
|
||||
Await WinLine.LoadAccounts(oMandator)
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Artikel, oMandator.Id))
|
||||
Await WinLine.LoadArticles(oMandator)
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Belegarten, oMandator.Id))
|
||||
Await WinLine.LoadDocumentKinds(oMandator)
|
||||
Next
|
||||
|
||||
My.Winline = WinLine
|
||||
|
||||
My.Winline = New WinlineData(LogConfig, Database, My.GeneralConfiguration, My.MappingConfiguration, My.MandatorConfiguration)
|
||||
Dim oBindingSource As BindingList(Of Template) = Await LoadWinlineData(My.Winline)
|
||||
GridControl1.DataSource = oBindingSource
|
||||
|
||||
|
||||
txtVersion.Caption = String.Format(My.Resources.frmMainExtra.Version___0_, My.Application.Info.Version.ToString)
|
||||
txtCulture.Caption = String.Format(My.Resources.frmMainExtra.Sprache___0_, My.Application.UICulture.ToString)
|
||||
Catch ex As Exception
|
||||
@@ -122,6 +89,45 @@ Public Class frmMain
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Async Function LoadWinlineData(Winline As WinlineData) As Task(Of BindingList(Of Template))
|
||||
Winline.Mandators.Clear()
|
||||
Winline.LoadEconomicYears()
|
||||
Await Winline.LoadMandators()
|
||||
|
||||
For Each oMandator As Mandator In Winline.Mandators
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Konten, oMandator.Id))
|
||||
Await Winline.LoadAccounts(oMandator)
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Artikel, oMandator.Id))
|
||||
Await Winline.LoadArticles(oMandator)
|
||||
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Belegarten, oMandator.Id))
|
||||
Await Winline.LoadDocumentKinds(oMandator)
|
||||
Next
|
||||
|
||||
My.Winline = Winline
|
||||
|
||||
Dim oBindingSource = New BindingList(Of Template)
|
||||
For Each oTemplate As Template In TemplateLoader.TemplateList
|
||||
oBindingSource.Add(oTemplate)
|
||||
Next
|
||||
Return oBindingSource
|
||||
End Function
|
||||
|
||||
Private Async Function LoadTemplateData() As Task
|
||||
' Initialize Schemas
|
||||
TemplateLoader = New TemplateLoader(LogConfig, Database)
|
||||
Await TemplateLoader.LoadTemplates()
|
||||
Await TemplateLoader.LoadTemplateConfiguration()
|
||||
Await TemplateLoader.LoadGeneralConfiguration()
|
||||
Await TemplateLoader.LoadMappingConfiguration()
|
||||
Await TemplateLoader.LoadMandatorConfiguration()
|
||||
|
||||
' Save Schema data in 'My' Namespace
|
||||
My.MappingConfiguration = TemplateLoader.MappingConfiguration
|
||||
My.TemplateConfiguration = TemplateLoader.TemplateConfiguration
|
||||
My.MandatorConfiguration = TemplateLoader.MandatorConfiguration
|
||||
My.GeneralConfiguration = TemplateLoader.GeneralConfiguration
|
||||
End Function
|
||||
|
||||
Private Sub btnOpenImportExportForm_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenImportExportForm.ItemClick
|
||||
Dim oTemplate As Template = GridViewTemplates.GetRow(GridViewTemplates.FocusedRowHandle)
|
||||
OpenImportExportForm(oTemplate)
|
||||
@@ -168,14 +174,16 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewTemplates_DoubleClick(sender As Object, e As EventArgs) Handles GridViewTemplates.DoubleClick
|
||||
Dim oTemplate As Template = GridViewTemplates.GetRow(GridViewTemplates.FocusedRowHandle)
|
||||
OpenImportExportForm(oTemplate)
|
||||
Dim oArgs As DXMouseEventArgs = TryCast(e, DXMouseEventArgs)
|
||||
Dim oHitInfo = GridViewTemplates.CalcHitInfo(oArgs.Location)
|
||||
If oHitInfo.InRow Then
|
||||
Dim oTemplate As Template = GridViewTemplates.GetRow(oHitInfo.RowHandle)
|
||||
OpenImportExportForm(oTemplate)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OpenImportExportForm(pTemplate As Template)
|
||||
Try
|
||||
|
||||
|
||||
If pTemplate Is Nothing Then
|
||||
MsgBox("Keine Vorlage ausgewählt! Bitte wählen Sie eine Vorlage aus!", MsgBoxStyle.Exclamation, Text)
|
||||
Exit Sub
|
||||
@@ -217,4 +225,24 @@ Public Class frmMain
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Async Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
SplashScreenManager.ShowWaitForm()
|
||||
|
||||
Try
|
||||
SplashScreenManager.SetWaitFormDescription("Lade Vorlagen")
|
||||
Await LoadTemplateData()
|
||||
|
||||
SplashScreenManager.SetWaitFormDescription("Lade Winline Stammdaten")
|
||||
Dim oBindingSource As BindingList(Of Template) = Await LoadWinlineData(My.Winline)
|
||||
GridControl1.DataSource = oBindingSource
|
||||
|
||||
Catch ex As Exception
|
||||
FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Laden_der_Winline_Daten)
|
||||
|
||||
Finally
|
||||
SplashScreenManager.CloseWaitForm()
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user