Compare commits

..

10 Commits

Author SHA1 Message Date
Jonathan Jenne
4e3b08038a Version 1.4.4.3 2024-01-15 08:23:25 +01:00
Jonathan Jenne
7c683cf13e Don't run price procedure in transaction 2024-01-15 08:23:16 +01:00
Jonathan Jenne
6eedcc687f Version 1.4.4.2 2023-11-07 10:51:19 +01:00
Jonathan Jenne
62708c02ef Fix table loading 2023-11-07 10:51:00 +01:00
Jonathan Jenne
4a6a8ded7c Version 1.4.4.1 2023-11-07 10:19:49 +01:00
Jonathan Jenne
25e9713c2c Remove Language, Filesystem modules 2023-11-07 10:19:30 +01:00
Jonathan Jenne
a0e5b4aa0b Version 1.4.4.0 2023-11-07 10:02:12 +01:00
Jonathan Jenne
dc4955db17 Only process active articles 2023-11-07 10:02:04 +01:00
Jonathan Jenne
34c8ecbee5 Fix logging in DocumentLoader 2023-11-07 10:01:22 +01:00
Jonathan Jenne
c1fa500f36 Improve Logging for frmConfig 2023-11-07 10:00:47 +01:00
9 changed files with 42 additions and 35 deletions

View File

@@ -9,6 +9,7 @@ Imports MultiTool.Common.Winline.Entities
Imports MultiTool.Common.Constants Imports MultiTool.Common.Constants
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DevExpress.Utils.CommonDialogs Imports DevExpress.Utils.CommonDialogs
Imports DigitalData.Modules.Base
Namespace Documents Namespace Documents
Public Class DocumentLoader Public Class DocumentLoader
@@ -98,8 +99,8 @@ Namespace Documents
oDocument = LoadDocumentData(oDocument, pTemplate, TemplateConfig) oDocument = LoadDocumentData(oDocument, pTemplate, TemplateConfig)
Catch ex As Exception Catch ex As Exception
Throw ex
Logger.Error(ex) Logger.Error(ex)
Throw ex
End Try End Try
@@ -107,8 +108,8 @@ Namespace Documents
oDocument = Await MatchDataFromWinLine(oDocument, Winline.Mandators, pMandator, pTemplate) oDocument = Await MatchDataFromWinLine(oDocument, Winline.Mandators, pMandator, pTemplate)
Catch ex As Exception Catch ex As Exception
Throw ex
Logger.Error(ex) Logger.Error(ex)
Throw ex
End Try End Try
@@ -116,8 +117,8 @@ Namespace Documents
oDocument = MarkRequiredFields(oDocument) oDocument = MarkRequiredFields(oDocument)
Catch ex As Exception Catch ex As Exception
Throw ex
Logger.Error(ex) Logger.Error(ex)
Throw ex
End Try End Try
@@ -542,7 +543,7 @@ Namespace Documents
If IsNothing(oReferencedField) = False Then If IsNothing(oReferencedField) = False Then
Dim oRawValue = oReferencedField.Value?.GetValue(oSubKey) Dim oRawValue = oReferencedField.Value?.GetValue(oSubKey)
Dim oValue As String = Utils.NotNull(oRawValue, String.Empty) Dim oValue As String = ObjectEx.NotNull(oRawValue, String.Empty)
If oValue <> String.Empty Then If oValue <> String.Empty Then
oField.Value.SetExternalValue(oValue) oField.Value.SetExternalValue(oValue)

View File

@@ -63,18 +63,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath> <HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference> </Reference>
<Reference Include="DigitalData.Modules.Filesystem, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Interfaces, Version=1.7.1.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DigitalData.Modules.Interfaces, Version=1.7.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll</HintPath> <HintPath>..\..\DDModules\Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="DigitalData.Modules.Language, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DigitalData.Modules.Logging, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath> <HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>

View File

@@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")> <Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")> <Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("MultiTool.Common")> <Assembly: AssemblyProduct("MultiTool.Common")>
<Assembly: AssemblyCopyright("Copyright © 2023")> <Assembly: AssemblyCopyright("Copyright © 2024")>
<Assembly: AssemblyTrademark("1.0.0.0")> <Assembly: AssemblyTrademark("1.0.0.0")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>

