Sunteți pe pagina 1din 3

Transferencia:

==============================================
==
Public Class Transferencias
Dim codigo, stock, cantidad As Integer
Dim nombre, presentacion, descripcion As String
Dim precioc, preciov As Long
Public Property Transferir_codigo As Integer
Get
Return codigo
End Get
Set(ByVal MostrarCodigo As Integer)
codigo = MostrarCodigo
End Set
End Property
Public Property Transferir_nombre As String
Get
Return nombre
End Get
Set(ByVal MostrarNombre As String)
nombre = MostrarNombre
End Set
End Property
Public Property Transferir_precioc As Long
Get
Return precioc
End Get
Set(ByVal MostrarPrecioC As Long)
precioc = MostrarPrecioC
End Set
End Property
Public Property Transferir_preciov As Long
Get
Return preciov
End Get
Set(ByVal MostrarPrecioV As Long)
preciov = MostrarPrecioV
End Set
End Property
Public Property Transferir_cantidad As Integer
Get
Return cantidad
End Get
Set(ByVal MostrarCantidad As Integer)
cantidad = MostrarCantidad
End Set
End Property
Public Property Transferir_presentacion As String
Get
Return presentacion
End Get
Set(ByVal MostrarPresentacion As String)

presentacion = MostrarPresentacion
End Set
End Property
Public Property Transferir_stock As Integer
Get
Return stock
End Get
Set(ByVal MostrarStock As Integer)
stock = MostrarStock
End Set
End Property
Public Property Transferir_descripcion As String
Get
Return descripcion
End Get
Set(ByVal MostrarDescripcion As String)
descripcion = MostrarDescripcion
End Set
End Property
End Class

Metodos:
==============================================
==
Imports System.Data.SqlClient
Imports System.Data

Public Class Metodos


Dim conexion As New Conexion
Public Sub registrar(ByVal objeto As Transferencias)
Try
conexion.conectarbase()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Conexion:
==============================================
==
Imports System.Data.SqlClient
Imports System.Data

Public Class Conexion


Dim conexion As SqlConnection
Public Function conectarbase()
Try
conexion = New SqlConnection("Data Source=LENOVO-PC\SQLEXPRESS;Initial
Catalog=Capas;Integrated Security=True")
conexion.Open()

Catch ex As Exception
MsgBox(ex.Message)
End Try
Return conexion
End Function
Public Sub cerrar()
conexion.Close()
End Sub

S-ar putea să vă placă și