diff --git a/MultiTool.Form/DS_DD_ECM.Designer.vb b/MultiTool.Form/DS_DD_ECM.Designer.vb index 927edd0..0d9a882 100644 --- a/MultiTool.Form/DS_DD_ECM.Designer.vb +++ b/MultiTool.Form/DS_DD_ECM.Designer.vb @@ -5423,12 +5423,19 @@ Namespace DS_DD_ECMTableAdapters _ Private Sub InitCommandCollection() - Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} + Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(1) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, [KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHE"& _ - "N, ACTIVE, TEMPLATE_ID, COMMENT"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBMT_CONFIG" + "N, ACTIVE, TEMPLATE_ID, COMMENT"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBMT_CONFIG"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (TEMP"& _ + "LATE_ID IS NOT NULL)" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(1) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(1).Connection = Me.Connection + Me._commandCollection(1).CommandText = "SELECT GUID, [KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHE"& _ + "N, ACTIVE, TEMPLATE_ID, COMMENT"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBMT_CONFIG"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (TEMP"& _ + "LATE_ID IS NULL)" + Me._commandCollection(1).CommandType = Global.System.Data.CommandType.Text End Sub _ + Public Overloads Overridable Function FillGeneral(ByVal dataTable As DS_DD_ECM.TBMT_CONFIGDataTable) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(1) + If (Me.ClearBeforeFill = true) Then + dataTable.Clear + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + _ + Public Overloads Overridable Function GetDataGeneral() As DS_DD_ECM.TBMT_CONFIGDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(1) + Dim dataTable As DS_DD_ECM.TBMT_CONFIGDataTable = New DS_DD_ECM.TBMT_CONFIGDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + _ diff --git a/MultiTool.Form/DS_DD_ECM.xsd b/MultiTool.Form/DS_DD_ECM.xsd index 65189d6..cd32320 100644 --- a/MultiTool.Form/DS_DD_ECM.xsd +++ b/MultiTool.Form/DS_DD_ECM.xsd @@ -304,56 +304,57 @@ SELECT GUID, NAME, DESCRIPTION, PARAMETERS FROM TBMT_FUNCTIONS WHERE (GUID = @GU - + DELETE FROM TBMT_CONFIG WHERE (GUID = @Original_GUID) - + - + INSERT INTO TBMT_CONFIG ([KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN, ACTIVE, TEMPLATE_ID, COMMENT) VALUES (@KEY,@VALUE,@ADDED_WHO,@ADDED_WHEN,@CHANGED_WHO,@CHANGED_WHEN,@ACTIVE,@TEMPLATE_ID,@COMMENT) - - - - - - - - - + + + + + + + + + - + SELECT GUID, [KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN, ACTIVE, TEMPLATE_ID, COMMENT -FROM TBMT_CONFIG +FROM TBMT_CONFIG +WHERE (TEMPLATE_ID IS NOT NULL) - + UPDATE TBMT_CONFIG SET [KEY] = @KEY, VALUE = @VALUE, ADDED_WHO = @ADDED_WHO, ADDED_WHEN = @ADDED_WHEN, CHANGED_WHO = @CHANGED_WHO, CHANGED_WHEN = @CHANGED_WHEN, ACTIVE = @ACTIVE, TEMPLATE_ID = @TEMPLATE_ID, COMMENT = @COMMENT WHERE (GUID = @Original_GUID) - - - - - - - - - - + + + + + + + + + + @@ -371,7 +372,18 @@ WHERE (GUID = @Original_GUID) - + + + + + SELECT GUID, [KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN, ACTIVE, TEMPLATE_ID, COMMENT +FROM TBMT_CONFIG +WHERE (TEMPLATE_ID IS NULL) + + + + + @@ -381,7 +393,7 @@ WHERE (GUID = @Original_GUID) - + @@ -426,7 +438,7 @@ WHERE (GUID = @Original_GUID) - + @@ -440,7 +452,7 @@ WHERE (GUID = @Original_GUID) - + @@ -461,7 +473,7 @@ WHERE (GUID = @Original_GUID) - + @@ -477,7 +489,7 @@ WHERE (GUID = @Original_GUID) - + @@ -505,7 +517,7 @@ WHERE (GUID = @Original_GUID) - + @@ -580,9 +592,9 @@ WHERE (GUID = @Original_GUID) - - - + + + \ No newline at end of file diff --git a/MultiTool.Form/DS_DD_ECM.xss b/MultiTool.Form/DS_DD_ECM.xss index b700cee..12639e6 100644 --- a/MultiTool.Form/DS_DD_ECM.xss +++ b/MultiTool.Form/DS_DD_ECM.xss @@ -11,7 +11,7 @@ - + diff --git a/MultiTool.Form/frmConfig.Designer.vb b/MultiTool.Form/frmConfig.Designer.vb index ed741f6..adb4e10 100644 --- a/MultiTool.Form/frmConfig.Designer.vb +++ b/MultiTool.Form/frmConfig.Designer.vb @@ -67,6 +67,24 @@ Partial Class frmConfig Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() + Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl() + Me.txtYearOverride = New DevExpress.XtraEditors.TextEdit() + Me.txtWebserviceBaseurl = New DevExpress.XtraEditors.TextEdit() + Me.txtWebserviceUsername = New DevExpress.XtraEditors.TextEdit() + Me.txtWebservicePassword = New DevExpress.XtraEditors.TextEdit() + Me.txtWebserviceImportRelativePath = New DevExpress.XtraEditors.TextEdit() + Me.txtWebserviceImportBasePath = New DevExpress.XtraEditors.MemoEdit() + Me.Root = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlGroup1 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlItem4 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlGroup2 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlGroup3 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlItem5 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem() + Me.EmptySpaceItem1 = New DevExpress.XtraLayout.EmptySpaceItem() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.TBMT_TEMPLATE_ITEMSTableAdapter = New MultiTool.Form.DS_DD_ECMTableAdapters.TBMT_TEMPLATE_ITEMSTableAdapter() Me.TBMT_CONFIGTableAdapter = New MultiTool.Form.DS_DD_ECMTableAdapters.TBMT_CONFIGTableAdapter() @@ -83,6 +101,25 @@ Partial Class frmConfig CType(Me.TBMT_CONFIGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridViewConfig, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.LayoutControl1.SuspendLayout() + CType(Me.txtYearOverride.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtWebserviceBaseurl.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtWebserviceUsername.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtWebservicePassword.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtWebserviceImportRelativePath.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtWebserviceImportBasePath.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.Root, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlGroup2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlGroup3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'XtraTabControl1 @@ -91,7 +128,7 @@ Partial Class frmConfig Me.XtraTabControl1.Location = New System.Drawing.Point(0, 63) Me.XtraTabControl1.Name = "XtraTabControl1" Me.XtraTabControl1.SelectedTabPage = Me.tabPageSchema - Me.XtraTabControl1.Size = New System.Drawing.Size(1093, 571) + Me.XtraTabControl1.Size = New System.Drawing.Size(1132, 607) Me.XtraTabControl1.TabIndex = 1 Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.tabPageSchema, Me.tabPageConfig}) ' @@ -99,7 +136,7 @@ Partial Class frmConfig ' Me.tabPageSchema.Controls.Add(Me.GridSchema) Me.tabPageSchema.Name = "tabPageSchema" - Me.tabPageSchema.Size = New System.Drawing.Size(1091, 546) + Me.tabPageSchema.Size = New System.Drawing.Size(1130, 582) Me.tabPageSchema.Text = "Schema" ' 'GridSchema @@ -109,7 +146,7 @@ Partial Class frmConfig Me.GridSchema.Location = New System.Drawing.Point(0, 0) Me.GridSchema.MainView = Me.GridViewSchema Me.GridSchema.Name = "GridSchema" - Me.GridSchema.Size = New System.Drawing.Size(1091, 546) + Me.GridSchema.Size = New System.Drawing.Size(1130, 582) Me.GridSchema.TabIndex = 0 Me.GridSchema.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewSchema}) ' @@ -249,19 +286,20 @@ Partial Class frmConfig 'tabPageConfig ' Me.tabPageConfig.Controls.Add(Me.GridConfig) + Me.tabPageConfig.Controls.Add(Me.LayoutControl1) Me.tabPageConfig.Name = "tabPageConfig" - Me.tabPageConfig.Size = New System.Drawing.Size(1091, 546) + Me.tabPageConfig.Size = New System.Drawing.Size(1130, 582) Me.tabPageConfig.Text = "Konfiguration" ' 'GridConfig ' Me.GridConfig.DataSource = Me.TBMT_CONFIGBindingSource Me.GridConfig.Dock = System.Windows.Forms.DockStyle.Fill - Me.GridConfig.Location = New System.Drawing.Point(0, 0) + Me.GridConfig.Location = New System.Drawing.Point(419, 0) Me.GridConfig.MainView = Me.GridViewConfig Me.GridConfig.MenuManager = Me.RibbonControl1 Me.GridConfig.Name = "GridConfig" - Me.GridConfig.Size = New System.Drawing.Size(1091, 546) + Me.GridConfig.Size = New System.Drawing.Size(711, 582) Me.GridConfig.TabIndex = 0 Me.GridConfig.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewConfig}) ' @@ -287,7 +325,8 @@ Partial Class frmConfig Me.colKEY.FieldName = "KEY" Me.colKEY.Name = "colKEY" Me.colKEY.Visible = True - Me.colKEY.VisibleIndex = 0 + Me.colKEY.VisibleIndex = 1 + Me.colKEY.Width = 124 ' 'colVALUE ' @@ -295,7 +334,8 @@ Partial Class frmConfig Me.colVALUE.FieldName = "VALUE" Me.colVALUE.Name = "colVALUE" Me.colVALUE.Visible = True - Me.colVALUE.VisibleIndex = 1 + Me.colVALUE.VisibleIndex = 2 + Me.colVALUE.Width = 124 ' 'colADDED_WHO ' @@ -323,23 +363,28 @@ Partial Class frmConfig Me.colCOMMENT.FieldName = "COMMENT" Me.colCOMMENT.Name = "colCOMMENT" Me.colCOMMENT.Visible = True - Me.colCOMMENT.VisibleIndex = 2 + Me.colCOMMENT.VisibleIndex = 4 + Me.colCOMMENT.Width = 170 ' 'colACTIVE ' Me.colACTIVE.Caption = "Aktiv" Me.colACTIVE.FieldName = "ACTIVE" + Me.colACTIVE.MaxWidth = 40 + Me.colACTIVE.MinWidth = 40 Me.colACTIVE.Name = "colACTIVE" Me.colACTIVE.Visible = True - Me.colACTIVE.VisibleIndex = 3 + Me.colACTIVE.VisibleIndex = 0 + Me.colACTIVE.Width = 40 ' 'colTEMPLATE_ID ' - Me.colTEMPLATE_ID.Caption = "Vorlagen ID" + Me.colTEMPLATE_ID.Caption = "Vorlage" Me.colTEMPLATE_ID.FieldName = "TEMPLATE_ID" Me.colTEMPLATE_ID.Name = "colTEMPLATE_ID" Me.colTEMPLATE_ID.Visible = True - Me.colTEMPLATE_ID.VisibleIndex = 4 + Me.colTEMPLATE_ID.VisibleIndex = 3 + Me.colTEMPLATE_ID.Width = 87 ' 'RibbonControl1 ' @@ -353,7 +398,7 @@ Partial Class frmConfig Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide Me.RibbonControl1.ShowToolbarCustomizeItem = False - Me.RibbonControl1.Size = New System.Drawing.Size(1093, 63) + Me.RibbonControl1.Size = New System.Drawing.Size(1132, 63) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 Me.RibbonControl1.Toolbar.ShowCustomizeItem = False ' @@ -394,10 +439,176 @@ Partial Class frmConfig ' 'RibbonStatusBar1 ' - Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 634) + Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 670) Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 - Me.RibbonStatusBar1.Size = New System.Drawing.Size(1093, 24) + Me.RibbonStatusBar1.Size = New System.Drawing.Size(1132, 24) + ' + 'LayoutControl1 + ' + Me.LayoutControl1.Controls.Add(Me.txtYearOverride) + Me.LayoutControl1.Controls.Add(Me.txtWebserviceBaseurl) + Me.LayoutControl1.Controls.Add(Me.txtWebserviceUsername) + Me.LayoutControl1.Controls.Add(Me.txtWebservicePassword) + Me.LayoutControl1.Controls.Add(Me.txtWebserviceImportRelativePath) + Me.LayoutControl1.Controls.Add(Me.txtWebserviceImportBasePath) + Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Left + Me.LayoutControl1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControl1.Name = "LayoutControl1" + Me.LayoutControl1.Root = Me.Root + Me.LayoutControl1.Size = New System.Drawing.Size(419, 582) + Me.LayoutControl1.TabIndex = 1 + Me.LayoutControl1.Text = "LayoutControl1" + ' + 'txtYearOverride + ' + Me.txtYearOverride.Location = New System.Drawing.Point(152, 45) + Me.txtYearOverride.MenuManager = Me.RibbonControl1 + Me.txtYearOverride.Name = "txtYearOverride" + Me.txtYearOverride.Size = New System.Drawing.Size(243, 20) + Me.txtYearOverride.StyleController = Me.LayoutControl1 + Me.txtYearOverride.TabIndex = 4 + ' + 'txtWebserviceBaseurl + ' + Me.txtWebserviceBaseurl.Location = New System.Drawing.Point(152, 114) + Me.txtWebserviceBaseurl.MenuManager = Me.RibbonControl1 + Me.txtWebserviceBaseurl.Name = "txtWebserviceBaseurl" + Me.txtWebserviceBaseurl.Size = New System.Drawing.Size(243, 20) + Me.txtWebserviceBaseurl.StyleController = Me.LayoutControl1 + Me.txtWebserviceBaseurl.TabIndex = 5 + ' + 'txtWebserviceUsername + ' + Me.txtWebserviceUsername.Location = New System.Drawing.Point(152, 138) + Me.txtWebserviceUsername.MenuManager = Me.RibbonControl1 + Me.txtWebserviceUsername.Name = "txtWebserviceUsername" + Me.txtWebserviceUsername.Size = New System.Drawing.Size(243, 20) + Me.txtWebserviceUsername.StyleController = Me.LayoutControl1 + Me.txtWebserviceUsername.TabIndex = 6 + ' + 'txtWebservicePassword + ' + Me.txtWebservicePassword.Location = New System.Drawing.Point(152, 162) + Me.txtWebservicePassword.MenuManager = Me.RibbonControl1 + Me.txtWebservicePassword.Name = "txtWebservicePassword" + Me.txtWebservicePassword.Properties.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42) + Me.txtWebservicePassword.Size = New System.Drawing.Size(243, 20) + Me.txtWebservicePassword.StyleController = Me.LayoutControl1 + Me.txtWebservicePassword.TabIndex = 7 + ' + 'txtWebserviceImportRelativePath + ' + Me.txtWebserviceImportRelativePath.Location = New System.Drawing.Point(152, 299) + Me.txtWebserviceImportRelativePath.MenuManager = Me.RibbonControl1 + Me.txtWebserviceImportRelativePath.Name = "txtWebserviceImportRelativePath" + Me.txtWebserviceImportRelativePath.Size = New System.Drawing.Size(243, 20) + Me.txtWebserviceImportRelativePath.StyleController = Me.LayoutControl1 + Me.txtWebserviceImportRelativePath.TabIndex = 9 + ' + 'txtWebserviceImportBasePath + ' + Me.txtWebserviceImportBasePath.Location = New System.Drawing.Point(152, 231) + Me.txtWebserviceImportBasePath.MenuManager = Me.RibbonControl1 + Me.txtWebserviceImportBasePath.Name = "txtWebserviceImportBasePath" + Me.txtWebserviceImportBasePath.Size = New System.Drawing.Size(243, 64) + Me.txtWebserviceImportBasePath.StyleController = Me.LayoutControl1 + Me.txtWebserviceImportBasePath.TabIndex = 8 + ' + 'Root + ' + Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] + Me.Root.GroupBordersVisible = False + Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlGroup1, Me.LayoutControlGroup2, Me.LayoutControlGroup3, Me.EmptySpaceItem1}) + Me.Root.Name = "Root" + Me.Root.Size = New System.Drawing.Size(419, 582) + Me.Root.TextVisible = False + ' + 'LayoutControlGroup1 + ' + Me.LayoutControlGroup1.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem2, Me.LayoutControlItem3, Me.LayoutControlItem4}) + Me.LayoutControlGroup1.Location = New System.Drawing.Point(0, 69) + Me.LayoutControlGroup1.Name = "LayoutControlGroup1" + Me.LayoutControlGroup1.Size = New System.Drawing.Size(399, 117) + Me.LayoutControlGroup1.Text = "Webservice / EWL" + ' + 'LayoutControlItem4 + ' + Me.LayoutControlItem4.Control = Me.txtWebservicePassword + Me.LayoutControlItem4.Location = New System.Drawing.Point(0, 48) + Me.LayoutControlItem4.Name = "LayoutControlItem4" + Me.LayoutControlItem4.Size = New System.Drawing.Size(375, 24) + Me.LayoutControlItem4.Text = "Webservice Passwort" + Me.LayoutControlItem4.TextSize = New System.Drawing.Size(116, 13) + ' + 'LayoutControlItem3 + ' + Me.LayoutControlItem3.Control = Me.txtWebserviceUsername + Me.LayoutControlItem3.Location = New System.Drawing.Point(0, 24) + Me.LayoutControlItem3.Name = "LayoutControlItem3" + Me.LayoutControlItem3.Size = New System.Drawing.Size(375, 24) + Me.LayoutControlItem3.Text = "Webservice Username" + Me.LayoutControlItem3.TextSize = New System.Drawing.Size(116, 13) + ' + 'LayoutControlItem2 + ' + Me.LayoutControlItem2.Control = Me.txtWebserviceBaseurl + Me.LayoutControlItem2.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlItem2.Name = "LayoutControlItem2" + Me.LayoutControlItem2.Size = New System.Drawing.Size(375, 24) + Me.LayoutControlItem2.Text = "Server Adresse" + Me.LayoutControlItem2.TextSize = New System.Drawing.Size(116, 13) + ' + 'LayoutControlGroup2 + ' + Me.LayoutControlGroup2.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1}) + Me.LayoutControlGroup2.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlGroup2.Name = "LayoutControlGroup2" + Me.LayoutControlGroup2.Size = New System.Drawing.Size(399, 69) + Me.LayoutControlGroup2.Text = "Programmeinstellungen" + ' + 'LayoutControlItem1 + ' + Me.LayoutControlItem1.Control = Me.txtYearOverride + Me.LayoutControlItem1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlItem1.Name = "LayoutControlItem1" + Me.LayoutControlItem1.Size = New System.Drawing.Size(375, 24) + Me.LayoutControlItem1.Text = "Wirtschaftsjahr" + Me.LayoutControlItem1.TextSize = New System.Drawing.Size(116, 13) + ' + 'LayoutControlGroup3 + ' + Me.LayoutControlGroup3.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem5, Me.LayoutControlItem6}) + Me.LayoutControlGroup3.Location = New System.Drawing.Point(0, 186) + Me.LayoutControlGroup3.Name = "LayoutControlGroup3" + Me.LayoutControlGroup3.Size = New System.Drawing.Size(399, 137) + Me.LayoutControlGroup3.Text = "Import/Export Pfade" + ' + 'LayoutControlItem5 + ' + Me.LayoutControlItem5.Control = Me.txtWebserviceImportBasePath + Me.LayoutControlItem5.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlItem5.Name = "LayoutControlItem5" + Me.LayoutControlItem5.Size = New System.Drawing.Size(375, 68) + Me.LayoutControlItem5.Text = "WinLine Pfad (absolut)" + Me.LayoutControlItem5.TextSize = New System.Drawing.Size(116, 13) + ' + 'LayoutControlItem6 + ' + Me.LayoutControlItem6.Control = Me.txtWebserviceImportRelativePath + Me.LayoutControlItem6.Location = New System.Drawing.Point(0, 68) + Me.LayoutControlItem6.Name = "LayoutControlItem6" + Me.LayoutControlItem6.Size = New System.Drawing.Size(375, 24) + Me.LayoutControlItem6.Text = "Multiool Pfad (relativ)" + Me.LayoutControlItem6.TextSize = New System.Drawing.Size(116, 13) + ' + 'EmptySpaceItem1 + ' + Me.EmptySpaceItem1.AllowHotTrack = False + Me.EmptySpaceItem1.Location = New System.Drawing.Point(0, 323) + Me.EmptySpaceItem1.Name = "EmptySpaceItem1" + Me.EmptySpaceItem1.Size = New System.Drawing.Size(399, 239) + Me.EmptySpaceItem1.TextSize = New System.Drawing.Size(0, 0) ' 'RibbonPage2 ' @@ -415,19 +626,19 @@ Partial Class frmConfig 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False + Me.TableAdapterManager.TBEDI_XML_NODESTableAdapter = Nothing + Me.TableAdapterManager.TBEDI_XML_TYPESTableAdapter = Nothing Me.TableAdapterManager.TBMT_CONFIGTableAdapter = Me.TBMT_CONFIGTableAdapter Me.TableAdapterManager.TBMT_FUNCTIONSTableAdapter = Nothing - Me.TableAdapterManager.TBEDI_XML_NODESTableAdapter = Nothing Me.TableAdapterManager.TBMT_TEMPLATE_ITEMSTableAdapter = Me.TBMT_TEMPLATE_ITEMSTableAdapter Me.TableAdapterManager.TBMT_TEMPLATESTableAdapter = Nothing - Me.TableAdapterManager.TBEDI_XML_TYPESTableAdapter = Nothing Me.TableAdapterManager.UpdateOrder = MultiTool.Form.DS_DD_ECMTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'frmConfig ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(1093, 658) + Me.ClientSize = New System.Drawing.Size(1132, 694) Me.Controls.Add(Me.XtraTabControl1) Me.Controls.Add(Me.RibbonStatusBar1) Me.Controls.Add(Me.RibbonControl1) @@ -448,6 +659,25 @@ Partial Class frmConfig CType(Me.TBMT_CONFIGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridViewConfig, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.LayoutControl1.ResumeLayout(False) + CType(Me.txtYearOverride.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtWebserviceBaseurl.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtWebserviceUsername.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtWebservicePassword.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtWebserviceImportRelativePath.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtWebserviceImportBasePath.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.Root, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlGroup2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlGroup3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -498,4 +728,22 @@ Partial Class frmConfig Friend WithEvents colTEMPLATE_ID As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents LayoutControl1 As LayoutControl + Friend WithEvents txtYearOverride As TextEdit + Friend WithEvents txtWebserviceBaseurl As TextEdit + Friend WithEvents txtWebserviceUsername As TextEdit + Friend WithEvents txtWebservicePassword As TextEdit + Friend WithEvents txtWebserviceImportRelativePath As TextEdit + Friend WithEvents txtWebserviceImportBasePath As MemoEdit + Friend WithEvents Root As LayoutControlGroup + Friend WithEvents LayoutControlGroup1 As LayoutControlGroup + Friend WithEvents LayoutControlItem4 As LayoutControlItem + Friend WithEvents LayoutControlItem3 As LayoutControlItem + Friend WithEvents LayoutControlItem2 As LayoutControlItem + Friend WithEvents LayoutControlGroup2 As LayoutControlGroup + Friend WithEvents LayoutControlItem1 As LayoutControlItem + Friend WithEvents LayoutControlGroup3 As LayoutControlGroup + Friend WithEvents LayoutControlItem5 As LayoutControlItem + Friend WithEvents LayoutControlItem6 As LayoutControlItem + Friend WithEvents EmptySpaceItem1 As EmptySpaceItem End Class diff --git a/MultiTool.Form/frmConfig.resx b/MultiTool.Form/frmConfig.resx index 9014f4f..08bc53e 100644 --- a/MultiTool.Form/frmConfig.resx +++ b/MultiTool.Form/frmConfig.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 313, 17 + + + 194, 17 + 758, 17 @@ -137,15 +143,6 @@ IC8+DQo8L3N2Zz4L - - 313, 17 - - - 194, 17 - - - 194, 17 - 533, 17 diff --git a/MultiTool.Form/frmConfig.vb b/MultiTool.Form/frmConfig.vb index a593b34..4cce96b 100644 --- a/MultiTool.Form/frmConfig.vb +++ b/MultiTool.Form/frmConfig.vb @@ -4,6 +4,8 @@ Imports DevExpress.XtraGrid.Views.Grid Imports DigitalData.Modules.Config Imports DigitalData.Modules.Database Imports DigitalData.Modules.Logging +Imports MultiTool.Shared +Imports MultiTool.Shared.Constants Public Class frmConfig Private ReadOnly ConfigManager As ConfigManager(Of MultiTool.Shared.Config) @@ -12,6 +14,8 @@ Public Class frmConfig Private BindingSource As BindingSource = TBEDIXMLITEMSBindingSource Private View As GridView = GridViewSchema + Private TBMT_CONFIG_GENERAL As New DS_DD_ECM.TBMT_CONFIGDataTable + Private ReadOnly Property Config As MultiTool.Shared.Config Get Return ConfigManager?.Config @@ -45,14 +49,76 @@ Public Class frmConfig TBMT_CONFIGTableAdapter.Connection.ConnectionString = oBuilder.ToString() TBMT_CONFIGTableAdapter.Fill(DS_DD_ECM.TBMT_CONFIG) + TBMT_CONFIGTableAdapter.FillGeneral(TBMT_CONFIG_GENERAL) + + LoadGeneralConfig(TBMT_CONFIG_GENERAL) + End Sub + + Private Sub LoadGeneralConfig(TBMT_CONFIG_GENERAL As DS_DD_ECM.TBMT_CONFIGDataTable) + For Each oRow As DataRow In TBMT_CONFIG_GENERAL.Rows + Dim oConfigKey = oRow.ItemEx("KEY", "") + Dim oConfigValue = oRow.ItemEx("VALUE", "") + + Select Case oConfigKey + Case "YEAR_OVERRIDE" + txtYearOverride.EditValue = oConfigValue + + Case "WEBSERVICE_BASEURL" + txtWebserviceBaseurl.EditValue = oConfigValue + + Case "WEBSERVICE_USERNAME" + txtWebserviceUsername.EditValue = oConfigValue + + Case "WEBSERIVCE_PASSWORD" + txtWebservicePassword.EditValue = oConfigValue + + Case "WEBSERVICE_IMPORT_BASE_PATH" + txtWebserviceImportBasePath.EditValue = oConfigValue + + Case "WEBSERVICE_IMPORT_RELATIVE_PATH" + txtWebserviceImportRelativePath.EditValue = oConfigValue + + End Select + Next + End Sub + + Private Sub SaveGeneralConfig(TBMT_CONFIG_GENERAL As DS_DD_ECM.TBMT_CONFIGDataTable) + For Each oRow As DataRow In TBMT_CONFIG_GENERAL.Rows + Dim oConfigKey = oRow.ItemEx("KEY", "") + + Select Case oConfigKey + Case "YEAR_OVERRIDE" + oRow.Item("VALUE") = txtYearOverride.EditValue + + Case "WEBSERVICE_BASEURL" + oRow.Item("VALUE") = txtWebserviceBaseurl.EditValue + + Case "WEBSERVICE_USERNAME" + oRow.Item("VALUE") = txtWebserviceUsername.EditValue + + Case "WEBSERIVCE_PASSWORD" + oRow.Item("VALUE") = txtWebservicePassword.EditValue + + Case "WEBSERVICE_IMPORT_BASE_PATH" + oRow.Item("VALUE") = txtWebserviceImportBasePath.EditValue + + Case "WEBSERVICE_IMPORT_RELATIVE_PATH" + oRow.Item("VALUE") = txtWebserviceImportRelativePath.EditValue + + End Select + Next End Sub Private Sub Save() - TBMT_CONFIGTableAdapter.Update(DS_DD_ECM.TBMT_CONFIG) DS_DD_ECM.TBMT_CONFIG.AcceptChanges() + TBMT_CONFIGTableAdapter.Update(DS_DD_ECM.TBMT_CONFIG) + + TBMT_CONFIG_GENERAL.AcceptChanges() + SaveGeneralConfig(TBMT_CONFIG_GENERAL) + TBMT_CONFIGTableAdapter.Update(TBMT_CONFIG_GENERAL) - TBMT_TEMPLATE_ITEMSTableAdapter.Update(DS_DD_ECM.TBMT_TEMPLATE_ITEMS) DS_DD_ECM.TBMT_TEMPLATE_ITEMS.AcceptChanges() + TBMT_TEMPLATE_ITEMSTableAdapter.Update(DS_DD_ECM.TBMT_TEMPLATE_ITEMS) End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick diff --git a/MultiTool.Form/frmImportMain.vb b/MultiTool.Form/frmImportMain.vb index 2c86e70..4532766 100644 --- a/MultiTool.Form/frmImportMain.vb +++ b/MultiTool.Form/frmImportMain.vb @@ -204,6 +204,8 @@ Public Class frmImportMain Dim oResult As DialogResult = MsgBox(oMessage, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) Try + BeginLoadingUI() + If oResult = DialogResult.Yes Then Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle) Dim oNewDocument = Await DocumentLoader.LoadFile(oDocument.File, CurrentTemplate, lookupMandator.EditValue) @@ -222,6 +224,9 @@ Public Class frmImportMain Catch ex As Exception FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Neuladen_des_Dokuments) + Finally + EndLoadingUI() + End Try End Sub diff --git a/MultiTool.Shared/Documents/DocumentLoader.vb b/MultiTool.Shared/Documents/DocumentLoader.vb index 11bfe04..7d673f1 100644 --- a/MultiTool.Shared/Documents/DocumentLoader.vb +++ b/MultiTool.Shared/Documents/DocumentLoader.vb @@ -420,6 +420,12 @@ Namespace Documents Dim oArticleNumberField As String = oFieldMap.GetOrDefault("Article", Nothing) Dim oArticleNumber As String = pRow.Fields.Item(oArticleNumberField).Final + Dim oQuantityField As String = oFieldMap.GetOrDefault("Quantity", Nothing) + Dim oQuantity As Integer = 1 + If Integer.TryParse(pRow.Fields.Item(oQuantityField).Final, oQuantity) = False Then + Logger.Warn("Value for parameter Quantity could not be parsed. Setting to 1.") + End If + ' These fields a fetched from the head row, ie. the first row Dim oAccountNumberField As String = oFieldMap.GetOrDefault("Account", Nothing) Dim oAccountNumber = pDocument.GetFieldValue(oAccountNumberField) @@ -427,12 +433,21 @@ Namespace Documents Dim oDocumentDateField As String = oFieldMap.GetOrDefault("DocumentDate", Nothing) Dim oDocumentDate = pDocument.GetFieldValue(oDocumentDateField) + Dim oDocumentKindField As String = oFieldMap.GetOrDefault("DocumentKind", Nothing) + Dim oDocumentKind As Integer = 0 + If Integer.TryParse(pDocument.GetFieldValue(oDocumentKindField), oDocumentKind) Then + Logger.Warn("Value for parameter DocumentKind could not be parsed. Setting to 0.") + End If + ' TODO: Add Field Names as Constants ' TODO: Check for missing values - Dim oQuantity As Integer = 1 + ' TODO: This function should not be hardcoded, but be replaced with virtual field or something.. + ' It is related to customer SCHAUM and nothing general + Dim oWaitingDays As Integer = Await Winline.TryGetWaitingDays(oDocumentKind, pMandator) + ' END TODO - Dim oArticlePrice As Double = Await Winline.TryGetArticlePrice(oArticleNumber, oAccountNumber, oQuantity, oDocumentDate, pMandator, pTemplate) + Dim oArticlePrice As Double = Await Winline.TryGetArticlePrice(oArticleNumber, oAccountNumber, oQuantity, oDocumentDate, pMandator, pTemplate, oWaitingDays) If oArticlePrice > 0 Then oPriceItem.External = oArticlePrice diff --git a/MultiTool.Shared/Winline/WinlineData.vb b/MultiTool.Shared/Winline/WinlineData.vb index 8745a44..bc2bb7e 100644 --- a/MultiTool.Shared/Winline/WinlineData.vb +++ b/MultiTool.Shared/Winline/WinlineData.vb @@ -134,6 +134,10 @@ Namespace Winline Next Accounts.AddRange(oAccounts) + If oAccounts.Count = 0 Then + Logger.Warn("No Acconts loaded for Mandator [{0}]", pMandator) + End If + Logger.Info("[{0}] Accounts loaded for Mandator [{1}]", oAccounts.Count, pMandator) Catch ex As Exception Logger.Warn("Could not load Accounts for Mandator [{0}]", pMandator) @@ -323,19 +327,29 @@ Namespace Winline End Function Public Async Function TryGetArticlePrice(pArticle As String, pAccountNumber As String, pQuantity As String, pDocumentDate As Date, pMandator As Mandator, pTemplate As Template) As Task(Of Double) + Return Await TryGetArticlePrice(pArticle, pAccountNumber, pQuantity, pDocumentDate, pMandator, pTemplate, 0) + End Function + + Public Async Function TryGetArticlePrice(pArticle As String, pAccountNumber As String, pQuantity As String, pDocumentDate As Date, pMandator As Mandator, pTemplate As Template, pWaitingDays As Integer) As Task(Of Double) Try Dim oUserName = Environment.UserName Dim oYear As Integer = Config.GetWinLineYear() Dim oDebug = Convert.ToInt32(LogConfig.Debug) + ' TODO: pGroupPropertyID in config + ' TODO: pTempTableSuffix in config (nice to have) + + Dim oDateFrom = pDocumentDate.AddDays(pWaitingDays * -1) + Dim oDateTo = pDocumentDate + Dim oSQL As String = $" EXEC [{pMandator.Database}].[dbo].[PRCUST_GET_ACCOUNT_PRICE_CONDITION_VALUES] @pAccountNr = '{pAccountNumber}', @pGroupNr = '*', @pProductNr = '{pArticle}', - @pProductQuantity = '*', - @pProductPriceDateFrom = '{pDocumentDate:dd.MM.yyyy}', - @pProductPriceDateTo = '{pDocumentDate:dd.MM.yyyy}', + @pProductQuantity = '<={pQuantity}', + @pProductPriceDateFrom = '{oDateFrom:dd.MM.yyyy}', + @pProductPriceDateTo = '{oDateTo:dd.MM.yyyy}', @pmesocomp = '{pMandator.Id}', @pmesoyear = {oYear}, @pGroupPropertyID = 1008, @@ -367,6 +381,34 @@ Namespace Winline End Try End Function + ''' + ''' This function is completely SCHAUM related. + ''' + Public Async Function TryGetWaitingDays(pDocumentKind As Integer, pMandator As Mandator) As Task(Of Integer) + Try + Dim oSql = $" + SELECT [Karenztage].[u012] FROM [{pMandator.Database}].[dbo].[t670] As [Werksdefinition] + INNER JOIN [{pMandator.Database}].[dbo].[t670] AS [Werkszuordnung] ON [Werksdefinition].[u007] = [Werkszuordnung].[u007] + INNER JOIN [{pMandator.Database}].[dbo].[t670] AS [Karenztage] ON [Werksdefinition].[u000] = [Karenztage].[u032] + WHERE [Werksdefinition].[u011] In ({pDocumentKind},{pDocumentKind}*10) + AND [Werkszuordnung].[u006] = '%ConditionAccountNr%' + AND [Karenztage].[u002] = 'Karenztage' + " + Dim oWaitingDays As Integer = Await Database.GetScalarValueAsync(oSql) + + If IsNothing(oWaitingDays) Then + oWaitingDays = 0 + End If + + Return oWaitingDays + + Catch ex As Exception + Logger.Error(ex) + Return 0 + + End Try + End Function + Public Function TryGetArticleNumber(pEAN As String, pMandator As Mandator) As String Try Dim oYear As Integer = Config.GetWinLineYear()