View File

@@ -1,4 +1,4 @@
Imports DigitalData.Modules.Language Imports DigitalData.Modules.Base
Imports MultiTool.Common.Winline.WinlineData Imports MultiTool.Common.Winline.WinlineData
Namespace Templates Namespace Templates
@@ -95,8 +95,8 @@ Namespace Templates
Public Function GetParameter(pName As String) As String Public Function GetParameter(pName As String) As String
Dim oParam1 As String = Utils.NotNull(Parameter1, String.Empty) Dim oParam1 As String = ObjectEx.NotNull(Parameter1, String.Empty)
Dim oParam2 As String = Utils.NotNull(Parameter2, String.Empty) Dim oParam2 As String = ObjectEx.NotNull(Parameter2, String.Empty)
Dim oParamValue1 = Parameters.TryGet(oParam1, pName) Dim oParamValue1 = Parameters.TryGet(oParam1, pName)
Dim oParamValue2 = Parameters.TryGet(oParam2, pName) Dim oParamValue2 = Parameters.TryGet(oParam2, pName)

View File

@@ -7,6 +7,7 @@ Imports MultiTool.Common.Constants
Imports MultiTool.Common.Templates Imports MultiTool.Common.Templates
Imports MultiTool.Common.Exceptions Imports MultiTool.Common.Exceptions
Imports MultiTool.Common.Documents Imports MultiTool.Common.Documents
Imports System.Data.SqlClient
Namespace Winline Namespace Winline
Public Class WinlineData Public Class WinlineData
@@ -89,7 +90,8 @@ Namespace Winline
[c075] -- EAN [c075] -- EAN
FROM [{pMandator.Server}].[{pMandator.Database}].[dbo].[v021] FROM [{pMandator.Server}].[{pMandator.Database}].[dbo].[v021]
WHERE WHERE
mesocomp = '{pMandator.Id}' AND mesoyear = {oYear}" c038 IS NULL -- Nur Aktive Artikel
AND mesocomp = '{pMandator.Id}' AND mesoyear = {oYear}"
Dim oTable = Await Database.GetDatatableAsync(oSQL) Dim oTable = Await Database.GetDatatableAsync(oSQL)
Dim oArticles As New List(Of Article) Dim oArticles As New List(Of Article)
@@ -435,7 +437,11 @@ Namespace Winline
@pResultType = 'CalcPricing'; @pResultType = 'CalcPricing';
SET NOCOUNT OFF; SET NOCOUNT OFF;
" "
Dim oTable As DataTable = Await Database.GetDatatableAsync(oSQL)
Dim oTable As DataTable
Using oConnection As SqlConnection = Database.GetConnection()
oTable = Await Database.GetDatatableWithConnectionObjectAsync(oSQL, oConnection, MSSQLServer.TransactionMode.NoTransaction)
End Using
If oTable.Rows.Count = 0 Then If oTable.Rows.Count = 0 Then
Logger.Debug("Price for article [{0}] and Account [{1}] was not found in Mandator: [{2}]", pArticle, pAccountNumber, pMandator.Id) Logger.Debug("Price for article [{0}] and Account [{1}] was not found in Mandator: [{2}]", pArticle, pAccountNumber, pMandator.Id)
@@ -531,7 +537,7 @@ Namespace Winline
FROM [{pMandator.Database}].[dbo].[v021] FROM [{pMandator.Database}].[dbo].[v021]
WHERE WHERE
[c075] = '{pEAN}' [c075] = '{pEAN}'
AND [c038] IS NULL -- Aktiv AND [c038] IS NULL -- Nur Aktive Artikel
AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}" AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}"
Dim oTable As DataTable = Database.GetDatatable(oSQL) Dim oTable As DataTable = Database.GetDatatable(oSQL)
@@ -636,6 +642,7 @@ Namespace Winline
[c123] -- Ersatzartikelnummer [c123] -- Ersatzartikelnummer
FROM [{pMandator.Database}].[dbo].[v021] FROM [{pMandator.Database}].[dbo].[v021]
WHERE [c011] = '{pArticleNumber}' WHERE [c011] = '{pArticleNumber}'
AND c038 IS NULL -- Nur Aktive Artikel
AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}" AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}"
Dim oTable As DataTable = Database.GetDatatable(oSQL) Dim oTable As DataTable = Database.GetDatatable(oSQL)

