135 lines
4.9 KiB
VB.net
135 lines
4.9 KiB
VB.net
Public Class FrmStatusPatrones
|
|
Dim Patron As clsComplejo = New clsComplejo 'Para llenar combo patron
|
|
Dim clCmp As clsComplejo = New clsComplejo
|
|
Dim clCmp2 As clsComplejo = New clsComplejo
|
|
|
|
|
|
Private Sub FrmStatusPatrones_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
If clsVaribles.lbDemo = True Then Exit Sub
|
|
Patron.sbLlenaCombo("spConProducto", Me.cmbPatron)
|
|
Me.cmbPatron.SelectedIndex = -1
|
|
End Sub
|
|
|
|
Private Sub btnConsulta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConsulta.Click
|
|
sbBuscar()
|
|
End Sub
|
|
|
|
Public Sub sbBuscar()
|
|
Try
|
|
If clsVaribles.lbDemo = True Then Exit Sub
|
|
Dim SQL As String
|
|
Dim SQL2 As String
|
|
Dim Classcom As New clsComplejo
|
|
Dim Classcom2 As New clsComplejo
|
|
Dim ClassUtils As New ClassMyUtils
|
|
|
|
Dim strproducto As String
|
|
|
|
|
|
SQL = "ReporteInusualHistoricoTODOS "
|
|
|
|
clCmp = New clsComplejo
|
|
clCmp.fdtDataSetTabla(SQL)
|
|
|
|
'Classcom.fdtDataSet(SQL)
|
|
|
|
'SQL = "SELECT * FROM cat_PRODUCTO WHERE ACTIVO = 1"
|
|
|
|
'If Me.cmbPatron.Text <> "" Then
|
|
' SQL = SQL & " AND PRODUCTO = '" & Me.cmbPatron.Text.Trim & "' "
|
|
'End If
|
|
|
|
'Classcom.fdtDataSet(SQL)
|
|
|
|
'If Classcom.ds.Tables(0).Rows.Count <> 0 Then
|
|
|
|
' SQL2 = ""
|
|
' For i As Integer = 0 To Classcom.ds.Tables(0).Rows.Count - 1
|
|
|
|
' If i > 0 Then
|
|
' SQL2 = SQL2 & " UNION " & vbCrLf
|
|
' End If
|
|
|
|
' SQL2 = SQL2 & "SELECT PPatr.IdProductoPatron, PPatr.IdPatron, "
|
|
' SQL2 = SQL2 & " Patr.Patron, PPatr.Activo "
|
|
' SQL2 = SQL2 & "FROM ProductoPatron PPatr INNER JOIN Patron Patr ON PPatr.IdPatron = Patr.IdPatron "
|
|
' SQL2 = SQL2 & " INNER JOIN Cat_Producto Prod ON Prod.IdProducto = PPatr.IdProducto "
|
|
' SQL2 = SQL2 & "WHERE Patr.IdPatron NOT IN ( 105,15,19,21,25,97,104,14) "
|
|
' ''-- PPatr.Activo = 1
|
|
' If cmbPatron.SelectedIndex <> -1 Then
|
|
' SQL2 = SQL2 & "AND Prod.IdProducto = " & cmbPatron.SelectedValue & " " & vbCrLf
|
|
' End If
|
|
|
|
' Next
|
|
' 'C1TrueDBGrid1
|
|
' clCmp = New clsComplejo
|
|
' clCmp.fdtDataSetTabla(SQL2)
|
|
|
|
' Me.C1TrueDBGrid1.SetDataBinding(clCmp.ds, "Tabla")
|
|
' clCmp.ColsGridAutosize(Me.C1TrueDBGrid1)
|
|
' 'Me.C1TrueDBGrid1.Splits(0).DisplayColumns(5).Style.VerticalAlignment = C1.Win.C1TrueDBGrid.AlignVertEnum.Center
|
|
' ' Me.C1TrueDBGrid1.Columns("FECHA").NumberFormat = "DD/MM/YYYY"
|
|
' 'Me.C1TrueDBGrid1.Splits(0).DisplayColumns(0).FetchStyle = True
|
|
' Me.C1TrueDBGrid1.Splits(0).DisplayColumns(0).Visible = False
|
|
' Me.C1TrueDBGrid1.Splits(0).DisplayColumns(1).Visible = False
|
|
' Me.C1TrueDBGrid1.Visible = True
|
|
|
|
' Dim Cont As Integer
|
|
' Cont = clCmp.ds.Tables(0).Rows.Count
|
|
' lblNumReg.Text = "Numero de Registros : " & Cont
|
|
|
|
'End If
|
|
|
|
Catch er As Exception
|
|
MessageBox.Show(er.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub BtnLimpiar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLimpiar.Click
|
|
refrescar()
|
|
End Sub
|
|
|
|
Private Sub refrescar()
|
|
If clsVaribles.lbDemo = True Then Exit Sub
|
|
'Grid
|
|
Me.C1TrueDBGrid1.Visible = True
|
|
Me.C1TrueDBGrid1.DataSource = Nothing
|
|
Me.C1TrueDBGrid1.DataBindings.Clear()
|
|
|
|
Me.cmbPatron.SelectedIndex = -1
|
|
|
|
'etiqueta
|
|
Me.lblNumReg.Text = ""
|
|
|
|
clsVaribles.lsClienteNombre = ""
|
|
clsVaribles.lsClienteNombreT = ""
|
|
End Sub
|
|
|
|
Private Sub BntSalie_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BntSalie.Click
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub C1TrueDBGrid1_ColEdit(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.ColEventArgs) Handles C1TrueDBGrid1.ColEdit
|
|
Dim intIdProductoPatron As Integer
|
|
Dim boolStatusPatron As Boolean
|
|
Dim intStatusPatron As Integer
|
|
|
|
boolStatusPatron = e.Column.DataColumn.Value()
|
|
If boolStatusPatron = False Then
|
|
intStatusPatron = 0
|
|
Else
|
|
intStatusPatron = 1
|
|
End If
|
|
|
|
intIdProductoPatron = C1TrueDBGrid1.Columns(0).Value
|
|
|
|
'Ejecutar SP para actualizar status de Patron
|
|
clCmp2.sbModifica2("SP_Actualiza_Status_Patron " & intStatusPatron & ", " & intIdProductoPatron)
|
|
'C1TrueDBGrid1.ClearFields()
|
|
'sbBuscar()
|
|
|
|
btnConsulta.Focus()
|
|
|
|
End Sub
|
|
|
|
End Class |