You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.5 KiB
90 lines
3.5 KiB
Imports C1.Win.C1TrueDBGrid
|
|
Imports System
|
|
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
Public Class frmVersionSelect
|
|
|
|
Dim m_versionnr As Integer
|
|
Property Versionnr() As Integer
|
|
Get
|
|
Return m_versionnr
|
|
End Get
|
|
Set(ByVal value As Integer)
|
|
m_versionnr = value
|
|
End Set
|
|
End Property
|
|
Dim dt As DataTable
|
|
Dim applikationnr As Integer = 0
|
|
Dim Appltext As String = ""
|
|
Sub New(ByVal Applikationnr As Integer, ByVal titel As String)
|
|
InitializeComponent()
|
|
Me.applikationnr = Applikationnr
|
|
Me.Appltext = titel
|
|
End Sub
|
|
Private Sub frmVersionSelect_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
lblVersion.Text = "Versionen von " + Me.Appltext
|
|
refresh_applikationen()
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
|
|
Me.Versionnr = 0
|
|
For Each r As DataRow In dt.Rows
|
|
' If r.Item("Version") = Me.cbboxVersion.Text Then
|
|
'Me.Versionnr = r.Item("ApplikationVersionnr")
|
|
'End If
|
|
If r.Item("Version") = Me.lbVersionen.Text Then
|
|
Me.Versionnr = r.Item("ApplikationVersionnr")
|
|
End If
|
|
Next
|
|
Me.DialogResult = Windows.Forms.DialogResult.OK
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
|
|
Me.DialogResult = Windows.Forms.DialogResult.Cancel
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub btnNeueVersion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNeueVersion.Click
|
|
Dim f As New frmVersion(0, Me.applikationnr, True, False)
|
|
f.MdiParent = Me.MdiParent
|
|
f.ShowDialog()
|
|
Me.refresh_applikationen()
|
|
|
|
End Sub
|
|
|
|
|
|
Public Function Get_Versionen(ByVal applikationnr As Integer) As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
scmCmdToExecute.CommandText = "dbo.sp_get_versionen"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@applikationnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, applikationnr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.clsmitarbeiter.iMitarbeiternr.Value))
|
|
conn.OpenConnection()
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
|
conn.CloseConnection(True)
|
|
Return dtToReturn
|
|
Catch ex As Exception
|
|
Throw New Exception("clsApplikation::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
Private Sub refresh_applikationen()
|
|
dt = Get_Versionen(Me.applikationnr)
|
|
Me.lbVersionen.Items.Clear()
|
|
Me.lbVersionen.Items.Add("-")
|
|
For Each r As DataRow In dt.Rows
|
|
Me.lbVersionen.Items.Add(r.Item("Version"))
|
|
Next
|
|
Me.lbVersionen.SelectedIndex = 0
|
|
End Sub
|
|
End Class |