View File

@@ -112,14 +112,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath> <HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference> </Reference>
<Reference Include="DigitalData.Modules.Filesystem, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Language, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DigitalData.Modules.Logging, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath> <HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>

View File

@@ -12,8 +12,8 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("WebService Multitool für WinLine")> <Assembly: AssemblyDescription("WebService Multitool für WinLine")>
<Assembly: AssemblyCompany("Digital Data")> <Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("WebService Multitool")> <Assembly: AssemblyProduct("WebService Multitool")>
<Assembly: AssemblyCopyright("Copyright © 2023")> <Assembly: AssemblyCopyright("Copyright © 2024")>
<Assembly: AssemblyTrademark("1.4.3.0")> <Assembly: AssemblyTrademark("1.4.4.3")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben: ' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.4.3.0")> <Assembly: AssemblyVersion("1.4.4.3")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -17,6 +17,7 @@ Public Class frmConfig
Private BindingSource As BindingSource = TBEDIXMLITEMSBindingSource Private BindingSource As BindingSource = TBEDIXMLITEMSBindingSource
Private View As GridView = GridViewItems Private View As GridView = GridViewItems
Private Logger As Logger Private Logger As Logger
Private FormLoading As Boolean = True
Private ReadOnly Property Config As Common.Config Private ReadOnly Property Config As Common.Config
@@ -49,7 +50,6 @@ Public Class frmConfig
Logger.Debug("Connection String: [{0}]", oConnectionString) Logger.Debug("Connection String: [{0}]", oConnectionString)
Logger.Debug("Setting default values") Logger.Debug("Setting default values")
' Default Values
DS_DD_ECM.TBMT_CONFIG.ADDED_WHOColumn.DefaultValue = Environment.UserName DS_DD_ECM.TBMT_CONFIG.ADDED_WHOColumn.DefaultValue = Environment.UserName
DS_DD_ECM.TBMT_CONFIG.CHANGED_WHOColumn.DefaultValue = Environment.UserName DS_DD_ECM.TBMT_CONFIG.CHANGED_WHOColumn.DefaultValue = Environment.UserName
DS_DD_ECM.TBMT_TEMPLATE_ITEMS.ADDED_WHOColumn.DefaultValue = Environment.UserName DS_DD_ECM.TBMT_TEMPLATE_ITEMS.ADDED_WHOColumn.DefaultValue = Environment.UserName
@@ -57,13 +57,15 @@ Public Class frmConfig
Logger.Debug("Initializing Tables Adapter") Logger.Debug("Initializing Tables Adapter")
TBMT_TABLESTableAdapter.Connection.ConnectionString = oConnectionString TBMT_TABLESTableAdapter.Connection.ConnectionString = oConnectionString
TBMT_TABLESTableAdapter.Fill(DS_DD_ECM.TBMT_TABLES)
Logger.Debug("Initializing Templates Adapter") Logger.Debug("Initializing Templates Adapter")
TBMT_TEMPLATE_ITEMSTableAdapter.Connection.ConnectionString = oConnectionString TBMT_TEMPLATE_ITEMSTableAdapter.Connection.ConnectionString = oConnectionString
Logger.Debug("Initializing Config Adapter") Logger.Debug("Initializing Config Adapter")
TBMT_CONFIGTableAdapter.Connection.ConnectionString = oConnectionString TBMT_CONFIGTableAdapter.Connection.ConnectionString = oConnectionString
Logger.Debug("Loading Data from Adapters")
TBMT_TABLESTableAdapter.Fill(DS_DD_ECM.TBMT_TABLES)
TBMT_CONFIGTableAdapter.Fill(DS_DD_ECM.TBMT_CONFIG) TBMT_CONFIGTableAdapter.Fill(DS_DD_ECM.TBMT_CONFIG)
TBMT_CONFIGTableAdapter.FillGeneral(TBMT_CONFIG_GENERAL) TBMT_CONFIGTableAdapter.FillGeneral(TBMT_CONFIG_GENERAL)
@@ -71,6 +73,10 @@ Public Class frmConfig
LoadGeneralConfig(TBMT_CONFIG_GENERAL) LoadGeneralConfig(TBMT_CONFIG_GENERAL)
BindingSource = TBEDIXMLITEMSBindingSource BindingSource = TBEDIXMLITEMSBindingSource
FormLoading = False
GridViewItems.FocusedRowHandle = GridControl.InvalidRowHandle
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
FormHelper.ShowError(ex, "Laden des Formulars") FormHelper.ShowError(ex, "Laden des Formulars")
@@ -191,19 +197,28 @@ Public Class frmConfig
Private Sub GridViewTables_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewTables.FocusedRowChanged Private Sub GridViewTables_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewTables.FocusedRowChanged
Try Try
If FormLoading Then
Logger.Debug("Form still loading. Exiting.")
Exit Sub
End If
If GridViewTables.FocusedRowHandle < 0 Then If GridViewTables.FocusedRowHandle < 0 Then
Logger.Debug("No row selected. Exiting.")
Exit Sub Exit Sub
End If End If
Dim oRow As DataRow = GridViewTables.GetDataRow(GridViewTables.FocusedRowHandle) Dim oRow As DataRow = GridViewTables.GetDataRow(GridViewTables.FocusedRowHandle)
If oRow Is Nothing Then If oRow Is Nothing Then
Logger.Debug("Invalid row handle. Exiting.")
Exit Sub Exit Sub
End If End If
Dim oTableId = oRow.Item("GUID") Dim oTableId = oRow.Item("GUID")
Logger.Debug("Loading Items for Table [{0}]", oTableId)
TBMT_TEMPLATE_ITEMSTableAdapter.Fill(DS_DD_ECM.TBMT_TEMPLATE_ITEMS, oTableId) TBMT_TEMPLATE_ITEMSTableAdapter.Fill(DS_DD_ECM.TBMT_TEMPLATE_ITEMS, oTableId)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex)
FormHelper.ShowError(ex, "Laden der Tabelle") FormHelper.ShowError(ex, "Laden der Tabelle")
End Try End Try
End Sub End Sub

