75 lines
3.7 KiB
VB.net
75 lines
3.7 KiB
VB.net
Imports System
|
|
Imports System.ComponentModel
|
|
Imports System.Collections.Generic
|
|
Imports System.Diagnostics
|
|
Imports System.Text
|
|
|
|
Imports DevExpress.ExpressApp
|
|
Imports DevExpress.ExpressApp.Actions
|
|
Imports DevExpress.Persistent.Base
|
|
Imports DevExpress.ExpressApp.Model
|
|
Imports DevExpress.ExpressApp.Utils
|
|
|
|
Public Class HRPersonTasks_VC
|
|
Inherits DevExpress.ExpressApp.ViewController
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
InitializeComponent()
|
|
RegisterActions(components)
|
|
End Sub
|
|
Protected Overrides Sub OnActivated()
|
|
MyBase.OnActivated()
|
|
If View.Id = "HRPersonTasks_ListView_CurrentUser" Then
|
|
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
|
Dim _ListView As ListView = TryCast(View, ListView)
|
|
If _ListView IsNot Nothing Then
|
|
Dim _User As DevExpress.Persistent.BaseImpl.User = TryCast(SecuritySystem.CurrentUser, DevExpress.Persistent.BaseImpl.User)
|
|
|
|
_ListView.CollectionSource.BeginUpdateCriteria()
|
|
_ListView.CollectionSource.Criteria.Add("CurrentUser", DevExpress.Data.Filtering.CriteriaOperator.Parse("HRPersonAlias.User=? OR HRPerson.User=?", _ocur.GetObject(_User), _ocur.GetObject(_User)))
|
|
_ListView.CollectionSource.EndUpdateCriteria()
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
Protected Overrides Sub OnDeactivated()
|
|
MyBase.OnDeactivated()
|
|
|
|
End Sub
|
|
Private Sub aHRPersonTask_SetViewID_CustomizePopupWindowParams(sender As Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aHRPersonTask_SetViewID.CustomizePopupWindowParams
|
|
Try
|
|
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
|
|
|
|
Dim _CS As New CollectionSource(_onew, GetType(HRPErsonTask_ViewList_PopUp))
|
|
|
|
For Each _Node As IModelView In View.Model.Application.Views
|
|
If _Node.Id Like "@@*" Then
|
|
Dim _HRPErsonTask_ViewList_PopUp As HRPErsonTask_ViewList_PopUp = _onew.CreateObject(Of HRPErsonTask_ViewList_PopUp)()
|
|
_HRPErsonTask_ViewList_PopUp.IDName = _Node.Id
|
|
_HRPErsonTask_ViewList_PopUp.IDCaption = _Node.Caption
|
|
_CS.Add(_HRPErsonTask_ViewList_PopUp)
|
|
End If
|
|
Next _Node
|
|
|
|
e.View = Application.CreateListView("HRPErsonTask_ViewList_PopUp_ListView", _CS, False)
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\SISBusinessExceptions", "MsgBoxCheckItAgain")))
|
|
End Try
|
|
End Sub
|
|
Private Sub aHRPersonTask_SetViewID_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aHRPersonTask_SetViewID.Execute
|
|
Try
|
|
Dim _ocur As Xpo.XPObjectSpace = View.ObjectSpace
|
|
Dim _HRPErsonTask_ViewList_PopUp As HRPErsonTask_ViewList_PopUp = TryCast(e.PopupWindow.View.SelectedObjects(0), HRPErsonTask_ViewList_PopUp)
|
|
If _HRPErsonTask_ViewList_PopUp Is Nothing Then Throw New Exception("*Nem lett kiválasztva egyetlen sor sem!")
|
|
|
|
Dim _HRPersonTasks As HRPersonTasks = TryCast(View.SelectedObjects(0), HRPersonTasks)
|
|
If _HRPersonTasks Is Nothing Then Throw New Exception("*Váratlan hiba történt, a folyamat megszakadt!")
|
|
_HRPersonTasks.ViewID = _HRPErsonTask_ViewList_PopUp.IDName
|
|
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\SISBusinessExceptions", "MsgBoxCheckItAgain")))
|
|
End Try
|
|
End Sub
|
|
End Class
|