105 lines
3.8 KiB
VB.net
105 lines
3.8 KiB
VB.net
|
|
Imports System.CodeDom.Compiler
|
|
Imports DevExpress.Xpf.Core
|
|
Imports System.Reflection
|
|
Imports DevExpress.Xpf.Bars
|
|
Imports tsWPFCore
|
|
Imports tsWPFCore.Comun
|
|
Imports bdGrupoSanchoToro.db
|
|
Imports bdGrupoSanchoToro.db.Utilidades
|
|
|
|
Public Class ucEjerciciosContables
|
|
|
|
|
|
Private bd As tscGrupoSanchoToro
|
|
|
|
|
|
Public Overrides Sub Cargado()
|
|
' AddHandler Me.ContenedorAplicacion.btNuevo.ItemClick, AddressOf Nuevo
|
|
' ap.ContenedorAplicacion.btGuardar.IsVisible = False
|
|
ContenedorAplicacion.siEstado.IsVisible = False
|
|
End Sub
|
|
|
|
'Public Sub EstableceAplicacion(ap As tsWPF.Aplicacion) .EstableceAplicacion
|
|
' Me.ap = ap
|
|
'End Sub
|
|
|
|
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
|
Me.gcEjercicios.ItemsSource = bd.ejercicioscontables.ToList
|
|
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
|
End Function
|
|
|
|
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
|
|
|
End Sub
|
|
|
|
Public Overrides Sub EstableceTitulo()
|
|
If Me.docpanel Is Nothing Then
|
|
Dim w As Window = Window.GetWindow(Me)
|
|
w.Title = "Seleccione Ejercicio Contable"
|
|
Else
|
|
Me.docpanel.Caption = "Ejercicios Contables"
|
|
End If
|
|
End Sub
|
|
|
|
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
|
Get
|
|
Return "EjerciciosContables"
|
|
End Get
|
|
End Property
|
|
|
|
Public Overrides ReadOnly Property NombreTablaBase As String
|
|
Get
|
|
Return "ejercicioscontables"
|
|
End Get
|
|
End Property
|
|
|
|
Public Overrides ReadOnly Property DescripcionRegistro As String
|
|
Get
|
|
Return "Ejercicios Contables"
|
|
End Get
|
|
End Property
|
|
|
|
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
|
bd = tscGrupoSanchoToro.NuevoContexto()
|
|
Return bd
|
|
End Function
|
|
|
|
'Public Overrides Function ObtieneConexionBD() As tsUtilidades.Datos.BBDD
|
|
' Return bdGrupoSanchoToro.gestionasegasaEntities.bdga
|
|
'End Function
|
|
|
|
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
|
Return Comun.ObtienePermisos(Me.bd, "AP.SUPERADMINISTRATIVOS", idUsuario)
|
|
End Function
|
|
|
|
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
|
|
FuncionesDinamicas.AbrirAP(New ucEjercicioContable, OtrosParametros)
|
|
End Sub
|
|
|
|
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
|
|
|
Dim id As Integer = DirectCast(Me.gcEjercicios.CurrentItem, ejercicioscontables).idEjercicio
|
|
' Dim uc As New ucRamo
|
|
' Dim dwi As dxwInicio = Window.GetWindow(Me)
|
|
FuncionesDinamicas.AbrirAP(New ucEjercicioContable(id), OtrosParametros)
|
|
End Sub
|
|
|
|
Private Sub ap_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, OpcionGuardado As Integer) Handles Me.AntesGuardar
|
|
Dim ra As ejercicioscontables = Me.DataContext
|
|
If Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
|
If bd.ejercicioscontables.Any(Function(x) x.idEmpresa = ra.idEmpresa And ((x.FechaInicio >= ra.FechaInicio And x.FechaInicio <= ra.FechaFin) Or (x.FechaFin >= ra.FechaInicio And x.FechaFin <= ra.FechaFin))) Then
|
|
Cancelar = True
|
|
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
'Private Sub TableView_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
|
|
' If Window.GetWindow(Me).GetType Is GetType(tsWPF.dxwVentanaBusqueda) Then
|
|
' Dim dxwvb = DirectCast(Window.GetWindow(Me), tsWPF.dxwVentanaBusqueda)
|
|
' dxwvb.BtAceptar_Click(Nothing, Nothing)
|
|
' End If
|
|
'End Sub
|
|
End Class
|