77 lines
2.1 KiB
VB.net
77 lines
2.1 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
Partial Class Inventarios_Paquetes
|
|
Inherits ClsPaginas
|
|
|
|
#Region "Propiedades"
|
|
|
|
Public Property dtPaquetes() As DataTable
|
|
Get
|
|
Return CType(ViewState("dtPaquetes"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("dtPaquetes") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
|
|
CargaDatos()
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
|
|
Dim ps As New ClsProductosServicios
|
|
If ps.GetPS(-1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then
|
|
gvPaquetes.DataSource = ps.DtResultados
|
|
dtPaquetes = ps.DtResultados
|
|
End If
|
|
gvPaquetes.EditIndex = -1
|
|
gvPaquetes.DataBind()
|
|
ps.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub gvPaquetes_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles gvPaquetes.RowEditing
|
|
|
|
gvPaquetes.DataSource = dtPaquetes
|
|
gvPaquetes.EditIndex = e.NewEditIndex
|
|
gvPaquetes.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub gvPaquetes_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles gvPaquetes.RowCancelingEdit
|
|
gvPaquetes.EditIndex = -1
|
|
gvPaquetes.DataSource = dtPaquetes
|
|
gvPaquetes.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub gvPaquetes_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles gvPaquetes.RowUpdating
|
|
Dim pq As New ClsProductosServicios
|
|
Dim PS As String = DirectCast(gvPaquetes.Rows(e.RowIndex).FindControl("txtEPS"), TextBox).Text.ToString
|
|
Dim Precio As Double = DirectCast(gvPaquetes.Rows(e.RowIndex).FindControl("txtEPrecio"), TextBox).Text.ToDouble
|
|
Dim Estado As Boolean = DirectCast(gvPaquetes.Rows(e.RowIndex).FindControl("cbEEstado"), CheckBox).Checked
|
|
|
|
|
|
If pq.UpdatePaquete(dtPaquetes.Rows.Item(e.RowIndex)("CvePS").ToString.ToEntero, PS, Precio, Estado) Then
|
|
|
|
CargaDatos()
|
|
|
|
|
|
End If
|
|
|
|
|
|
pq.Dispose()
|
|
End Sub
|
|
|
|
|
|
|
|
End Class
|