COLEGIO IBEROAMERICANO SANTO DOMINGO
sábado, 19 de mayo de 2012
miércoles, 17 de agosto de 2011
Bases de Datos
Recuerde:
Para realizar los diagramas de las bases de datos se debe utilizar el programa dia
Para realizar los diagramas de las bases de datos se debe utilizar el programa dia
lunes, 18 de julio de 2011
tutorial de mini factura para mis amigos del 6to inf colegio IBEROAMERICANO
VISTA DEL FORMULRIO CLIENTES
VIST DE LA FACTURA SI DESEA PUEDE AGREGAR UN MICROSOFT PRINT VIEW PARA IMPRIMIR LA FATURA
VISTA DE EJECUCION DE LA FACTURA
AL HACER CLICK EN NUEVO OBSERVE QUE SE BORRA EL CONTENIDO DEL DETALLEGRIDVIEW
ESTA ES LA CODIFIACION SOLAMENTE DE LA FACTURA
Public Class Facturas
Dim y As Integer
Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter
End Sub
Private Sub FacturaBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.FacturaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.ComercialDataSet)
End Sub
Private Sub Facturas_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
End Sub
REM ESTA FUNCION DESACTIVA Y ACTIVA LOS CONTROLES
Sub a_dcontroles()
btnagregar.Enabled = Not btnagregar.Enabled
btnquitar.Enabled = Not btnquitar.Enabled
Btncancelar.Enabled = Not Btncancelar.Enabled
btnimprimir.Enabled = Not btnimprimir.Enabled
btncalcular.Enabled = Not btncalcular.Enabled
btnguardar.Enabled = Not btnguardar.Enabled
End Sub
Private Sub Facturas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: esta línea de código carga datos en la tabla 'ComercialDataSet.productos' Puede moverla o quitarla según sea necesario.
Me.ProductosTableAdapter.Fill(Me.ComercialDataSet.productos)
'TODO: esta línea de código carga datos en la tabla 'ComercialDataSet.detalle' Puede moverla o quitarla según sea necesario.
Me.DetalleTableAdapter.Fill(Me.ComercialDataSet.detalle)
'TODO: esta línea de código carga datos en la tabla 'ComercialDataSet.clientes' Puede moverla o quitarla según sea necesario.
Me.ClientesTableAdapter.Fill(Me.ComercialDataSet.clientes)
'TODO: esta línea de código carga datos en la tabla 'ComercialDataSet.factura' Puede moverla o quitarla según sea necesario.
Me.FacturaTableAdapter.Fill(Me.ComercialDataSet.factura)
dcliente()
a_dcontroles()
End Sub
Private Sub btnguardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnguardar.Click
Me.ComercialDataSet.factura.AddfacturaRow(Me.Num_factTextBox.Text, Fecha_factDateTimePicker.Text, SutotalTextBox.Text, IvaTextBox.Text, TotalTextBox.Text, Cod_cliTextBox.Text)
Me.FacturaBindingSource.EndEdit()
Me.FacturaTableAdapter.Update(ComercialDataSet.factura)
Me.ProductosBindingSource.EndEdit()
Me.ProductosTableAdapter.Update(Me.ComercialDataSet.productos)
MsgBox("Exitosamente", MsgBoxStyle.OkOnly, "Guardado")
a_dcontroles()
End Sub
Private Sub btnquitar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnquitar.Click
Me.DetalleBindingSource.RemoveCurrent()
End Sub
Private Sub btnretornar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnretornar.Click
Me.Hide()
End Sub
Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter
End Sub
REM ESTA FUNCION DESACTIVA LOS TEXTBOX
Sub dcliente()
Cod_cliTextBox.Enabled = False
Ape_nomTextBox.Enabled = False
Ced_cliTextBox.Enabled = False
Dir_cliTextBox.Enabled = False
Telf_cliTextBox.Enabled = False
SutotalTextBox.Enabled = False
IvaTextBox.Enabled = False
TotalTextBox.Enabled = False
cbxcliente.Visible = False
SutotalTextBox.Clear()
IvaTextBox.Clear()
TotalTextBox.Clear()
End Sub
Sub acliente()
Cod_cliTextBox.Enabled = True
Ape_nomTextBox.Enabled = True
Ced_cliTextBox.Enabled = True
Dir_cliTextBox.Enabled = True
Telf_cliTextBox.Enabled = True
End Sub
Private Sub btnnuevo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnnuevo.Click
Dim POS_DET1 As Integer
POS_DET1 = 0
limpiar()
acliente()
cbxcliente.Visible = True
a_dcontroles()
If FacturaBindingSource.Count < 1 Then
Num_factTextBox.Text = 1
Else
Num_factTextBox.Text = Me.FacturaBindingSource.Count + 1
End If
y = 1
ComboBox1.Focus()
DetalleTableAdapter.Fill(Me.ComercialDataSet.detalle)
Me.DetalleBindingSource.MoveFirst()
While POS_DET1 < Me.DetalleBindingSource.Count
DetalleBindingSource.RemoveCurrent()
Me.DetalleBindingSource.MoveNext()
POS_DET1 = POS_DET1 + 1
End While
End Sub
Sub limpiar()
SutotalTextBox.Clear()
IvaTextBox.Clear()
TotalTextBox.Clear()
End Sub
Private Sub btncalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalcular.Click
Dim pos_det, z As Integer
limpiar()
Me.DetalleBindingSource.MoveFirst()
z = 0
While z < Me.DetalleBindingSource.Count
pos_det = Me.DetalleBindingSource.Position
SutotalTextBox.Text = Val(SutotalTextBox.Text) + Val(Me.ComercialDataSet.detalle.Item(pos_det).total)
z = z + 1
Me.DetalleBindingSource.MoveNext()
End While
SutotalTextBox.Text = FormatNumber(SutotalTextBox.Text, 2)
IvaTextBox.Text = Val(SutotalTextBox.Text) * 0.12
IvaTextBox.Text = FormatNumber(IvaTextBox.Text, 2)
TotalTextBox.Text = Val(SutotalTextBox.Text) + Val(IvaTextBox.Text)
TotalTextBox.Text = FormatNumber(TotalTextBox.Text)
End Sub
Private Sub Btncancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btncancelar.Click
dcliente()
a_dcontroles()
End Sub
Private Sub btnagregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnagregar.Click
Dim pos_pro, i As Integer
pos_pro = ProductosBindingSource.Position
Me.DetalleBindingSource.MoveFirst()
While i < DetalleBindingSource.Count
If Me.ComercialDataSet.productos.Item(pos_pro).cod_pro = Me.ComercialDataSet.detalle.Item(i).cod_pro Then
MsgBox("producto duplicado")
Exit Sub
End If
Me.DetalleBindingSource.MoveNext()
i = i + 1
End While
Me.ComercialDataSet.detalle.AdddetalleRow(y, txtcant.Text, Me.ComercialDataSet.productos.Item(pos_pro).nom_pro, Me.ComercialDataSet.productos.Item(pos_pro).val_pro, FormatNumber(Val(txtcant.Text) * Val(Me.ComercialDataSet.productos.Item(pos_pro).val_pro), 2), Me.ComercialDataSet.productos.Item(pos_pro).cod_pro, Num_factTextBox.Text)
Me.ComercialDataSet.productos.Item(Me.ProductosBindingSource.Position).stock_pro = Me.ComercialDataSet.productos.Item(Me.ProductosBindingSource.Position).stock_pro - txtcant.Text
y = y + 1
txtcant.Text = 1
End Sub
Private Sub cbxcliente_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxcliente.SelectedIndexChanged
End Sub
End Class
ATT LUISITO
ucesantodomingo.blogspot.com
Suscribirse a:
Entradas (Atom)