View File

@@ -5,8 +5,8 @@ Imports MultiTool.Common.Winline
Imports MultiTool.Common.Winline.Entities Imports MultiTool.Common.Winline.Entities
Imports MultiTool.Common.Templates Imports MultiTool.Common.Templates
Imports MultiTool.Common.Constants Imports MultiTool.Common.Constants
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Base
Imports DevExpress.XtraEditors Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Repository Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraEditors.Controls Imports DevExpress.XtraEditors.Controls
@@ -167,7 +167,7 @@ Public Class frmRowEditor
End If End If
Dim oFieldValue As FieldValue = oField.Value Dim oFieldValue As FieldValue = oField.Value
Dim oValueFromGrid As String = Utils.NotNull(oRow.Item(COL_VALUE_FINAL), String.Empty) Dim oValueFromGrid As String = ObjectEx.NotNull(oRow.Item(COL_VALUE_FINAL), String.Empty)
' Do the dirtiest date validation of all times ' Do the dirtiest date validation of all times
If oField.Value.DataType = ColumnType.Date And oValueFromGrid.Length > 0 Then If oField.Value.DataType = ColumnType.Date And oValueFromGrid.Length > 0 Then
@@ -293,7 +293,7 @@ Public Class frmRowEditor
Private Sub GridView1_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell Private Sub GridView1_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
Dim oDataRow As DataRow = GridView1.GetDataRow(e.RowHandle) Dim oDataRow As DataRow = GridView1.GetDataRow(e.RowHandle)
Dim oKey As String = oDataRow.Item(COL_KEY) Dim oKey As String = oDataRow.Item(COL_KEY)
Dim oValue As String = Utils.NotNull(oDataRow.Item(COL_VALUE_FINAL), String.Empty) Dim oValue As String = ObjectEx.NotNull(oDataRow.Item(COL_VALUE_FINAL), String.Empty)
Dim oColumn = _Table.Columns. Dim oColumn = _Table.Columns.
Where(Function(c) c.Name = oKey). Where(Function(c) c.Name = oKey).
SingleOrDefault() SingleOrDefault()