Con éxito

Notas

Error

Session expiration Your session is going to expireClick here to extend

Presupuesto

Proyecto pequeño <800

Publicado el

13/12/11 20:12

Cliente

jho***

Este proyecto ha expirado

Publica un proyecto similar y recibe ofertas sin compromiso alguno.

¡Publica un proyecto similar ahora!

Descripción

 

Private Sub btn_Guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Guardar.Click
FuncionF10()
End Sub
 
Private Sub BindingNavigatorDeleteItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_eliminar.Click
If My.Settings.validacion = 1 And para_insertar.Rows.Count - 1 < 0 Then
My.Settings.validacion = 0
btn_salir.Enabled = True
vaciar_datos()
CargarDatos()
ElseIf My.Settings.validacion = 1 And para_insertar.Rows.Count - 1 > -1 Then
BindingNavigatorAddNewItem.Enabled = False
btn_salir.Enabled = True
'BORRAR VALOR DATATABLE
Dim nro_perfil_det As String = txt_nro_perfil_det.Text
Dim va As Boolean = False
For i = 0 To para_insertar.Rows.Count - 1
If va = False Then
If nro_perfil_det = para_insertar.Rows(i)("nro_perfil_det").ToString Then
para_insertar.Rows(i).Delete()
va = True
End If
End If
Next
'ELIMINAR FILAS GRILLA
DG_estado.Focus()
Me.DG_estado.Rows.RemoveAt(Me.DG_estado.CurrentRow.Index)
Else
 
My.Settings.validacion = 2
If para_modificar.Rows.Count - 1 > -1 Then
For i = 0 To para_modificar.Rows.Count - 1
If para_modificar.Rows(i)("nro_perfil_det").ToString() = txt_nro_perfil_det.Text Then
para_modificar.Rows(i).Delete()
AddDataToTable(Me. txt_nro_perfil_det.Text.Trim(), para_eliminar)
btn_salir.Enabled = True
Else
AddDataToTable(Me. txt_nro_perfil_det.Text.Trim(), para_eliminar)
btn_salir.Enabled = True
End If
Next
Else
AddDataToTable(Me. txt_nro_perfil_det.Text.Trim(), para_eliminar)
btn_salir.Enabled = True
End If
'ELIMINA FILAS DE LA GRILLA
DG_estado.Focus()
Me.DG_estado.Rows.RemoveAt(Me.DG_estado.CurrentRow.Index)
End If
End Sub
 
Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
FuncionF6()
End Sub
 
Private Sub Btn_buscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_buscar.Click
FuncionF7()
End Sub
 
Private Sub btn_salir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_salir.Click
txt_nro_perfil_det.Focus()
If My.Settings.validacion = 0 Then
Me.Close()
ElseIf txt_nro_perfil_det.Text <> String.Empty Or para_insertar.Rows.Count - 1 > -1 Or para_eliminar.Rows.Count - 1 > -1 Or para_modificar.Rows.Count - 1 > -1 Then
Dim repuesta As String = MessageBox.Show("¿Desdea guardar los cambios realizados?", "Mensaje", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)
If repuesta = Windows.Forms.DialogResult.Yes Then
FuncionF10()
Me.Close()
ElseIf repuesta = Windows.Forms.DialogResult.No Then
My.Settings.validacion = 0
Me.Close()
End If
Else
Me.Close()
End If
End Sub
#End Region
 
#Region "Cargar, Buscar, Guardar, Modificar, Eliminar"
Private Sub vaciar_datos()
Dim obj As Control
For Each obj In Me.GroupBox1.Controls
If TypeOf (obj) Is TextBox Then
obj.Text = ""
End If
Next
My.Settings.validacion = 0
My.Settings.f8 = True
End Sub
 
Private Sub FuncionF7()
txt_nro_perfil_det.BackColor = Color.Azure
txt_nro_orden.BackColor = Color.Azure
If My.Settings.validacion = 0 Then
vaciar_datos()
Me.DG_estado.Rows.Clear()
btn_Guardar.Enabled = False
ElseIf txt_nro_perfil_det.Text <> String.Empty Or para_insertar.Rows.Count - 1 > -1 Or para_eliminar.Rows.Count - 1 > -1 Or para_modificar.Rows.Count - 1 > -1 Then
Dim repuesta As String = MessageBox.Show("¿Desdea guardar los cambios realizados?", "Mensaje", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)
If repuesta = Windows.Forms.DialogResult.Yes Then
FuncionF10()
ElseIf repuesta = Windows.Forms.DialogResult.No Then
'' ELININA TABLAS TEMPORALES
If My.Settings.validacion = 1 And para_insertar.Rows.Count - 1 > -1 Then
'BORRAR VALOR DATATABLE
Dim nro_perfil_det As String = txt_nro_perfil_det.Text
Dim va As Boolean = False
For i = 0 To para_insertar.Rows.Count - 1
If va = False Then
If nro_perfil_det = para_insertar.Rows(i)("nro_perfil_det").ToString Then
para_insertar.Rows(i).Delete()
va = True
End If
End If
Next
Else
My.Settings.validacion = 2
If para_modificar.Rows.Count - 1 > -1 Then
For i = 0 To para_modificar.Rows.Count - 1
If para_modificar.Rows(i)("nro_perfil_det").ToString() = txt_nro_perfil_det.Text Then
para_modificar.Rows(i).Delete()
End If
Next