RH Gafetes acciones

This commit is contained in:
rakcsle
2023-09-08 10:51:35 -07:00
parent 122f17b034
commit 12f330f229
6 changed files with 212 additions and 127 deletions

View File

@@ -682,112 +682,124 @@ Partial Class Bancos_CuentasBancariasDetalle
Else
DivTarjeta.Visible = False
End If
End Sub
End Sub
#End Region
#Region "D A T O S T A R J E TA - C R E D I T O"
Private Sub LkbAgregarTarjera_Click(sender As Object, e As EventArgs) Handles LkbAgregarTarjera.Click
Dim ObjTarjeta As New ClsBancos()
Dim TieneError = False
If Not ObjTarjeta.AddTarjetaCredito(CveCuenta, TxtNumTarjeta.Text, TxtNombreResponsable.Text, TxtFechaVencimiento.Text.ToDate, UsuarioActual.CveUsuario) Then
TieneError = True
End If
If Not TieneError Then
Alert("Se guardo la tarjeta de credito correctamente", TipoMensaje.MsgInformacion)
TxtNumTarjeta.Text = ""
TxtNombreResponsable.Text = ""
TxtFechaVencimiento.Text = ""
CargaDatosTarjeta()
Else
Alert("Ocurrio un Error al Guardar la tarjeta de credito", TipoMensaje.MsgError)
End If
ObjTarjeta.Dispose()
UpDatos.Update()
End Sub
'Private Sub LkbAgregarTarjera_Click(sender As Object, e As EventArgs) Handles LkbAgregarTarjera.Click
' Dim ObjTarjeta As New ClsBancos()
' Dim TieneError = False
' If Not ObjTarjeta.AddTarjetaCredito(CveCuenta, TxtNumTarjeta.Text, TxtNombreResponsable.Text, TxtFechaVencimiento.Text.ToDate, UsuarioActual.CveUsuario) Then
' TieneError = True
' End If
' If Not TieneError Then
' Alert("Se guardo la tarjeta de credito correctamente", TipoMensaje.MsgInformacion)
' TxtNumTarjeta.Text = ""
' TxtNombreResponsable.Text = ""
' TxtFechaVencimiento.Text = ""
' CargaDatosTarjeta()
' Else
' Alert("Ocurrio un Error al Guardar la tarjeta de credito", TipoMensaje.MsgError)
' End If
' ObjTarjeta.Dispose()
' UpDatos.Update()
'End Sub
Private Sub CargaDatosTarjeta()
Dim ObjTarjeta As New ClsBancos()
'Dim ObjTarjeta As New ClsBancos()
'If ObjTarjeta.GetTarjetaCredito(-1, CveCuenta, -1) Then
' GvTarjetas.DataSource = ObjTarjeta.DtResultados()
'Else
' GvTarjetas.DataSource = Nothing
'End If
'GvTarjetas.DataBind()
'ObjTarjeta.Dispose()
Dim ObjCreditos As New ClsBancos
If ObjCreditos.GetTarjetasCreditos(CveCuenta) Then
If ObjCreditos.DtResultados.Rows.Count > 0 Then
GvTC.DataSource = ObjCreditos.DtResultados
End If
GvTC.Visible = True
End If
ObjCreditos.Dispose()
GvTC.DataBind()
If ObjTarjeta.GetTarjetaCredito(-1, CveCuenta, -1) Then
GvTarjetas.DataSource = ObjTarjeta.DtResultados()
Else
GvTarjetas.DataSource = Nothing
End If
GvTarjetas.DataBind()
ObjTarjeta.Dispose()
UpDatos.Update()
End Sub
Private Sub GvTarjetas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvTarjetas.RowEditing
GvTarjetas.EditIndex = e.NewEditIndex
CargaDatosTarjeta()
End Sub
'Private Sub GvTarjetas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvTarjetas.RowEditing
' GvTarjetas.EditIndex = e.NewEditIndex
' CargaDatosTarjeta()
'End Sub
Private Sub GvTarjetas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvTarjetas.RowCancelingEdit
GvTarjetas.EditIndex = -1
CargaDatosTarjeta()
End Sub
'Private Sub GvTarjetas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvTarjetas.RowCancelingEdit
' GvTarjetas.EditIndex = -1
' CargaDatosTarjeta()
'End Sub
Private Sub GvTarjetas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvTarjetas.RowUpdating
Dim ObjTarjeta As New ClsBancos()
Dim TieneError = False
'Private Sub GvTarjetas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvTarjetas.RowUpdating
' Dim ObjTarjeta As New ClsBancos()
' Dim TieneError = False
Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
Dim CveCuenta As Integer = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuenta").ToEntero
Dim Numero = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtNumeroEdit"), TextBox).Text.Trim
Dim Responsable = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtResponsableEdit"), TextBox).Text.Trim
Dim Vencimiento = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtFechaVencimientoEdit"), TextBox).Text.ToDate
' Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
' Dim CveCuenta As Integer = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuenta").ToEntero
' Dim Numero = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtNumeroEdit"), TextBox).Text.Trim
' Dim Responsable = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtResponsableEdit"), TextBox).Text.Trim
' Dim Vencimiento = DirectCast(GvTarjetas.Rows(e.RowIndex).FindControl("TxtFechaVencimientoEdit"), TextBox).Text.ToDate
If Not ObjTarjeta.UpdateTarjetaCredito(CveCuentaTarjeta, CveCuenta, Numero, Responsable, Vencimiento, UsuarioActual.CveUsuario) Then
TieneError = True
Else
GvTarjetas.EditIndex = -1
End If
' If Not ObjTarjeta.UpdateTarjetaCredito(CveCuentaTarjeta, CveCuenta, Numero, Responsable, Vencimiento, UsuarioActual.CveUsuario) Then
' TieneError = True
' Else
' GvTarjetas.EditIndex = -1
' End If
If Not TieneError Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaDatosTarjeta()
Else
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
End If
' If Not TieneError Then
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
' CargaDatosTarjeta()
' Else
' Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
' End If
ObjTarjeta.Dispose()
UpDatos.Update()
End Sub
' ObjTarjeta.Dispose()
' UpDatos.Update()
'End Sub
Private Sub GvTarjetas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvTarjetas.RowDeleting
Dim ObjTarjeta As New ClsBancos()
Dim TieneError = False
'Private Sub GvTarjetas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvTarjetas.RowDeleting
' Dim ObjTarjeta As New ClsBancos()
' Dim TieneError = False
Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
' Dim CveCuentaTarjeta = GvTarjetas.Rows(e.RowIndex).DataKey("CveCuentaTarjeta").ToEntero
If ObjTarjeta.RemoveTarjetaCredito(CveCuentaTarjeta, UsuarioActual.CveUsuario) Then
CargaDatosTarjeta()
Alert("Se eliminaron datos correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Error al eliminar", TipoMensaje.MsgError)
End If
' If ObjTarjeta.RemoveTarjetaCredito(CveCuentaTarjeta, UsuarioActual.CveUsuario) Then
' CargaDatosTarjeta()
' Alert("Se eliminaron datos correctamente", TipoMensaje.MsgInformacion)
' Else
' Alert("Error al eliminar", TipoMensaje.MsgError)
' End If
ObjTarjeta.Dispose()
UpDatos.Update()
End Sub
' ObjTarjeta.Dispose()
' UpDatos.Update()
'End Sub
Private Sub GvTarjetas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTarjetas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(200)
e.Row.Cells(3).Width = Unit.Pixel(20)
e.Row.Cells(4).Width = Unit.Pixel(20)
End If
End If
End Sub
'Private Sub GvTarjetas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTarjetas.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.RowIndex = 0 Then
' e.Row.Cells(0).Width = Unit.Pixel(100)
' e.Row.Cells(1).Width = Unit.Pixel(100)
' e.Row.Cells(2).Width = Unit.Pixel(200)
' e.Row.Cells(3).Width = Unit.Pixel(20)
' e.Row.Cells(4).Width = Unit.Pixel(20)
' End If
' End If
'End Sub
Private Function CargarDdlUsuarios(UsuariosGlobal As DataTable) As DataTable
Dim tablaUsuariosFormateada As DataTable = New DataTable("Usuarios")