JJ_11052016
This commit is contained in:
@@ -156,6 +156,19 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub frmForm_Constructor_Main_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
If RECORD_CHANGED Then
|
||||
Dim ResultMessage As String
|
||||
Try
|
||||
ResultMessage = Update_Record_OnChange()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in saving Record")
|
||||
Me.Cursor = Cursors.Default
|
||||
' Verhindert den Zeilenwechsel
|
||||
e.Cancel = True
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
_FormClosing = True
|
||||
' Check_Record_Changed()
|
||||
CloseWDDocview()
|
||||
@@ -676,6 +689,20 @@ Public Class frmConstructor_Main
|
||||
Return grvwGridPos.GetFocusedRowCellValue(grvwGrid.Columns(columnName))
|
||||
End Function
|
||||
|
||||
Private Sub grvwGrid_BeforeLeaveRow(sender As Object, e As RowAllowEventArgs) Handles grvwGrid.BeforeLeaveRow
|
||||
If RECORD_CHANGED Then
|
||||
Dim ResultMessage As String
|
||||
Try
|
||||
ResultMessage = Update_Record_OnChange()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in saving Record")
|
||||
Me.Cursor = Cursors.Default
|
||||
' Verhindert den Zeilenwechsel
|
||||
e.Allow = False
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub grvwGrid_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles grvwGrid.FocusedColumnChanged
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Column_Row_Handler()
|
||||
@@ -1329,6 +1356,24 @@ Public Class frmConstructor_Main
|
||||
Private Sub tsButtonSave_Click(sender As Object, e As EventArgs) Handles tsButtonSave.Click
|
||||
Save_Record()
|
||||
End Sub
|
||||
|
||||
Sub Focus_Control(name As String)
|
||||
Dim controls As Control.ControlCollection = pnlDetails.Controls
|
||||
|
||||
For Each c As Control In controls
|
||||
|
||||
Dim tag As Object = c.Tag
|
||||
Dim controlName As String = DirectCast(tag, ClassControlMetadata).Name
|
||||
If controlName = name Then
|
||||
|
||||
c.Focus()
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Function Save_Record()
|
||||
Try
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
@@ -1525,6 +1570,15 @@ Public Class frmConstructor_Main
|
||||
If RECORD_ENABLED = False Then
|
||||
EnableEditMode()
|
||||
Else
|
||||
Dim ResultMessage As String
|
||||
Try
|
||||
ResultMessage = Update_Record_OnChange()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in saving Record")
|
||||
Me.Cursor = Cursors.Default
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
DisableEditMode()
|
||||
End If
|
||||
End Sub
|
||||
@@ -1598,7 +1652,7 @@ Public Class frmConstructor_Main
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
stg = "Bearbeiten"
|
||||
Else
|
||||
stg = "Work record"
|
||||
stg = "Edit record"
|
||||
End If
|
||||
Me.tsButtonEdit.Text = stg
|
||||
Me.tsButtonEdit.Text = stg
|
||||
@@ -2288,6 +2342,16 @@ Public Class frmConstructor_Main
|
||||
ClassDatabase.Execute_non_Query(del, True)
|
||||
End If
|
||||
|
||||
Dim ResultMessage
|
||||
' Wenn MussFelder nicht ausgefüllt werden, wird eine exception geworfen und abgefangen
|
||||
Try
|
||||
ResultMessage = Update_Record_OnChange()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in saving Record")
|
||||
Me.Cursor = Cursors.Default
|
||||
Exit Sub
|
||||
End Try
|
||||
|
||||
End If
|
||||
CtrlCommandUI.IsInsert = False
|
||||
RECORD_CHANGED = False
|
||||
@@ -2876,6 +2940,10 @@ Public Class frmConstructor_Main
|
||||
End If
|
||||
Dim errorMessage As String = msg
|
||||
|
||||
' Das erste fehlende Control in den Fokus nehmen
|
||||
Dim firstControlName = missingControlValues.First()
|
||||
Focus_Control(firstControlName)
|
||||
|
||||
Throw New Exception(errorMessage)
|
||||
End If
|
||||
|
||||
@@ -4551,6 +4619,7 @@ Public Class frmConstructor_Main
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub grvwGridPos_CellValueChanged(sender As Object, e As CellValueChangedEventArgs) Handles grvwGridPos.CellValueChanged
|
||||
Try
|
||||
Dim column = e.Column.FieldName
|
||||
|
||||
Reference in New Issue
Block a user