This commit is contained in:
2022-12-05 14:17:41 +01:00
3 changed files with 91 additions and 25 deletions

View File

@@ -87,9 +87,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.68.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<Reference Include="ClosedXML, Version=0.76.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\dll\ClosedXML.dll</HintPath>
<HintPath>..\..\..\dll\closedxml\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="FastColoredTextBox">
<HintPath>..\..\..\dll\FastColoredTextBox.dll</HintPath>

View File

@@ -37,6 +37,7 @@ Partial Class frmSprachen
Me.txttranslate = New System.Windows.Forms.TextBox()
Me.Label7 = New System.Windows.Forms.Label()
Me.txtProgramm = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.btnOK = New System.Windows.Forms.Button()
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
@@ -57,20 +58,21 @@ Partial Class frmSprachen
Me.cbxSprachen.FormattingEnabled = True
Me.cbxSprachen.Location = New System.Drawing.Point(68, 6)
Me.cbxSprachen.Name = "cbxSprachen"
Me.cbxSprachen.Size = New System.Drawing.Size(72, 21)
Me.cbxSprachen.Size = New System.Drawing.Size(50, 21)
Me.cbxSprachen.TabIndex = 1
'
'DataGridView
'
Me.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.DataGridView.Location = New System.Drawing.Point(15, 82)
Me.DataGridView.MultiSelect = False
Me.DataGridView.Name = "DataGridView"
Me.DataGridView.Size = New System.Drawing.Size(974, 452)
Me.DataGridView.TabIndex = 14
'
'txtObject
'
Me.txtObject.Location = New System.Drawing.Point(15, 56)
Me.txtObject.Location = New System.Drawing.Point(57, 56)
Me.txtObject.Name = "txtObject"
Me.txtObject.Size = New System.Drawing.Size(150, 20)
Me.txtObject.TabIndex = 9
@@ -78,7 +80,7 @@ Partial Class frmSprachen
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(12, 40)
Me.Label2.Location = New System.Drawing.Point(54, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(41, 13)
Me.Label2.TabIndex = 4
@@ -87,7 +89,7 @@ Partial Class frmSprachen
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(209, 40)
Me.Label3.Location = New System.Drawing.Point(207, 40)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(43, 13)
Me.Label3.TabIndex = 5
@@ -95,7 +97,7 @@ Partial Class frmSprachen
'
'txtControl
'
Me.txtControl.Location = New System.Drawing.Point(212, 56)
Me.txtControl.Location = New System.Drawing.Point(210, 56)
Me.txtControl.Name = "txtControl"
Me.txtControl.Size = New System.Drawing.Size(150, 20)
Me.txtControl.TabIndex = 10
@@ -103,7 +105,7 @@ Partial Class frmSprachen
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(402, 40)
Me.Label4.Location = New System.Drawing.Point(361, 40)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(58, 13)
Me.Label4.TabIndex = 6
@@ -111,42 +113,42 @@ Partial Class frmSprachen
'
'txtSubcontrol
'
Me.txtSubcontrol.Location = New System.Drawing.Point(405, 56)
Me.txtSubcontrol.Location = New System.Drawing.Point(364, 56)
Me.txtSubcontrol.Name = "txtSubcontrol"
Me.txtSubcontrol.Size = New System.Drawing.Size(150, 20)
Me.txtSubcontrol.Size = New System.Drawing.Size(100, 20)
Me.txtSubcontrol.TabIndex = 11
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(600, 40)
Me.Label5.Location = New System.Drawing.Point(715, 40)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(46, 13)
Me.Label5.TabIndex = 7
Me.Label5.TabIndex = 8
Me.Label5.Text = "DE-Text"
'
'txtDE
'
Me.txtDE.Location = New System.Drawing.Point(603, 56)
Me.txtDE.Location = New System.Drawing.Point(718, 56)
Me.txtDE.Name = "txtDE"
Me.txtDE.Size = New System.Drawing.Size(170, 20)
Me.txtDE.TabIndex = 12
Me.txtDE.Size = New System.Drawing.Size(218, 20)
Me.txtDE.TabIndex = 13
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(812, 40)
Me.Label6.Location = New System.Drawing.Point(502, 40)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(67, 13)
Me.Label6.TabIndex = 8
Me.Label6.TabIndex = 7
Me.Label6.Text = "Übersetzung"
'
'txttranslate
'
Me.txttranslate.Location = New System.Drawing.Point(815, 56)
Me.txttranslate.Location = New System.Drawing.Point(505, 56)
Me.txttranslate.Name = "txttranslate"
Me.txttranslate.Size = New System.Drawing.Size(170, 20)
Me.txttranslate.TabIndex = 13
Me.txttranslate.Size = New System.Drawing.Size(207, 20)
Me.txttranslate.TabIndex = 12
'
'Label7
'
@@ -182,11 +184,22 @@ Partial Class frmSprachen
Me.txtProgramm.TabIndex = 3
Me.txtProgramm.TabStop = False
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(880, 540)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(109, 23)
Me.btnOK.TabIndex = 15
Me.btnOK.Text = "Speichern"
Me.btnOK.UseVisualStyleBackColor = True
Me.btnOK.Visible = False
'
'frmSprachen
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1001, 545)
Me.ClientSize = New System.Drawing.Size(998, 574)
Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.txtProgramm)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
@@ -203,7 +216,8 @@ Partial Class frmSprachen
Me.Controls.Add(Me.cbxSprachen)
Me.Controls.Add(Me.Label1)
Me.Name = "frmSprachen"
Me.Text = "frmSprachen"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Sprachen"
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
@@ -225,4 +239,5 @@ Partial Class frmSprachen
Friend WithEvents txttranslate As TextBox
Friend WithEvents Label7 As Label
Friend WithEvents txtProgramm As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents btnOK As Button
End Class

