580 lines
23 KiB
VB.net
580 lines
23 KiB
VB.net
Public Class FRMyMoneda
|
||
|
||
Private Sub FRMyMoneda_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||
|
||
Dim Classcom As New clsComplejo
|
||
Dim ClassCatalogos As New ClassCatalogos
|
||
Dim SQL As String
|
||
Dim FILA As DataRow
|
||
|
||
PnPais.Visible = False
|
||
|
||
Me.Text = "Moneda"
|
||
Me.PnPais.Visible = True
|
||
DesHeader.Text = Me.Text
|
||
'If clsVaribles.lbDemo = True Then Exit Sub
|
||
|
||
Classcom.sbLlenaCombo("select IDPAIS clave,PAISUS nombre from cat_pais", Me.cmbPais)
|
||
cmbPais.SelectedIndex = -1
|
||
'LLENA GRID
|
||
'SQL = "SELECT IdMoneda CLAVE,Moneda NOMBRE,ACTIVO,isnull(ALIASID,'') ALIAS,isnull(IDPAIS,0) PAIS FROM cat_moneda ORDER BY Moneda"
|
||
'SQL = "SELECT IdMoneda CLAVE,Moneda NOMBRE,ACTIVO,isnull(ALIASID,'') ALIAS, 0 AS PAIS FROM cat_moneda ORDER BY Moneda"
|
||
|
||
SQL = "sp_consultarmoneda "
|
||
|
||
ClassCatalogos.LlenaGrid(SQL, Me.GridMaster)
|
||
|
||
TXTAlias.Enabled = False
|
||
txtNombre.Enabled = False
|
||
chkActivo.Enabled = False
|
||
cmbPais.Enabled = False
|
||
ClassCatalogos.CambiaColorbloque2(BtnAgregar, BtnEditar, BtnOk, Button1)
|
||
'Classcom.fdtDataSet(SQL)
|
||
End Sub
|
||
|
||
Private Sub tlbCorteCaja_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
|
||
Dim classcom As New clsComplejo
|
||
Dim strSQLComodin As String
|
||
|
||
Select Case e.Button.Text
|
||
Case "Agregar"
|
||
|
||
'pnlBotones.Visible = True
|
||
|
||
txtClave.Enabled = True
|
||
txtClave.ReadOnly = False
|
||
txtClave.Text = ""
|
||
txtNombre.Text = ""
|
||
'txtNombreIngles.Text = ""
|
||
'cmbOrganismo.Text = ""
|
||
clsVaribles.varProceso = "Agregar"
|
||
txtClave.Focus()
|
||
BtnOk.Enabled = True
|
||
|
||
'txtClave.Enabled = True
|
||
txtClave.Visible = False
|
||
txtNombre.Enabled = True
|
||
'Me.txtNombreIngles.Enabled = True
|
||
'Me.cmbOrganismo.Enabled = True
|
||
Me.chkActivo.Enabled = True
|
||
|
||
Case "Actualizar"
|
||
|
||
'VALIDACION DE CAMPOS
|
||
|
||
'If txtClave.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Numero del Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
'If txtNombre.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Nombre del Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
'If cmbOrganismo.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Organismo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
''pnlBotones.Visible = False
|
||
|
||
'strSQLComodin = "UPDATE PAIS SET Id_Pais = " & TXTNumero.Text & " ,Id_Organismo = " & Me.cmbOrganismo.SelectedIndex & ""
|
||
'strSQLComodin = strSQLComodin & ",Nombre = '" & txtNombre.Text & "',NombreUs = '" & txtNombreIngles.Text & "',Activo = " & Me.chkActivo.CheckState
|
||
'strSQLComodin = strSQLComodin & " where ID_PAIS = " & TXTNumero.Text
|
||
|
||
'classcom.sbInserta(strSQLComodin)
|
||
|
||
''AUDITORIA
|
||
'Dim ClassAud As New ClassMyUtils
|
||
'Dim varUser As Long
|
||
'Dim ClassComodin As New clsComplejo
|
||
''varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
'ClassAud.RT_Auditoria(clsVaribles.varUsuario, 39, My.Computer.Name, "Minds Cliente", "Cambio de Pais CLAVE = " & TXTNumero.Text & " NOMBRE = " & txtNombre.Text)
|
||
''FIN AUDITORIA
|
||
|
||
'MessageBox.Show("Operacion Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
'C1TrueDBGrid1.DataSource = Nothing
|
||
|
||
'clCmp.fdtDataSetTabla("spGridPais 0")
|
||
'Me.C1TrueDBGrid1.SetDataBinding(clCmp.ds, "Tabla") 'Llena el grid
|
||
|
||
'sbIniciaForma()
|
||
|
||
clsVaribles.varProceso = "Actualizar"
|
||
|
||
txtClave.Enabled = False
|
||
'txtClave.Visible = False
|
||
txtNombre.Enabled = True
|
||
'Me.txtNombreIngles.Enabled = True
|
||
'Me.cmbOrganismo.Enabled = True
|
||
|
||
Me.chkActivo.Enabled = True
|
||
|
||
BtnOk.Enabled = True
|
||
|
||
Case "Desactivar"
|
||
|
||
'If TXTNumero.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Numero del Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
'pnlBotones.Visible = False
|
||
|
||
'strSQLComodin = "UPDATE pais SET ACTIVO = 0 where id_pais = " & TXTNumero.Text
|
||
'classcom.sbInserta(strSQLComodin)
|
||
|
||
''AUDITORIA
|
||
'Dim ClassAud As New ClassMyUtils
|
||
'Dim varUser As Long
|
||
'Dim ClassComodin As New clsComplejo
|
||
''varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
'ClassAud.RT_Auditoria(clsVaribles.varUsuario, 38, My.Computer.Name, "Minds Cliente", "Baja de Pais CLAVE = " & TXTNumero.Text & " NOMBRE = " & txtNombre.Text)
|
||
''FIN AUDITORIA
|
||
|
||
'MessageBox.Show("Operacion Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
clsVaribles.varProceso = "Eliminar"
|
||
|
||
txtClave.Enabled = False
|
||
txtNombre.Enabled = False
|
||
'Me.txtNombreIngles.Enabled = False
|
||
'Me.cmbOrganismo.Enabled = False
|
||
'Me.chkActivo.Enabled = False
|
||
|
||
BtnOk.Enabled = True
|
||
|
||
Case "Salir"
|
||
Me.Close()
|
||
End Select
|
||
|
||
End Sub
|
||
|
||
|
||
Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||
Dim classcom As New clsComplejo
|
||
Dim strSQLComodin As String
|
||
|
||
Dim ClassAud As New ClassMyUtils
|
||
Dim varUser As Long
|
||
Dim ClassComodin As New clsComplejo
|
||
|
||
Select Case UCase(clsVaribles.varProceso)
|
||
|
||
Case Is = "AGREGAR"
|
||
|
||
txtClave.Enabled = True
|
||
|
||
'VALIDACION DE CAMPOS
|
||
|
||
'If txtClave.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Numero del Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
If txtNombre.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Nombre ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
'If cmbOrganismo.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Organismo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
strSQLComodin = "SELECT id_moneda FROM moneda WHERE nombre = '" & txtNombre.Text & "'"
|
||
|
||
If classcom.BuscaDatos(strSQLComodin) Then
|
||
MessageBox.Show("Este Nombre de la Moneda ya Existe en el Catalogo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
strSQLComodin = "INSERT INTO moneda (nombre,Id_Catalogo,Activo) VALUES ("
|
||
strSQLComodin = strSQLComodin & "'" & txtNombre.Text & "',13," & Me.chkActivo.CheckState & ")"
|
||
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
'AUDITORIA
|
||
|
||
'varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 31, 1, txtNombre.Text)
|
||
|
||
' ClassAud.RT_Auditoria(clsVaribles.varUsuario, 31, My.Computer.Name, "Minds Cliente", "Alta de Moneda CLAVE = " & txtClave.Text & " NOMBRE = " & txtNombre.Text)
|
||
'FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
|
||
Case Is = "ACTUALIZAR"
|
||
|
||
'VALIDACION DE CAMPOS
|
||
|
||
If txtClave.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Numero de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
If txtNombre.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Nombre de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
'If cmbOrganismo.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Organismo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
'pnlBotones.Visible = False
|
||
|
||
strSQLComodin = "UPDATE Moneda SET "
|
||
strSQLComodin = strSQLComodin & " nombre = '" & txtNombre.Text & "',Activo = " & Me.chkActivo.CheckState
|
||
strSQLComodin = strSQLComodin & " where id_moneda = " & txtClave.Text
|
||
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
'AUDITORIA
|
||
'Dim ClassAud As New ClassMyUtils
|
||
'Dim varUser As Long
|
||
'Dim ClassComodin As New clsComplejo
|
||
'varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 33, 1, txtNombre.Text)
|
||
|
||
' ClassAud.RT_Auditoria(clsVaribles.varUsuario, 33, My.Computer.Name, "Minds Cliente", "Cambio de Moneda CLAVE = " & txtClave.Text & " NOMBRE = " & txtNombre.Text)
|
||
'FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
classcom = New clsComplejo
|
||
'classcom.fdtDataSetTabla("spGridPais 0")
|
||
'Me.GridMaster.SetDataBinding(classcom.ds, "Tabla") 'Llena el grid
|
||
|
||
'MessageBox.Show("Operacion Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
Case Is = "ELIMINAR"
|
||
|
||
If txtClave.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Numero de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
'pnlBotones.Visible = False
|
||
|
||
strSQLComodin = "UPDATE moneda SET ACTIVO = 0 where id_moneda = " & txtClave.Text
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
''AUDITORIA
|
||
'Dim ClassAud As New ClassMyUtils
|
||
'Dim varUser As Long
|
||
'Dim ClassComodin As New clsComplejo
|
||
''varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 33, 1, txtNombre.Text)
|
||
|
||
' ClassAud.RT_Auditoria(clsVaribles.varUsuario, 32, My.Computer.Name, "Minds Cliente", "Baja de Moneda CLAVE = " & txtClave.Text & " NOMBRE = " & txtNombre.Text)
|
||
''FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
|
||
|
||
End Select
|
||
|
||
BtnOk.Enabled = False
|
||
|
||
|
||
Dim SQL As String
|
||
Dim CLASSCATALOGOS As New ClassCatalogos
|
||
|
||
GridMaster.DataSource = Nothing
|
||
|
||
SQL = "SELECT id_moneda CLAVE,NOMBRE NOMBRE,ACTIVO FROM moneda ORDER BY nombre"
|
||
CLASSCATALOGOS.LlenaGrid(SQL, Me.GridMaster)
|
||
|
||
CLASSCATALOGOS.sbLimpiaControlesEsp(PnPais)
|
||
|
||
End Sub
|
||
|
||
Private Sub BtnAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAgregar.Click
|
||
|
||
'If clsVaribles.lbDemo = True Then Exit Sub
|
||
|
||
'pnlBotones.Visible = True
|
||
|
||
txtClave.Enabled = True
|
||
txtClave.ReadOnly = True
|
||
txtClave.Text = ""
|
||
txtNombre.Text = ""
|
||
'txtNombreIngles.Text = ""
|
||
'cmbOrganismo.Text = ""
|
||
clsVaribles.varProceso = "Agregar"
|
||
'txtClave.Focus()
|
||
|
||
BtnOk.Enabled = True
|
||
|
||
Me.TXTAlias.Enabled = True
|
||
Me.TXTAlias.Clear()
|
||
Me.cmbPais.Enabled = True
|
||
Me.cmbPais.SelectedIndex = -1
|
||
|
||
'txtClave.Enabled = True
|
||
txtClave.Visible = True
|
||
txtNombre.Enabled = True
|
||
'Me.txtNombreIngles.Enabled = True
|
||
'Me.cmbOrganismo.Enabled = True
|
||
BtnEditar.Enabled = False
|
||
Me.chkActivo.Enabled = True
|
||
TXTAlias.Focus()
|
||
cmbPais.Enabled = True
|
||
cmbPais.Text = ""
|
||
ClassCatalogos.CambiaColorbloque2(BtnAgregar, BtnEditar, BtnOk, Button1)
|
||
End Sub
|
||
|
||
Private Sub BtnEditar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEditar.Click
|
||
|
||
'If clsVaribles.lbDemo = True Then Exit Sub
|
||
|
||
clsVaribles.varProceso = "Actualizar"
|
||
|
||
txtClave.Enabled = False
|
||
'txtClave.Visible = False
|
||
txtNombre.Enabled = True
|
||
'Me.txtNombreIngles.Enabled = True
|
||
'Me.cmbOrganismo.Enabled = True
|
||
|
||
TXTAlias.Enabled = True
|
||
Me.cmbPais.Enabled = True
|
||
|
||
Me.chkActivo.Enabled = True
|
||
|
||
BtnOk.Enabled = True
|
||
|
||
BtnEditar.Enabled = False
|
||
TXTAlias.Focus()
|
||
cmbPais.Enabled = True
|
||
ClassCatalogos.CambiaColorbloque2(BtnAgregar, BtnEditar, BtnOk, Button1)
|
||
End Sub
|
||
|
||
Private Sub BtnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOk.Click
|
||
|
||
|
||
'If clsVaribles.lbDemo = True Then Exit Sub
|
||
|
||
Dim classcom As New clsComplejo
|
||
Dim strSQLComodin As String
|
||
Dim ValorPais As Integer = 0
|
||
|
||
Dim ClassAud As New ClassMyUtils
|
||
Dim varUser As Long
|
||
Dim ClassComodin As New clsComplejo
|
||
|
||
Select Case UCase(clsVaribles.varProceso)
|
||
|
||
Case Is = "AGREGAR"
|
||
|
||
'txtClave.Enabled = True
|
||
|
||
'VALIDACION DE CAMPOS
|
||
|
||
'If txtClave.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Numero del Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
If txtNombre.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Nombre ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
txtNombre.Focus()
|
||
Exit Sub
|
||
End If
|
||
|
||
'If cmbPais.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Pais ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
strSQLComodin = "SELECT IdMoneda FROM CAT_moneda WHERE Nombre = '" & txtNombre.Text & "'"
|
||
|
||
If classcom.BuscaDatos(strSQLComodin) Then
|
||
MessageBox.Show("Este Nombre de la Moneda ya Existe en el Catalogo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
Exit Sub
|
||
End If
|
||
|
||
'If cmbPais.SelectedValue = Nothing Then
|
||
' ValorPais = 0
|
||
'Else
|
||
' ValorPais = cmbPais.SelectedValue
|
||
'End If
|
||
|
||
'strSQLComodin = "INSERT INTO cat_moneda (Moneda,aliasID,Activo,idpais,idmoneda) VALUES ("
|
||
'strSQLComodin = strSQLComodin & "'" & txtNombre.Text & "','" & Me.TXTAlias.Text & "'," & Me.chkActivo.CheckState & "," & ValorPais & ",'" & txtClave.Text & "')"
|
||
|
||
|
||
'strSQLComodin = "INSERT INTO cat_moneda (Moneda,aliasID,Activo,idmoneda) VALUES ("
|
||
'strSQLComodin = strSQLComodin & "'" & txtNombre.Text & "','" & Me.TXTAlias.Text & "'," & Me.chkActivo.CheckState & "," & ValorPais & ",'" & txtClave.Text & "')"
|
||
|
||
|
||
strSQLComodin = "sp_CargarMoneda " & "NULL,'" & txtNombre.Text.Trim & "','" & TXTAlias.Text.Trim & "','" & cmbPais.Text & "'," & chkActivo.Checked
|
||
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
'AUDITORIA
|
||
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 31, 1, " | Valores Nuevos: idmoneda: " & txtClave.Text & ", Moneda = " & txtNombre.Text & ",Activo = " & Me.chkActivo.CheckState & ",aliasid = " & Me.TXTAlias.Text & ", Pais: " & cmbPais.Text)
|
||
'FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
|
||
Case Is = "ACTUALIZAR"
|
||
|
||
'VALIDACION DE CAMPOS
|
||
ValorPais = cmbPais.SelectedValue
|
||
If txtClave.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Numero de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
Exit Sub
|
||
End If
|
||
|
||
If txtNombre.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Nombre de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
txtNombre.Focus()
|
||
Exit Sub
|
||
End If
|
||
|
||
'If cmbOrganismo.Text = "" Then
|
||
' MessageBox.Show("Es Necesario Introducir el Organismo ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
' Exit Sub
|
||
'End If
|
||
|
||
'pnlBotones.Visible = False
|
||
'clsVaribles.lsValAnt = ClassAud.FnObtenValAnterior("sp_consultarmoneda " & txtClave.Text)
|
||
|
||
'strSQLComodin = "UPDATE cat_Moneda SET "
|
||
'strSQLComodin = strSQLComodin & " Moneda = '" & txtNombre.Text & "',Activo = " & Me.chkActivo.CheckState & ",aliasid = '" & Me.TXTAlias.Text & "',idpais = " & ValorPais
|
||
'strSQLComodin = strSQLComodin & " where idmoneda = '" & txtClave.Text & "'"
|
||
|
||
'strSQLComodin = "UPDATE cat_Moneda SET "
|
||
'strSQLComodin = strSQLComodin & " NOMBRE = '" & txtNombre.Text & "',Activo = " & Me.chkActivo.CheckState & ","
|
||
'strSQLComodin = strSQLComodin & " where idmoneda = " & txtClave.Text & ""
|
||
|
||
strSQLComodin = "sp_CargarMoneda " & txtClave.Text & ",'" & txtNombre.Text.Trim & "','" & TXTAlias.Text.Trim & "','" & cmbPais.Text & "'," & chkActivo.Checked
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
'AUDITORIA
|
||
|
||
'pnlBotones.Visible = False
|
||
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 33, 1, clsVaribles.lsValAnt & " | Valores Nuevos: idmoneda: " & txtClave.Text & ", Moneda = " & txtNombre.Text & ",Activo = " & Me.chkActivo.CheckState & ",aliasid = " & Me.TXTAlias.Text & ", Pais: " & cmbPais.Text)
|
||
|
||
'FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
classcom = New clsComplejo
|
||
|
||
'classcom.fdtDataSetTabla("spGridPais 0")
|
||
'Me.GridMaster.SetDataBinding(classcom.ds, "Tabla") 'Llena el grid
|
||
|
||
'MessageBox.Show("Operacion Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
Case Is = "ELIMINAR"
|
||
|
||
If txtClave.Text = "" Then
|
||
MessageBox.Show("Es Necesario Introducir el Numero de la Moneda ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||
Exit Sub
|
||
End If
|
||
|
||
'pnlBotones.Visible = False
|
||
|
||
strSQLComodin = "UPDATE moneda SET ACTIVO = 0 where id_moneda = " & txtClave.Text
|
||
classcom.sbInserta(strSQLComodin)
|
||
|
||
''AUDITORIA
|
||
'Dim ClassAud As New ClassMyUtils
|
||
'Dim varUser As Long
|
||
'Dim ClassComodin As New clsComplejo
|
||
''varUser = ClassComodin.BuscaValores("IdUsuario", "usuario", "usuario = '" & My.User.Name & "'")
|
||
'ClassAud.RT_Auditoria(clsVaribles.varUsuario, 32, My.Computer.Name, "Minds Cliente", "Baja de Moneda CLAVE = " & txtClave.Text & " NOMBRE = " & txtNombre.Text)
|
||
''FIN AUDITORIA
|
||
|
||
MessageBox.Show("Operaci<EFBFBD>n Satisfactoria ", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||
|
||
|
||
|
||
End Select
|
||
|
||
BtnOk.Enabled = False
|
||
|
||
|
||
Dim SQL As String
|
||
Dim CLASSCATALOGOS As New ClassCatalogos
|
||
|
||
GridMaster.DataSource = Nothing
|
||
|
||
'SQL = "SELECT IdMoneda CLAVE,Moneda NOMBRE,ACTIVO,ALIASID ALIAS,IDPAIS PAIS FROM cat_moneda ORDER BY Moneda"
|
||
'SQL = "SELECT IdMoneda CLAVE,Moneda NOMBRE,ACTIVO,ALIASID ALIAS,0 AS PAIS FROM cat_moneda ORDER BY Moneda"
|
||
|
||
SQL = "sp_consultarmoneda "
|
||
|
||
CLASSCATALOGOS.LlenaGrid(SQL, Me.GridMaster)
|
||
|
||
txtClave.Text = ""
|
||
TXTAlias.Text = ""
|
||
txtNombre.Text = ""
|
||
cmbPais.Text = ""
|
||
cmbPais.SelectedIndex = -1
|
||
cmbPais.SelectedIndex = -1
|
||
cmbPais.Enabled = False
|
||
chkActivo.Checked = False
|
||
txtClave.Enabled = False
|
||
TXTAlias.Enabled = False
|
||
txtNombre.Enabled = False
|
||
chkActivo.Enabled = False
|
||
|
||
'CLASSCATALOGOS.sbLimpiaControlesEsp(PnPais)
|
||
ClassCatalogos.CambiaColorbloque2(BtnAgregar, BtnEditar, BtnOk, Button1)
|
||
|
||
|
||
End Sub
|
||
|
||
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
||
Me.Close()
|
||
End Sub
|
||
|
||
Private Sub GridMaster_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridMaster.DoubleClick
|
||
'Recupero Datos del gird
|
||
txtClave.Text = Me.GridMaster.Columns("CLAVE").Value
|
||
txtNombre.Text = Me.GridMaster.Columns("Nombre").Value
|
||
TXTAlias.Text = GridMaster.Columns("CLAVEMONEDA").Value
|
||
cmbPais.Text = GridMaster.Columns("PAIS").Value
|
||
chkActivo.Checked = GridMaster.Columns("ACTIVO").Value
|
||
'Me.TXTAlias.Text = Me.GridMaster.Columns("alias").Value
|
||
'Me.cmbPais.SelectedValue = Me.GridMaster.Columns("PAIS").Value
|
||
'Me.txtNombreIngles.Text = Me.GridMaster.Columns("NOMBREUS").Value
|
||
'Me.cmbOrganismo.ValueMember = Me.C1TrueDBGrid1.Columns("Id_Organismo").Text
|
||
'Me.cmbOrganismo.SelectedValue = Me.GridMaster.Columns("Organismo").Value
|
||
'Me.chkActivo.Checked = Me.GridMaster.Columns("ACTIVO").Value
|
||
'Hago una consulta ala base de datos para recuperar la clasificacion del pais
|
||
|
||
txtClave.Visible = True
|
||
txtClave.Enabled = False
|
||
txtNombre.Enabled = False
|
||
Me.TXTAlias.Enabled = False
|
||
Me.cmbPais.Enabled = False
|
||
'Me.txtNombreIngles.Enabled = False
|
||
'Me.cmbOrganismo.Enabled = False
|
||
|
||
Me.chkActivo.Enabled = False
|
||
|
||
Dim SQL As String = ""
|
||
|
||
'SQL = fsDefineSQL("spGridPaisClasificacion ")
|
||
'clCmp1.fdtDataSetTabla(SQL)
|
||
|
||
txtClave.Enabled = False
|
||
|
||
'pnlBotones.Visible = False
|
||
|
||
BtnEditar.Enabled = True
|
||
ClassCatalogos.CambiaColorbloque2(BtnAgregar, BtnEditar, BtnOk, Button1)
|
||
End Sub
|
||
|
||
|
||
End Class |