client/ClasesModulos/ClassCatalogos.vb

103 lines
3.1 KiB
VB.net

Public Class ClassCatalogos
Public Classcom As New clsComplejo
Public Sub LlenaGrid(ByVal SQL As String, ByRef Grid As C1.Win.C1TrueDBGrid.C1TrueDBGrid)
Classcom.fdtDataSetTabla(SQL)
Grid.SetDataBinding(Classcom.ds, "Tabla")
'If Grid.RowCount > 0 Then
' Grid.Splits(0).DisplayColumns(0).Width = 50
' If Grid.Columns.Count > 1 Then Grid.Splits(0).DisplayColumns(1).Width = 160
' If Grid.Columns.Count > 2 Then Grid.Splits(0).DisplayColumns(2).Width = 50
' If Grid.Columns.Count > 3 Then Grid.Splits(0).DisplayColumns(3).Width = 55
' If Grid.Columns.Count > 4 Then Grid.Splits(0).DisplayColumns(4).Width = 60
' If Grid.Columns.Count > 5 Then Grid.Splits(0).DisplayColumns(5).Width = 50
' If Grid.Columns.Count > 6 Then Grid.Splits(0).DisplayColumns(6).Width = 50
' If Grid.Columns.Count > 7 Then Grid.Splits(0).DisplayColumns(7).Width = 65
' 'Grid.Splits(0).DisplayColumns(0).AutoSize()
'End If
For number As Integer = 0 To Grid.Columns.Count - 1
Grid.Splits(0).DisplayColumns(number).AutoSize()
Next
'{
' DBGridClientes.Splits[0].DisplayColumns[ii].AutoSize();
'}
End Sub
Public Sub sbLimpiaControlesEsp(ByVal Forma As Panel)
Dim lcCtrl As Object
For Each lcCtrl In Forma.Controls
If TypeOf lcCtrl Is TextBox Then
lcCtrl.text = ""
End If
If TypeOf lcCtrl Is ComboBox Then
lcCtrl.Selectedindex = -1
lcCtrl.text = ""
'MsgBox("limpio combo")
End If
If TypeOf lcCtrl Is CheckBox Then
lcCtrl.Checked = False
'MsgBox("limpio chcek")
End If
If TypeOf lcCtrl Is DateTimePicker Then
lcCtrl.value = Now
End If
Next lcCtrl
End Sub
Public Function ValidaCampos(ByVal strParam As String, ByVal strCHAR As String) As String
Select Case UCase(strParam)
Case Is = "NUMEROS"
If InStr("0123456789", Mid(strCHAR, 1, 1).ToString, CompareMethod.Text) = 0 Then
ValidaCampos = Nothing
Else
ValidaCampos = strCHAR
End If
End Select
End Function
Friend Shared Sub CambiaColorbloque2(btnConsulta As Button, btnEditar As Button, btnOk As Button, btnSalir As Button)
If btnConsulta.Enabled Then
btnConsulta.BackColor = Color.Black
Else
btnConsulta.BackColor = Color.DarkGray
End If
If btnEditar.Enabled Then
btnEditar.BackColor = Color.Black
Else
btnEditar.BackColor = Color.DarkGray
End If
If btnOk.Enabled Then
btnOk.BackColor = Color.Black
Else
btnOk.BackColor = Color.DarkGray
End If
If btnSalir.Enabled Then
btnSalir.BackColor = Color.Black
Else
btnSalir.BackColor = Color.DarkGray
End If
End Sub
End Class