MS1
This commit is contained in:
@@ -5,6 +5,7 @@ Imports DevExpress.XtraEditors.Controls
|
||||
Imports DevExpress.XtraEditors.Repository
|
||||
Imports DevExpress.XtraGrid.Views.Base
|
||||
Imports DevExpress.XtraGrid.Views.Tile
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraScheduler
|
||||
Imports System.Text
|
||||
Imports System.IO
|
||||
@@ -12,9 +13,10 @@ Imports DevExpress.XtraGrid
|
||||
Imports WINDREAMLib
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports DD_Rights
|
||||
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
|
||||
|
||||
Public Class frmConstructor_Main
|
||||
|
||||
|
||||
|
||||
Private Const SEE_MASK_INVOKEIDLIST = &HC
|
||||
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
|
||||
@@ -72,7 +74,8 @@ Public Class frmConstructor_Main
|
||||
Private TreeView_perControl As Boolean = False
|
||||
|
||||
Dim IsTopFirstRow As Boolean = True
|
||||
Private RightMouse_Clicked = False
|
||||
Private GRIDRightMouse_Clicked = False
|
||||
Private GRIDdownHitInfo As GridHitInfo
|
||||
|
||||
Private VIEW_ID
|
||||
Private VIEW_ID_RUNTIME As Integer = -1
|
||||
@@ -396,7 +399,7 @@ Public Class frmConstructor_Main
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim XMLPath = Get_DocGRid_Layout_Filename()
|
||||
Dim XMLPath = Get_DocGrid_Layout_Filename()
|
||||
GridViewDoc_Search.SaveLayoutToXml(XMLPath)
|
||||
' Update_Status_Label(True, "Grid Layout Loaded")
|
||||
Catch ex As Exception
|
||||
@@ -408,7 +411,7 @@ Public Class frmConstructor_Main
|
||||
If ACT_EBENE_STRING Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim XMLPath = Get_DocGRid_Layout_Filename()
|
||||
Dim XMLPath = Get_DocGrid_Layout_Filename()
|
||||
If File.Exists(XMLPath) Then
|
||||
GridViewDoc_Search.RestoreLayoutFromXml(XMLPath)
|
||||
GridViewDoc_Search.GuessAutoFilterRowValuesFromFilter()
|
||||
@@ -886,7 +889,7 @@ Public Class frmConstructor_Main
|
||||
If ENTITY_LOADED = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
If RightMouse_Clicked Then
|
||||
If GRIDRightMouse_Clicked Then
|
||||
Exit Sub
|
||||
End If
|
||||
' If NODE_NAVIGATION = False Then
|
||||
@@ -5171,13 +5174,47 @@ Public Class frmConstructor_Main
|
||||
End If
|
||||
End Sub
|
||||
Private Sub grvwGrid_MouseDown(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseDown, grvwTiles.MouseDown, grvwCarousel.MouseDown
|
||||
Dim view As GridView = CType(sender, GridView)
|
||||
If e.Button = Windows.Forms.MouseButtons.Right Then
|
||||
RightMouse_Clicked = True
|
||||
GRIDRightMouse_Clicked = True
|
||||
Else
|
||||
RightMouse_Clicked = False
|
||||
GRIDRightMouse_Clicked = False
|
||||
End If
|
||||
Dim hitInfo As GridHitInfo = View.CalcHitInfo(New Point(e.X, e.Y))
|
||||
If e.Button = Windows.Forms.MouseButtons.Left AndAlso hitInfo.InRow AndAlso hitInfo.HitTest <> GridHitTest.RowIndicator Then
|
||||
GRIDdownHitInfo = hitInfo
|
||||
End If
|
||||
End Sub
|
||||
Private Sub grvwGrid_MouseMove(sender As Object, e As MouseEventArgs) Handles grvwGrid.MouseMove, grvwTiles.MouseMove, grvwCarousel.MouseMove
|
||||
Dim view As GridView = CType(sender, GridView)
|
||||
|
||||
If e.Button = MouseButtons.Left And Not GRIDdownHitInfo Is Nothing Then
|
||||
Dim dragSize As Size = SystemInformation.DragSize
|
||||
|
||||
Dim dragRect As Rectangle = New Rectangle(New Point(GRIDdownHitInfo.HitPoint.X - dragSize.Width / 2, GRIDdownHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize)
|
||||
|
||||
If Not dragRect.Contains(New Point(e.X, e.Y)) Then
|
||||
|
||||
view.GridControl.DoDragDrop(GetDragData(view), DragDropEffects.All)
|
||||
|
||||
GRIDdownHitInfo = Nothing
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Function GetDragData(ByVal view As GridView) As String()
|
||||
Dim selection() As Integer = view.GetSelectedRows()
|
||||
If selection Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
Dim count As Integer = selection.Length
|
||||
Dim result(count - 1) As String
|
||||
For i As Integer = 0 To count - 1
|
||||
result(i) = view.GetRowCellDisplayText(selection(i), view.Columns("Record-ID"))
|
||||
Next i
|
||||
Return result
|
||||
End Function
|
||||
Private Sub btnAddUser_FollowUp_Click(sender As Object, e As EventArgs) Handles btnAddUser_FollowUp.Click
|
||||
If cmbFollowUpUser.SelectedIndex <> -1 And FOLL_UP_ID > 0 Then
|
||||
Try
|
||||
@@ -5357,7 +5394,7 @@ Public Class frmConstructor_Main
|
||||
|
||||
Private Sub GridViewDoc_Search_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDoc_Search.FocusedColumnChanged
|
||||
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
Refresh_DocID
|
||||
Refresh_DocID()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -5441,7 +5478,7 @@ Public Class frmConstructor_Main
|
||||
End If
|
||||
Cursor = Cursors.Default
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
|
||||
@@ -5824,7 +5861,7 @@ Public Class frmConstructor_Main
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Unexpected Error in Checking Value In Work: " & ex.Message, False)
|
||||
End Try
|
||||
@@ -5872,7 +5909,7 @@ Public Class frmConstructor_Main
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Unexpected Error in RowStyle-Color Dropdown: " & ex.Message, False)
|
||||
End Try
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -5889,7 +5926,7 @@ Public Class frmConstructor_Main
|
||||
TSMIDisplayname.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Sub File_in_Work()
|
||||
TSMI_inWork.Enabled = True
|
||||
@@ -6040,7 +6077,7 @@ Public Class frmConstructor_Main
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub ActivateAllTabs()
|
||||
@@ -6118,7 +6155,7 @@ Public Class frmConstructor_Main
|
||||
MsgBox(msg, MsgBoxStyle.Critical, "Attention:")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Delete file:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -6129,4 +6166,82 @@ Public Class frmConstructor_Main
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TreeViewMain_DragDrop(sender As Object, e As DragEventArgs) Handles TreeViewMain.DragDrop
|
||||
Try
|
||||
If Not IsNothing(e.Data) Then
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim pt As Point
|
||||
Dim DestinationNode As TreeNode
|
||||
pt = CType(sender, TreeView).PointToClient(New Point(e.X, e.Y))
|
||||
DestinationNode = CType(sender, TreeView).GetNodeAt(pt)
|
||||
Dim node_tag
|
||||
Dim ENTITY_STRING
|
||||
Dim sql
|
||||
If Not IsNothing(DestinationNode) Then
|
||||
node_tag = DestinationNode.Tag
|
||||
If Not IsNumeric(node_tag) Then
|
||||
MsgBox("Could not get a valid Entity!", MsgBoxStyle.Exclamation)
|
||||
Me.Cursor = Cursors.Default
|
||||
Exit Sub
|
||||
End If
|
||||
sql = String.Format("SELECT [dbo].[FNPMO_GETOBJECTCAPTION]('{0}','FORMVIEW_TITLE' + CONVERT(VARCHAR(5), FORM_VIEW_ID), {1}) AS 'CAPTION' " & _
|
||||
"FROM VWPMO_CONSTRUCTOR_FORMS WHERE FORM_ID = {2}", USER_LANGUAGE, CURRENT_SCREEN_ID, node_tag.ToString)
|
||||
ENTITY_STRING = ClassDatabase.Execute_Scalar(sql)
|
||||
sql = String.Format("select count(guid) from TBPMO_CONTROL_ENTITY_LINK where ORIGIN_CTRL_ID in (SELECT GUID FROM TBPMO_CONTROL where FORM_ID = {0}) " & _
|
||||
"AND LINKED_CTRL_ID IN (SELECT GUID FROM TBPMO_CONTROL where FORM_ID = {1})", ENTITY_ID, node_tag)
|
||||
Dim count = ClassDatabase.Execute_Scalar(sql)
|
||||
If Not IsNothing(count) Then
|
||||
If count = 0 Then
|
||||
MsgBox("No configuration for changing entity-link!" & vbNewLine & "Please inform Your ADDi-Admin", MsgBoxStyle.Exclamation)
|
||||
Me.Cursor = Cursors.Default
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Dim msg As String = String.Format("Wollen Sie die ausgewählten Zeilen wirklich der Entität '{0}'zuordnen?", ENTITY_STRING.ToString)
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("Do You really want to change the entity-link of the selected record to '{0}'?", ENTITY_STRING.ToString)
|
||||
End If
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
For Each _RECORD As String In e.Data.GetData(GetType(String()))
|
||||
Dim upd = String.Format("UPDATE TBPMO_RECORD SET FORM_ID = {0} where GUID = {1}", node_tag, _RECORD)
|
||||
If ClassDatabase.Execute_non_Query(upd) = True Then
|
||||
msg = String.Format("ENTITY WAS CHANGED TO {0}-{1} by User: {2}", ENTITY_STRING, node_tag, Environment.UserName)
|
||||
ClassHelper.InsertEssential_Log(_RECORD, "RECORD-ID", msg)
|
||||
sql = "SELECT * FROM VWPMO_WD_DOC_SEARCH WHERE RECORD_ID = " & _RECORD
|
||||
Dim DT_DOCS As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
For Each doc As DataRow In DT_DOCS.Rows
|
||||
Dim DT_INDICES As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPMO_WD_OBJECTTYPE WHERE OBJECT_TYPE = '" & doc.Item("OBJECTTYPE") & "'")
|
||||
ClassWindream.REMOVE_VEKTOR_LINK(doc.Item("DOC_PATH"), DT_INDICES.Rows(0).Item("IDXNAME_ENTITYID"), ENTITY_ID)
|
||||
Next
|
||||
|
||||
sql = String.Format("select ORIGIN_CTRL_ID,LINKED_CTRL_ID from TBPMO_CONTROL_ENTITY_LINK where ORIGIN_CTRL_ID in (SELECT GUID FROM TBPMO_CONTROL where FORM_ID = {0}) " & _
|
||||
"AND LINKED_CTRL_ID IN (SELECT GUID FROM TBPMO_CONTROL where FORM_ID = {1})", ENTITY_ID, node_tag)
|
||||
Dim DT_CHANGE_CTR As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
For Each row As DataRow In DT_CHANGE_CTR.Rows
|
||||
upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET CONTROL_ID = {0}, CHANGED_WHO = '{3}' WHERE CONTROL_ID = {1} AND RECORD_ID = {2}", row.Item("LINKED_CTRL_ID"), row.Item("ORIGIN_CTRL_ID"), _RECORD, Environment.UserName)
|
||||
ClassDatabase.Execute_non_Query(upd)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
msg = String.Format("Der Datensatz wurde erfolgreich auf die Entität {0} verlinked!", ENTITY_STRING.ToString)
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The record was successfully relinked with entity {0}", ENTITY_STRING.ToString)
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
Load_Datafor_Entity()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in DragDrop TreeView: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub TreeViewMain_DragOver(sender As Object, e As DragEventArgs) Handles TreeViewMain.DragOver
|
||||
e.Effect = DragDropEffects.Copy
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user