You are on page 1of 1

Sub BuscarTipoGasto() Try Dim Tipo As New Ent_TABLAS_Det With {.TAC_CODIGO = "0053", .TAD_CODI GO_OFICIAL = TxtCodTipGast.

Text} Dim LogTip As New Log_Tablas_Det Dim Tipos As New List(Of Ent_TABLAS_Det) Tipos = LogTip.Buscar(Tipo) If Tipos.Count > 0 Then For Each Tip In Tipos If (Tip.TAD_CODIGO_OFICIAL).ToUpper.Trim = TxtCodTipGast.Tex t.ToUpper.Trim Then TxtCodTipGast.Text = (Tip.TAD_CODIGO_OFICIAL).Trim TxtCodTipGast.Tag = Tip.TAD_CODIGO TxtTipGast.Text = Tip.TAD_DESCRIPCION End If Next If TxtTipGast.Text = "" Then Tools.ShowWarning("Error al Buscar", "El Item Buscado no exi ste") TxtCodTipGast.Focus() TxtCodTipGast.SelectionStart = 0 TxtCodTipGast.SelectionLength = 4 End If End If Catch ex As Exception Tools.ShowError(ex.Message) End Try End Sub Private Sub TxtCodTipoGasto_KeyDown(ByVal sender As Object, ByVal e As Syste m.Windows.Forms.KeyEventArgs) If e.KeyCode = Keys.Enter And TxtCodTipGast.Text = "*" Then Using f As New FrmBuscarDetalleTablaGral f.TAC_Codigo_Ds = "0053" If f.ShowDialog = DialogResult.OK Then TxtCodTipGast.Tag = (f.DgvDetalles.CurrentRow.Cells(0).Value ).ToString.Trim TxtCodTipGast.Text = (f.DgvDetalles.CurrentRow.Cells(1).Valu e).ToString.Trim TxtTipGast.Text = (f.DgvDetalles.CurrentRow.Cells(2).Value). ToString.Trim End If End Using ElseIf e.KeyCode = Keys.Enter And TxtCodTipGast.Text <> "*" Then If TxtCodTipGast.Text.Trim <> "" Then TxtCodTipGast.Text = Dos(TxtCodTipGast.Text) BuscarTipoGasto() End If End If End Sub

You might also like