client/Reportes/PersonasRelacionadasDet.vb

497 lines
20 KiB
VB.net
Raw Permalink Blame History

Public Class PersonasRelacionadasDet
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents txtNoCuenta As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents cboClaveInst As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtNombre As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents txtApaterno As System.Windows.Forms.TextBox
Friend WithEvents txtAmaterno As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Private WithEvents panel2 As Panel
Private WithEvents Img_logoCabecera As PictureBox
Friend WithEvents desHeader As Label
Private WithEvents panel3 As Panel
Friend WithEvents Label6 As Label
Friend WithEvents lblFooter As Label
Friend WithEvents btnGuardar As Button
Friend WithEvents Button1 As Button
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PersonasRelacionadasDet))
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.Label1 = New System.Windows.Forms.Label()
Me.txtNoCuenta = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.cboClaveInst = New System.Windows.Forms.ComboBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtNombre = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtApaterno = New System.Windows.Forms.TextBox()
Me.txtAmaterno = New System.Windows.Forms.TextBox()
Me.Label5 = New System.Windows.Forms.Label()
Me.panel2 = New System.Windows.Forms.Panel()
Me.Img_logoCabecera = New System.Windows.Forms.PictureBox()
Me.desHeader = New System.Windows.Forms.Label()
Me.panel3 = New System.Windows.Forms.Panel()
Me.Label6 = New System.Windows.Forms.Label()
Me.lblFooter = New System.Windows.Forms.Label()
Me.btnGuardar = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.panel2.SuspendLayout()
CType(Me.Img_logoCabecera, System.ComponentModel.ISupportInitialize).BeginInit()
Me.panel3.SuspendLayout()
Me.SuspendLayout()
'
'ImageList1
'
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Turquoise
Me.ImageList1.Images.SetKeyName(0, "")
Me.ImageList1.Images.SetKeyName(1, "")
Me.ImageList1.Images.SetKeyName(2, "")
Me.ImageList1.Images.SetKeyName(3, "")
Me.ImageList1.Images.SetKeyName(4, "")
Me.ImageList1.Images.SetKeyName(5, "")
Me.ImageList1.Images.SetKeyName(6, "")
Me.ImageList1.Images.SetKeyName(7, "")
Me.ImageList1.Images.SetKeyName(8, "")
Me.ImageList1.Images.SetKeyName(9, "")
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label1.Location = New System.Drawing.Point(16, 105)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(61, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "No. Cuenta"
'
'txtNoCuenta
'
Me.txtNoCuenta.Location = New System.Drawing.Point(107, 98)
Me.txtNoCuenta.MaxLength = 50
Me.txtNoCuenta.Name = "txtNoCuenta"
Me.txtNoCuenta.Size = New System.Drawing.Size(227, 20)
Me.txtNoCuenta.TabIndex = 1
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label2.Location = New System.Drawing.Point(16, 132)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(85, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Clave Instituci<63>n"
'
'cboClaveInst
'
Me.cboClaveInst.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboClaveInst.FormattingEnabled = True
Me.cboClaveInst.Location = New System.Drawing.Point(107, 124)
Me.cboClaveInst.Name = "cboClaveInst"
Me.cboClaveInst.Size = New System.Drawing.Size(588, 21)
Me.cboClaveInst.TabIndex = 3
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label3.Location = New System.Drawing.Point(16, 157)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(44, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Nombre"
'
'txtNombre
'
Me.txtNombre.Location = New System.Drawing.Point(107, 151)
Me.txtNombre.MaxLength = 100
Me.txtNombre.Name = "txtNombre"
Me.txtNombre.Size = New System.Drawing.Size(227, 20)
Me.txtNombre.TabIndex = 5
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label4.Location = New System.Drawing.Point(16, 184)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(57, 13)
Me.Label4.TabIndex = 6
Me.Label4.Text = "A. Paterno"
'
'txtApaterno
'
Me.txtApaterno.Location = New System.Drawing.Point(107, 177)
Me.txtApaterno.MaxLength = 100
Me.txtApaterno.Name = "txtApaterno"
Me.txtApaterno.Size = New System.Drawing.Size(227, 20)
Me.txtApaterno.TabIndex = 7
'
'txtAmaterno
'
Me.txtAmaterno.Location = New System.Drawing.Point(468, 177)
Me.txtAmaterno.MaxLength = 100
Me.txtAmaterno.Name = "txtAmaterno"
Me.txtAmaterno.Size = New System.Drawing.Size(227, 20)
Me.txtAmaterno.TabIndex = 9
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.ForeColor = System.Drawing.Color.MidnightBlue
Me.Label5.Location = New System.Drawing.Point(377, 184)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(59, 13)
Me.Label5.TabIndex = 8
Me.Label5.Text = "A. Materno"
'
'panel2
'
Me.panel2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.panel2.BackColor = System.Drawing.Color.Black
Me.panel2.Controls.Add(Me.Img_logoCabecera)
Me.panel2.Controls.Add(Me.desHeader)
Me.panel2.ForeColor = System.Drawing.Color.Navy
Me.panel2.Location = New System.Drawing.Point(-4, -3)
Me.panel2.Name = "panel2"
Me.panel2.Size = New System.Drawing.Size(851, 44)
Me.panel2.TabIndex = 162
'
'Img_logoCabecera
'
Me.Img_logoCabecera.Image = Global.CLIENTE.My.Resources.Resources.blackrock_logo
Me.Img_logoCabecera.Location = New System.Drawing.Point(730, -6)
Me.Img_logoCabecera.Name = "Img_logoCabecera"
Me.Img_logoCabecera.Size = New System.Drawing.Size(117, 52)
Me.Img_logoCabecera.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.Img_logoCabecera.TabIndex = 360
Me.Img_logoCabecera.TabStop = False
'
'desHeader
'
Me.desHeader.AutoSize = True
Me.desHeader.BackColor = System.Drawing.Color.Transparent
Me.desHeader.Font = New System.Drawing.Font("Century Gothic", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.desHeader.ForeColor = System.Drawing.SystemColors.Window
Me.desHeader.Location = New System.Drawing.Point(21, 8)
Me.desHeader.Name = "desHeader"
Me.desHeader.Size = New System.Drawing.Size(70, 22)
Me.desHeader.TabIndex = 2
Me.desHeader.Text = "Perfiles"
'
'panel3
'
Me.panel3.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.panel3.BackColor = System.Drawing.Color.Black
Me.panel3.Controls.Add(Me.Label6)
Me.panel3.Controls.Add(Me.lblFooter)
Me.panel3.ForeColor = System.Drawing.Color.Navy
Me.panel3.Location = New System.Drawing.Point(-4, 277)
Me.panel3.Name = "panel3"
Me.panel3.Size = New System.Drawing.Size(851, 33)
Me.panel3.TabIndex = 364
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.BackColor = System.Drawing.Color.Transparent
Me.Label6.Font = New System.Drawing.Font("Century Gothic", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.ForeColor = System.Drawing.SystemColors.Window
Me.Label6.Location = New System.Drawing.Point(681, 1)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(42, 17)
Me.Label6.TabIndex = 3
Me.Label6.Text = "Minds"
'
'lblFooter
'
Me.lblFooter.AutoSize = True
Me.lblFooter.BackColor = System.Drawing.Color.Transparent
Me.lblFooter.Font = New System.Drawing.Font("Century Gothic", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblFooter.ForeColor = System.Drawing.SystemColors.Window
Me.lblFooter.Location = New System.Drawing.Point(1019, 7)
Me.lblFooter.Name = "lblFooter"
Me.lblFooter.Size = New System.Drawing.Size(42, 17)
Me.lblFooter.TabIndex = 2
Me.lblFooter.Text = "Minds"
'
'btnGuardar
'
Me.btnGuardar.BackColor = System.Drawing.Color.Black
Me.btnGuardar.Cursor = System.Windows.Forms.Cursors.Hand
Me.btnGuardar.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnGuardar.ForeColor = System.Drawing.Color.White
Me.btnGuardar.Location = New System.Drawing.Point(726, 117)
Me.btnGuardar.Name = "btnGuardar"
Me.btnGuardar.Size = New System.Drawing.Size(106, 33)
Me.btnGuardar.TabIndex = 365
Me.btnGuardar.Text = "Guardar"
Me.btnGuardar.UseVisualStyleBackColor = False
'
'Button1
'
Me.Button1.BackColor = System.Drawing.Color.Black
Me.Button1.Cursor = System.Windows.Forms.Cursors.Hand
Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button1.ForeColor = System.Drawing.Color.White
Me.Button1.Location = New System.Drawing.Point(726, 213)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(106, 33)
Me.Button1.TabIndex = 366
Me.Button1.Text = "Cerrar"
Me.Button1.UseVisualStyleBackColor = False
'
'PersonasRelacionadasDet
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(844, 304)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.btnGuardar)
Me.Controls.Add(Me.panel3)
Me.Controls.Add(Me.panel2)
Me.Controls.Add(Me.txtAmaterno)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.txtApaterno)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.txtNombre)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.cboClaveInst)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.txtNoCuenta)
Me.Controls.Add(Me.Label1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "PersonasRelacionadasDet"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Agregar / Modificar Personas Relacionadas"
Me.panel2.ResumeLayout(False)
Me.panel2.PerformLayout()
CType(Me.Img_logoCabecera, System.ComponentModel.ISupportInitialize).EndInit()
Me.panel3.ResumeLayout(False)
Me.panel3.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Public ClaveInstitucion As String
Public ModoNuevo As Boolean
Public IdElemento As String
Public IdTransaccion As String
Public IdPatron As String
Public IdTipoAlarma As String
Public IdProducto As String
Private Sub PersonasRelacionadasDet_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim cargarCbo As New clsComplejo
Dim sSQL As String
Try
''Llenar combo de estados
sSQL = "SELECT CLAVE, RAZONSOCIAL Nombre FROM cat_CASFIM_ext ORDER BY RAZONSOCIAL"
cargarCbo.sbLlenaCombo(sSQL, cboClaveInst)
Catch ex As Exception
MessageBox.Show(ex.Message, "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
If ModoNuevo = True Then
cboClaveInst.SelectedIndex = -1
txtNoCuenta.Text = ""
txtNombre.Text = ""
txtApaterno.Text = ""
txtAmaterno.Text = ""
Else
If ClaveInstitucion <> Nothing Then
cboClaveInst.SelectedValue = ClaveInstitucion
End If
End If
If clsVaribles.Id_EstatusTransaccion = "4" Or clsVaribles.Id_EstatusTransaccion = "5" Then
BloquearControles()
End If
desHeader.Text = Me.Text
End Sub
Sub BloquearControles()
txtNoCuenta.Enabled = False
cboClaveInst.Enabled = False
txtNombre.Enabled = False
txtApaterno.Enabled = False
txtAmaterno.Enabled = False
btnGuardar.Enabled = False
End Sub
Private Sub btnCancelar_Click(sender As System.Object, e As System.EventArgs)
Me.Close()
End Sub
Private Sub btnGuardar_Click(sender As System.Object, e As System.EventArgs)
Dim clsCom As New clsComplejo
Dim sSQL As String
Try
If Not DatosValidos() Then
MessageBox.Show("Revise por favor los datos de cuenta, instituci<63>n y nombre.", "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
If ModoNuevo = True Then
sSQL = "insert into PersonasRelacionadas values(" & IdTransaccion & "," & IdProducto &
"," & IdPatron & "," & IdTipoAlarma & ",'" & txtNoCuenta.Text.Trim() &
"','" & cboClaveInst.SelectedValue & "','" & txtNombre.Text.Trim() &
"','" & txtApaterno.Text.Trim() & "','" & txtAmaterno.Text.Trim() & "')"
clsCom.sbGuardaModifica(sSQL) 'Ejecuta query
''-- se cambio el suceso a 4 -cambio estatuis transaccion , tipo a 2 , que es el que esta en la base (4,2)
''-- antes tenia 112, 1, ademas estas no existen en la base, (cuales son)
' ''Auditoria
'Dim sTextoAud As String
'sTextoAud = "Reportado por:" & txtReportadoPor.Text & ", Nombre:" & txtNombre.Text & ", No. Referencia:" & txtNo_Referencia.Text & ", Estatus:" & cmbEstatus.Text & ", IdProducto:" & clsVAr.Id_Producto & ", Patron:" & clsVAr.Id_Patron
'ClassAud.RT_Auditoria(clsVaribles.varUsuario, 112, 1, "Cambio de estatus de alarma: " & sTextoAud)
Else
sSQL = "update PersonasRelacionadas set NoCuenta = '" & txtNoCuenta.Text.Trim() & "'," &
" ClaveCNBVInstitucion = '" & cboClaveInst.SelectedValue & "'," &
" Nombre='" & txtNombre.Text.Trim() & "'," &
" APaterno='" & txtApaterno.Text.Trim() & "'," &
" AMaterno='" & txtAmaterno.Text.Trim() & "'" &
" WHERE IdElemento = " & IdElemento
clsCom.sbGuardaModifica(sSQL)
End If
Me.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
Function DatosValidos() As Boolean
If txtNoCuenta.Text.Trim() = "" Or txtNombre.Text.Trim() = "" Or cboClaveInst.SelectedIndex = -1 Then
Return False
Else
Return True
End If
End Function
Private Sub BtnAlta_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click
Dim clsCom As New clsComplejo
Dim sSQL As String
Try
If Not DatosValidos() Then
MessageBox.Show("Revise por favor los datos de cuenta, instituci<63>n y nombre.", "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
If ModoNuevo = True Then
sSQL = "insert into PersonasRelacionadas values(" & IdTransaccion & "," & IdProducto &
"," & IdPatron & "," & IdTipoAlarma & ",'" & txtNoCuenta.Text.Trim() &
"','" & cboClaveInst.SelectedValue & "','" & txtNombre.Text.Trim() &
"','" & txtApaterno.Text.Trim() & "','" & txtAmaterno.Text.Trim() & "')"
clsCom.sbGuardaModifica(sSQL) 'Ejecuta query
''-- se cambio el suceso a 4 -cambio estatuis transaccion , tipo a 2 , que es el que esta en la base (4,2)
''-- antes tenia 112, 1, ademas estas no existen en la base, (cuales son)
' ''Auditoria
'Dim sTextoAud As String
'sTextoAud = "Reportado por:" & txtReportadoPor.Text & ", Nombre:" & txtNombre.Text & ", No. Referencia:" & txtNo_Referencia.Text & ", Estatus:" & cmbEstatus.Text & ", IdProducto:" & clsVAr.Id_Producto & ", Patron:" & clsVAr.Id_Patron
'ClassAud.RT_Auditoria(clsVaribles.varUsuario, 112, 1, "Cambio de estatus de alarma: " & sTextoAud)
Else
sSQL = "update PersonasRelacionadas set NoCuenta = '" & txtNoCuenta.Text.Trim() & "'," &
" ClaveCNBVInstitucion = '" & cboClaveInst.SelectedValue & "'," &
" Nombre='" & txtNombre.Text.Trim() & "'," &
" APaterno='" & txtApaterno.Text.Trim() & "'," &
" AMaterno='" & txtAmaterno.Text.Trim() & "'" &
" WHERE IdElemento = " & IdElemento
clsCom.sbGuardaModifica(sSQL)
End If
Me.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Minds", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class