Feature "Sprachen" in Adminmodul eingebaut
This commit is contained in:
133
UID/Programme/frmSprachen.vb
Normal file
133
UID/Programme/frmSprachen.vb
Normal file
@@ -0,0 +1,133 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmSprachen
|
||||
|
||||
Dim SPRACHENBind As cEasyBinding
|
||||
Public table
|
||||
Public BIND_DB
|
||||
Public programId As Integer
|
||||
Sub New(table, BIND_DB, programId)
|
||||
Me.table = table
|
||||
Me.BIND_DB = BIND_DB
|
||||
Me.programId = programId
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Private Sub frmSprachen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
cbxSprachen.fillWithSQL("SELECT distinct([trs_sprache]) FROM [tblTranslate] WHERE trs_progId='" & programId & "' ORDER By [trs_sprache]", False, "FMZOLL", False)
|
||||
|
||||
cbxSprachen.changeItem("EN")
|
||||
|
||||
If cbxSprachen.SelectedIndex = -1 Then
|
||||
cbxSprachen.Items.Add("EN")
|
||||
cbxSprachen.changeItem("EN")
|
||||
End If
|
||||
|
||||
|
||||
txtProgramm.fillWithSQL("SELECT [prog_codename] from [tblProgramme] WHERE [prog_id] ='" & programId & "'", "ADMIN")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cbxSprachen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxSprachen.SelectedIndexChanged
|
||||
|
||||
Dim sqlLanguage = " AND [trs_sprache] = '" & cbxSprachen.SelectedItem.ToString & "'"
|
||||
|
||||
loadDGV(sqlLanguage)
|
||||
End Sub
|
||||
|
||||
Private Sub loadDGV(Optional language As String = "", Optional sqlwhere As String = "")
|
||||
|
||||
Try
|
||||
SPRACHENBind = New cEasyBinding(BIND_DB)
|
||||
|
||||
Select Case language
|
||||
Case <> ""
|
||||
If sqlwhere = "" Then
|
||||
|
||||
SPRACHENBind.initBinding("SELECT * FROM " & table & " WHERE [trs_progId] = '" & programId & "'" & language, table)
|
||||
|
||||
Else
|
||||
|
||||
SPRACHENBind.initBinding("SELECT * FROM " & table & " WHERE [trs_progId] = '" & programId & "'" & language & sqlwhere, table)
|
||||
End If
|
||||
|
||||
|
||||
Case Else
|
||||
|
||||
If sqlwhere = "" Then
|
||||
|
||||
SPRACHENBind.initBinding("SELECT * FROM " & table & "WHERE [trs_progId] = '" & programId & "'", table)
|
||||
Else
|
||||
|
||||
SPRACHENBind.initBinding("SELECT * FROM " & table & " WHERE [trs_progId] = '" & programId & "'" & sqlwhere, table)
|
||||
|
||||
End If
|
||||
|
||||
End Select
|
||||
|
||||
DataGridView.DataSource = SPRACHENBind.bindingdataTable
|
||||
|
||||
With DataGridView
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
.Columns("trs_id").Visible = False
|
||||
.Columns("trs_progId").Visible = False
|
||||
.Columns("trs_progName").Visible = False
|
||||
.Columns("trs_object").HeaderText = "Object"
|
||||
.Columns("trs_object").Width = 150
|
||||
.Columns("trs_control").HeaderText = "Control"
|
||||
.Columns("trs_control").Width = 150
|
||||
.Columns("trs_subControl").HeaderText = "Subcontrol"
|
||||
.Columns("trs_sprache").HeaderText = "Spr"
|
||||
.Columns("trs_sprache").Width = 40
|
||||
.Columns("trs_text").HeaderText = "Übersetzung"
|
||||
.Columns("trs_text").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("trs_textDE").HeaderText = "DE-Text"
|
||||
.Columns("trs_textDE").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("trs_active").HeaderText = "aktiv"
|
||||
.Columns("trs_active").Width = 40
|
||||
End If
|
||||
|
||||
End With
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TextBox1_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles txtObject.PreviewKeyDown, txtDE.PreviewKeyDown, txtSubcontrol.PreviewKeyDown, txtControl.PreviewKeyDown, txttranslate.PreviewKeyDown
|
||||
|
||||
Dim sqladdon As String = ""
|
||||
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
If txtControl.Text <> "" Then
|
||||
sqladdon &= " AND [trs_control] like '%" & txtControl.Text & "%'"
|
||||
End If
|
||||
|
||||
If txtObject.Text <> "" Then
|
||||
sqladdon &= " AND [trs_object] like '%" & txtObject.Text & "%'"
|
||||
End If
|
||||
|
||||
If txtSubcontrol.Text <> "" Then
|
||||
sqladdon &= " AND [trs_subControl] like '%" & txtSubcontrol.Text & "%'"
|
||||
End If
|
||||
|
||||
If txtDE.Text <> "" Then
|
||||
sqladdon &= " AND [trs_textDE] like '%" & txtDE.Text & "%'"
|
||||
End If
|
||||
|
||||
If txttranslate.Text <> "" Then
|
||||
sqladdon &= " AND [trs_text] like '%" & txttranslate.Text & "%'"
|
||||
End If
|
||||
|
||||
Dim sqlLanguage = " AND [trs_sprache] = '" & cbxSprachen.SelectedItem.ToString & "'"
|
||||
|
||||
loadDGV(sqlLanguage, sqladdon)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user