jueves, 15 de junio de 2017
Home »
» CODIGO FUENTE ESTUDIANTES COMPLETO
CODIGO FUENTE ESTUDIANTES COMPLETO
junio 15, 2017
No comments
Public Class Estudiantes
Public Function CEDULA(ByVal NC As String) As Integer
If Len(Trim(NC)) = 13 Or Len(Trim(NC)) = 10 Then
Dim si As Integer
Dim sp As Integer
Dim st As Integer
Dim X As Integer
Dim cp As Integer
Dim dg As Integer
Dim dv As Integer
Dim p As Integer
cp = Val(Mid$(NC, 1, 2))
si = 0
sp = 0
If cp > 0 And cp < 23 Then
For X = 1 To 9 Step 2
dg = Val(Mid$(NC, X, 1))
p = dg * 2
If p > 9 Then
p = p - 9
End If
si = si + p
Next X
For X = 2 To 8 Step 2
sp = sp + Val(Mid$(NC, X, 1))
Next X
st = sp + si
dv = Fix(st / 10) * 10 + 10 - st
If dv = 10 Then
dv = 0
End If
If dv = Val(Mid$(NC, 10, 1)) Then
CEDULA = 1
Else
CEDULA = 0
End If
Else
CEDULA = 0
End If
Else
CEDULA = 0
End If
End Function
Sub deshabilitar()
Principio.Enabled = False
Anterior.Enabled = False
Siguiente.Enabled = False
Ultimo.Enabled = False
Nuevo.Enabled = False
Guardar.Enabled = True
Cancelar.Enabled = True
Eliminar.Enabled = False
Modificar.Enabled = False
Buscarnom.Enabled = False
Buscarced.Enabled = False
Actualizar.Enabled = False
Salir.Enabled = False
'*************
Cod_estTextEdit.Enabled = True
CedulaTextEdit.Enabled = True
Apenom_estTextEdit.Enabled = True
Prov_nacComboEdit.Enabled = True
Cant_nacComboEdit.Enabled = True
Parr_nacComboEdit.Enabled = True
Fecha_nacDateTimeEdit.Enabled = True
Prov_resComboEdit.Enabled = True
Cant_resComboEdit.Enabled = True
Parr_resComboEdit.Enabled = True
Barr_ciudTextEdit.Enabled = True
Calle_prinTextEdit.Enabled = True
Calle_secTextEdit.Enabled = True
ReferenciaTextEdit.Enabled = True
Tel_convTextEdit.Enabled = True
Tel_celTextEdit.Enabled = True
Corr_electTextEdit.Enabled = True
Tipo_sangTextEdit.Enabled = True
GeneroComboEdit.Enabled = True
Est_civilComboEdit.Enabled = True
ReligionComboEdit.Enabled = True
Coleg_procedenciaTextEdit.Enabled = True
Gru_etnComboBox.Enabled = True
NacionalidadTextEdit.Enabled = True
PesoTextEdit.Enabled = True
OcupacionTextEdit.Enabled = True
EstaturaTextEdit.Enabled = True
Lug_trabTextEdit.Enabled = True
FotoPicturefoto.Enabled = True
End Sub
Sub habilitar()
Principio.Enabled = True
Anterior.Enabled = True
Siguiente.Enabled = True
Ultimo.Enabled = True
Nuevo.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
Eliminar.Enabled = True
Modificar.Enabled = True
Buscarnom.Enabled = True
Buscarced.Enabled = True
Actualizar.Enabled = True
Salir.Enabled = True
'*************
Cod_estTextEdit.Enabled = False
CedulaTextEdit.Enabled = False
Apenom_estTextEdit.Enabled = False
Prov_nacComboEdit.Enabled = False
Cant_nacComboEdit.Enabled = False
Parr_nacComboEdit.Enabled = False
Fecha_nacDateTimeEdit.Enabled = False
Prov_resComboEdit.Enabled = False
Cant_resComboEdit.Enabled = False
Parr_resComboEdit.Enabled = False
Barr_ciudTextEdit.Enabled = False
Calle_prinTextEdit.Enabled = False
Calle_secTextEdit.Enabled = False
ReferenciaTextEdit.Enabled = False
Tel_convTextEdit.Enabled = False
Tel_celTextEdit.Enabled = False
Corr_electTextEdit.Enabled = False
Tipo_sangTextEdit.Enabled = False
GeneroComboEdit.Enabled = False
Est_civilComboEdit.Enabled = False
ReligionComboEdit.Enabled = False
Coleg_procedenciaTextEdit.Enabled = False
Gru_etnCombobox.Enabled = False
NacionalidadTextEdit.Enabled = False
PesoTextEdit.Enabled = False
OcupacionTextEdit.Enabled = False
EstaturaTextEdit.Enabled = False
Lug_trabTextEdit.Enabled = False
FotoPicturefoto.Enabled = False
End Sub
Private Sub Estudiantes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.CANTONES1' Puede moverla o quitarla según sea necesario.
Me.CANTONESTableAdapter.Fill(Me.BDDECEDataSet.CANTONES)
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.PROVINCIAS1' Puede moverla o quitarla según sea necesario.
Me.PROVINCIASTableAdapter.Fill(Me.BDDECEDataSet.PROVINCIAS)
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.DOCENTES' Puede moverla o quitarla según sea necesario.
Me.DOCENTESTableAdapter.Fill(Me.BDDECEDataSet.DOCENTES)
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.CANTONES' Puede moverla o quitarla según sea necesario.
Me.CANTONESTableAdapter.Fill(Me.BDDECEDataSet.CANTONES)
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.PARROQUIAS' Puede moverla o quitarla según sea necesario.
Me.PARROQUIASTableAdapter.Fill(Me.BDDECEDataSet.PARROQUIAS)
'TODO: esta línea de código carga datos en la tabla 'BDDECEDataSet.PROVINCIAS' Puede moverla o quitarla según sea necesario.
Me.PROVINCIASTableAdapter.Fill(Me.BDDECEDataSet.PROVINCIAS)
Me.ESTUDIANTESTableAdapter.Fill(Me.BDDECEDataSet.ESTUDIANTES)
Cod_estTextEdit.Enabled = False
CedulaTextEdit.Enabled = False
Apenom_estTextEdit.Enabled = False
Prov_nacComboEdit.Enabled = False
Cant_nacComboEdit.Enabled = False
Parr_nacComboEdit.Enabled = False
Fecha_nacDateTimeEdit.Enabled = False
Prov_resComboEdit.Enabled = False
Cant_resComboEdit.Enabled = False
Parr_resComboEdit.Enabled = False
Barr_ciudTextEdit.Enabled = False
Calle_prinTextEdit.Enabled = False
Calle_secTextEdit.Enabled = False
ReferenciaTextEdit.Enabled = False
Tel_convTextEdit.Enabled = False
Tel_celTextEdit.Enabled = False
Corr_electTextEdit.Enabled = False
Tipo_sangTextEdit.Enabled = False
GeneroComboEdit.Enabled = False
Est_civilComboEdit.Enabled = False
ReligionComboEdit.Enabled = False
Coleg_procedenciaTextEdit.Enabled = False
Gru_etnCombobox.Enabled = False
NacionalidadTextEdit.Enabled = False
PesoTextEdit.Enabled = False
OcupacionTextEdit.Enabled = False
EstaturaTextEdit.Enabled = False
Lug_trabTextEdit.Enabled = False
FotoPicturefoto.Enabled = False
End Sub
Private Sub Nuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nuevo.Click
deshabilitar()
Dim cod As Integer
ESTUDIANTESBindingSource.MoveLast()
cod = Cod_estTextEdit.Text
cod = (CInt(cod) + 1)
ESTUDIANTESBindingSource.AddNew()
Cod_estTextEdit.Text = cod.ToString("000000000")
End Sub
Private Sub Guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Guardar.Click
ESTUDIANTESBindingSource.EndEdit()
ESTUDIANTESTableAdapter.Update(Me.BDDECEDataSet.ESTUDIANTES)
MsgBox("La información se guardo correctamente..!", MsgBoxStyle.Information, "Registro de usuarios")
habilitar()
End Sub
Private Sub Eliminar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Eliminar.Click
Try
If MsgBox("Deseas eliminar el registro?", CType(vbQuestion + vbYesNo, MsgBoxStyle), _
"Eliminar registro") = vbNo Then Exit Sub
ESTUDIANTESBindingSource.RemoveCurrent()
ESTUDIANTESTableAdapter.Update(Me.BDDECEDataSet.ESTUDIANTES)
Catch ex As Exception
' ex.Message.ToUpper()
MsgBox("Lo sentimos su Base de Datos se encuentra vacia", MsgBoxStyle.Exclamation, "Datos")
End Try
End Sub
Private Sub Siguiente_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Siguiente.Click
ESTUDIANTESBindingSource.MoveNext()
End Sub
Private Sub Anterior_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Anterior.Click
ESTUDIANTESBindingSource.MovePrevious()
End Sub
Private Sub Principio_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Principio.Click
ESTUDIANTESBindingSource.MoveFirst()
End Sub
Private Sub Ultimo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ultimo.Click
ESTUDIANTESBindingSource.MoveLast()
End Sub
Private Sub Modificar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Modificar.Click
deshabilitar()
CedulaTextEdit.Enabled = False
End Sub
Private Sub Cancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancelar.Click
ESTUDIANTESBindingSource.CancelEdit()
habilitar()
End Sub
Private Sub Salir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Salir.Click
'Principal.Show()
'Me.Hide()
End
End Sub
Private Sub BuscarCed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buscarced.Click
Dim buscarcedula As String
buscarcedula = InputBox("Introduzca el Nùmero de Cèdula: ", "Busqueda de Datos")
Me.ESTUDIANTESTableAdapter.buscarcedula(Me.BDDECEDataSet.ESTUDIANTES, buscarcedula)
End Sub
Private Sub BuscarNom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buscarnom.Click
Dim buscarnom As String
buscarnom = InputBox("Introduzca el Nombre: ", "Busqueda de Datos")
Me.ESTUDIANTESTableAdapter.buscarnombres(Me.BDDECEDataSet.ESTUDIANTES, buscarnom)
End Sub
Private Sub Actualizar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Actualizar.Click
Me.ESTUDIANTESTableAdapter.Fill(Me.BDDECEDataSet.ESTUDIANTES)
End Sub
Private Sub FotoPicturefoto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FotoPicturefoto.Click
Try
OpenFileDialog1.Title = "Abrir Imagen"
OpenFileDialog1.FileName = "Imagenes"
OpenFileDialog1.Filter = "All Files |*.*"
OpenFileDialog1.ShowDialog()
FotoPicturefoto.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
Catch ex As Exception
'Do Nathing End Try
End Try
End Sub
Private Sub Prov_nacComboEdit_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Prov_nacComboEdit.SelectedIndexChanged
Me.CANTONESTableAdapter.buscarcanton(Me.BDDECEDataSet.CANTONES, Prov_nacComboEdit.SelectedValue)
End Sub
Private Sub Cant_nacComboEdit_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cant_nacComboEdit.SelectedIndexChanged
Me.PARROQUIASTableAdapter.buscarparroquia(Me.BDDECEDataSet.PARROQUIAS, CInt(Prov_nacComboEdit.SelectedValue), CInt(Cant_nacComboEdit.SelectedValue))
End Sub
Private Sub Prov_resComboEdit_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Prov_resComboEdit.SelectedIndexChanged
Me.CANTONES1TableAdapter.buscarcanton1(Me.BDDECEDataSet.CANTONES1, Prov_resComboEdit.SelectedValue)
End Sub
Private Sub Cant_resComboEdit_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cant_resComboEdit.SelectedIndexChanged
Me.PARROQUIAS1TableAdapter.buscarparroquia1(Me.BDDECEDataSet.PARROQUIAS1, CInt(Prov_resComboEdit.SelectedValue), CInt(Cant_resComboEdit.SelectedValue))
End Sub
Private Sub Fecha_nacDateTimeEdit_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Fecha_nacDateTimeEdit.ValueChanged
End Sub
Private Sub PrintPreviewControl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1.Show()
End Sub
Private Sub Gru_etnCombobox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub CedulaTextEdit_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub CedulaTextEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CedulaTextEdit.Click
If Trim(CedulaTextEdit.Text) <> "" Then
If CEDULA(CedulaTextEdit.Text) = False Then
MsgBox("Cedula Incorrecta", MsgBoxStyle.Information, "MENSOOOO..... XD")
End If
End If
End Sub
End Class
Busqueda de cantones
SELECT CodProv, CodCant, Canton FROM CANTONES1 WHERE (CodProv = ?)
Busqueda de Cantones y Parroquias
SELECT Codprov, Provincia, codcant, Canton, codparr, parroquia FROM PARROQUIAS WHERE (Codprov = ?) AND (codcant = ?)
0 comentarios:
Publicar un comentario