View File

@@ -1,4 +1,7 @@
Imports VERAG_PROG_ALLGEMEIN
Imports System.Windows.Controls
Imports GrapeCity.ActiveReports.ReportsCore.Tools
Imports Microsoft.Office.Interop.Word
Imports VERAG_PROG_ALLGEMEIN
Public Class frmSprachen
@@ -6,6 +9,7 @@ Public Class frmSprachen
Public table
Public BIND_DB
Public programId As Integer
Private EditRow As Integer = -1
Sub New(table, BIND_DB, programId)
Me.table = table
Me.BIND_DB = BIND_DB
@@ -21,11 +25,14 @@ Public Class frmSprachen
If cbxSprachen.SelectedIndex = -1 Then
cbxSprachen.Items.Add("EN")
cbxSprachen.Items.Add("TR")
cbxSprachen.changeItem("EN")
End If
txtProgramm.fillWithSQL("SELECT [prog_codename] from [tblProgramme] WHERE [prog_id] ='" & programId & "'", "ADMIN")
btnOK.Visible = True
End Sub
@@ -75,10 +82,11 @@ Public Class frmSprachen
.Columns("trs_progId").Visible = False
.Columns("trs_progName").Visible = False
.Columns("trs_object").HeaderText = "Object"
.Columns("trs_object").Width = 150
.Columns("trs_object").Width = 152
.Columns("trs_control").HeaderText = "Control"
.Columns("trs_control").Width = 150
.Columns("trs_control").Width = 155
.Columns("trs_subControl").HeaderText = "Subcontrol"
.Columns("trs_subControl").Width = 100
.Columns("trs_sprache").HeaderText = "Spr"
.Columns("trs_sprache").Width = 40
.Columns("trs_text").HeaderText = "Übersetzung"
@@ -92,6 +100,7 @@ Public Class frmSprachen
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
@@ -130,4 +139,46 @@ Public Class frmSprachen
End If
End Sub
Private Sub DataGridView_DefaultValuesNeeded(sender As Object, e As DataGridViewRowEventArgs) Handles DataGridView.DefaultValuesNeeded
Try
e.Row.Cells("trs_progId").Value = programId
e.Row.Cells("trs_progName").Value = txtProgramm.Text
e.Row.Cells("trs_sprache").Value = cbxSprachen._value
e.Row.Cells("trs_active").Value = True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
If DataGridView.Columns.Count = 0 Or DataGridView.SelectedRows.Count = 0 Then 'alles gelöscht oder markierte Zeile gelöscht
SPRACHENBind.updateBinding()
Exit Sub
End If
If DataGridView.CurrentRow.Cells("trs_object").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_control").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_text").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_textDE").ToString <> "" AndAlso EditRow >= 0 Then
SPRACHENBind.updateBinding()
End If
End Sub
Private Sub DataGridView_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView.EditingControlShowing
EditRow = DataGridView.CurrentRow.Index
End Sub
Private Sub DataGridView_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView.SelectionChanged
If EditRow >= 0 Then
Dim new_row As Integer = EditRow
EditRow = -1
DataGridView.CurrentCell = DataGridView.Rows(new_row).Cells(
DataGridView.CurrentCell.ColumnIndex)
End If
End Sub
End Class