Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PRESENTADO POR:
Nino Morales Castillo
HUARAZ - ANCASH
1
DEDICO:
2
INTRODUCCION
3
INDICE
Introducción Pag. 3
Indice Pag .4
1. DIAGNOSTICO Y JUSTIFICACION Pag. 5
1.1 Diagnóstico Pag. 5
1.2 Justificación Pag. 5
2. OBJETIVOS Pag. 5
2.1 Objetivo general Pag. 6
2.2 Objetivo específico Pag. 6
3. DESCRIPCION DEL PROYECTO Pag. 6
3.1 Modelo de datos Pag. 6
3.2 Diseño de datos Pag. 6
3.3 Formularios Pag. 7
3.3.1 Login Pag. 7
3.3.2 Formulario Inicio Pag. 8
3.3.3 Formulario Categorías Pag. 11
3.3.4 Formulario Prendas Pag. 15
3.3.5 Formulario Clientes Pag. 22
3.3.6 Formulario Alquileres Pag. 28
3.3.7 Formulario Detalle de Alquiler Pag. 33
3.3.8 Formulario Recibo Pag. 39
3.3.9 Formulario Reporte de Prendas Pag. 40
4. UBICACION Pag. 41
5. ORGANO O INSTITUCION RESPONSABLE Pag. 41
6. BENEFICIARIOS Pag. 41
6.1 Beneficiario Directo Pag. 41
6.2 Beneficiarion Indirecto Pag. 41
7. Metas y Resultados Pag. 41
8. Efectos esperados Pag. 41
4
1. DIAGNOSTICO Y JUSTIFICACION
1.1. DIAGNOSTICO
La Sastrería “Morales” en estos momentos se encuentra desactualizada
en lo que son los modernos sistemas de atención al cliente, fue creada
en los años 70 y hasta el momento se siguen usando los mismos
métodos de aquél tiempo. Al momento de alquilar una prenda el sastre
utiliza cuadernos y libretas para anotar los datos del cliente, además
de las características de la prenda y las fechas de alquiler y devolución;
estos registros estan susceptibles a perderse o modificarse fácilmente,
por lo que es urgente desechar estos métodos antiguos e implementar
un moderno sistema de registro automatizado para optimizar el
proceso de alquiler y devolución de la prenda.
1.2. JUSTIFICACION:
Como integrante de la familia propietaria de esta Sastrería, durante
toda mi vida he visto como se han realizado los procesos de alquileres
en el establecimiento, por lo que estoy bastante familiarizado con esto
y me doy cuenta de la necesidad que existe ahora de tener un mejor
método de registro. Siempre ha habido problemas a la hora de alquilar
las prendas, algunas veces las personas querían tal prenda pero el
trabajador no estaba seguro si es que la tenían y se perdía tiempo en
la búsqueda, en otras ocasiones las personas devolvían una prenda
después de mucho tiempo y se hacía tedioso buscar el registro del
momento en que se le alquiló, otro problema es que la letra del
trabajador que anotaba el alquiler no se entendía y se le tenía que
consultar a él mismo sobre que había puesto. Para evitar estos y otros
problemas es que realizo este sistema.
5
2. OBJETIVOS:
2.1. Objetivo General
CATEGORIAS CLIENTE
(1, n) (1, n)
(1, 1)
(1, 1)
(1, n) (1, 1)
(1, 1) (n, 1)
DETALLE_ALQUILER ALQUILER
PRENDAS
Cliente
Categorías IdCliente
IdCategoria DNI
Nombres
Nombre_Categoría
Apellidos
Dirección
Teléfono
Prendas
IdPrenda
IdCategoria (FK) Detalle_Alquiler Alquiler
6
3.3. Formularios
Para elaborar este sistema se hizo uso de varios formularios en
Visual Basic para poder realizar las operaciones como registro de
prendas, datos del cliente, elección de prendas a alquilar, etc.
dts.glogin = txtlogin.Text
dts.gpassword = txtpassword.Text
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
El código es el siguiente:
Imports System.Windows.Forms
8
Public Class frminicio
m_ChildFormNumber += 1
ChildForm.Text = "Ventana " & m_ChildFormNumber
ChildForm.Show()
End Sub
If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK)
Then
Dim FileName As String = SaveFileDialog.FileName
End If
End Sub
9
Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e
As EventArgs) Handles StatusBarToolStripMenuItem.Click
Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.Checked
End Sub
End Sub
End Sub
11
txtbuscar.Enabled = False
datalistado.ColumnHeadersVisible = False
inexistente.Visible = True
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
btnnuevo.Visible = True
btneditar.Visible = False
buscar()
End Sub
dv.RowFilter = cbocampo.Text & " like '" & txtbuscar.Text & "%'"
Else
inexistente.Visible = True
datalistado.DataSource = Nothing
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
dts.gnombre_categoria = txtnombre.Text
If func.insertar(dts) Then
MessageBox.Show("categoría registrada correctamente",
"Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("categoría no fue registrada intente de
nuevo", "Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
dts.gidcategoria = txtidcategoría.Text
13
dts.gnombre_categoria = txtnombre.Text
If func.editar(dts) Then
MessageBox.Show("Categoría Modificada correctamente",
"Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("Categoría no fue modifcada intente de
nuevo", "Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Modificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
If func.eliminar(vdb) Then
Else
MessageBox.Show("Categoría no fue eliminada",
"Eliminando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
End If
End If
Next
Call mostrar()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Cancelando eliminación de registros", "Eliminando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
14
Call mostrar()
End If
Call limpiar()
End Sub
Private Sub datalistado_CellDoubleClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
datalistado.CellDoubleClick
If txtflag.Text = "1" Then
frmprendas.txtidcategoria.Text =
datalistado.SelectedCells.Item(1).Value
frmprendas.txtnom_categoria.Text =
datalistado.SelectedCells.Item(2).Value
Me.Close()
End If
End Sub
Private Sub txtbuscar_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtbuscar.TextChanged
buscar()
End Sub
End Class
15
Public Class frmprendas
Private dt As New DataTable
End Try
btnnuevo.Visible = True
btneditar.Visible = False
buscar()
End Sub
dv.RowFilter = cbocampo.Text & " like '" & txtbuscar.Text & "%'"
Else
inexistente.Visible = True
datalistado.DataSource = Nothing
End If
16
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
dts.gnombre_prenda = txtnombre_prenda.Text
dts.gidcategoria = txtidcategoria.Text
dts.gtalla_prenda = cbxtalla.Text
dts.gtela = cbxcalidad.Text
dts.gcolor = txtcolor.Text
dts.gprecio = txtprecio.Text
dts.gnum_usos = txtnum_usos.Text
dts.gstock = txtstock.Text
dts.gestado = txtestado.Text
If func.insertar(dts) Then
MessageBox.Show("Prenda registrada correctamente", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("La prenda no se pudo registrar intente de
nuevo", "Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
17
Else
MessageBox.Show("Falta ingresar algunos datos", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
btneditar.Visible = True
btnguardar.Visible = False
End Sub
dts.gidprenda = txtidprenda.Text
dts.gidcategoria = txtidcategoria.Text
dts.gnombre_prenda = txtnombre_prenda.Text
dts.gtalla_prenda = cbxtalla.Text
dts.gtela = cbxcalidad.Text
dts.gcolor = txtcolor.Text
dts.gprecio = txtprecio.Text
dts.gnum_usos = txtnum_usos.Text
dts.gstock = txtstock.Text
dts.gestado = txtestado.Text
18
If func.editar(dts) Then
MessageBox.Show("Datos de la prenda modificados
correctamente", "Modificando registros", MessageBoxButtons.OK,
MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("La prenda no se pudo modificar",
"Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Modificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
If marcado Then
Dim onekey As Integer =
Convert.ToInt32(row.Cells("idprenda").Value)
Dim vdb As New vprenda
Dim func As New fprenda
vdb.gidprenda = onekey
If func.eliminar(vdb) Then
Else
MessageBox.Show("La prenda no fue eliminada",
"Eliminando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
Next
Call mostrar()
19
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Cancelando eliminación de registros", "Eliminando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call mostrar()
End If
Call limpiar()
End Sub
End If
End Sub
End Sub
End Class
22
txtdireccion.Text = ""
txttelefono.Text = ""
txtdni.Text = ""
txtidcliente.Text = ""
End Sub
End Try
btnnuevo.Visible = True
btneditar.Visible = False
buscar()
End Sub
dv.RowFilter = cbocampo.Text & " like '" & txtbuscar.Text & "%'"
Else
inexistente.Visible = True
datalistado.DataSource = Nothing
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
dts.gdni = txtdni.Text
dts.gnombres = txtnombre.Text
dts.gapellidos = txtapellidos.Text
dts.gdireccion = txtdireccion.Text
24
dts.gtelefono = txttelefono.Text
If func.insertar(dts) Then
MessageBox.Show("cliente registrado correctamente",
"Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("cliente no fue registrado intente de nuevo",
"Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
btneditar.Visible = True
btnguardar.Visible = False
End Sub
25
dts.gidcliente = txtidcliente.Text
dts.gdni = txtdireccion.Text
dts.gnombres = txtnombre.Text
dts.gapellidos = txtapellidos.Text
dts.gdireccion = txtdireccion.Text
dts.gtelefono = txttelefono.Text
If func.editar(dts) Then
MessageBox.Show("cliente MOdificado correctamente",
"MOdificando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("cliente no fue modifcado intente de
nuevo", "MOdificando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "MOdificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
If marcado Then
Dim onekey As Integer =
Convert.ToInt32(row.Cells("idcliente").Value)
Dim vdb As New vcliente
Dim func As New fcliente
vdb.gidcliente = onekey
If func.eliminar(vdb) Then
Else
26
MessageBox.Show("Cliente no fue eliminado",
"Eliminando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
Next
Call mostrar()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Cancelando eliminación de registros", "Eliminando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call mostrar()
End If
Call limpiar()
End Sub
End If
End Sub
27
3.3.6 Formulario Registro de Alquileres: En este
formulario se almacena los datos del alquiler como son
los datos del cliente, fecha de alquiler y devolución,
número de recibo y la garantía que deja el cliente.
End Sub
End Try
btnnuevo.Visible = True
btneditar.Visible = False
buscar()
End Sub
dv.RowFilter = cbocampo.Text & " like '" & txtbuscar.Text & "%'"
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
dts.gidcliente = txtidcliente.Text
dts.gfecha_alquiler = txtfecha_alquiler.Text
dts.gfecha_devolucion = txtfecha_devolucion.Text
dts.ggarantia = txtgarantia.Text
dts.gnum_recibo = txtnum_recibo.Text
29
If func.insertar(dts) Then
MessageBox.Show("Alquiler registrado correctamente, vamos a
añadir prendas", "Guardando registros", MessageBoxButtons.OK,
MessageBoxIcon.Information)
mostrar()
limpiar()
cargar_detalle()
Else
MessageBox.Show("Alquiler no fue registrado, intente de
nuevo", "Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
dts.gidalquiler = txtfecha_alquiler.Text
dts.gidcliente = txtidcliente.Text
dts.gfecha_alquiler = txtfecha_alquiler.Text
30
dts.gfecha_devolucion = txtfecha_devolucion.Text
dts.ggarantia = txtgarantia.Text
dts.gnum_recibo = txtnum_recibo.Text
If func.editar(dts) Then
MessageBox.Show("Alquiler modificado correctamente",
"Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("El alquiler no fue modificado",
"Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Modificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
frm_detalle_alquiler.ShowDialog()
End Sub
If marcado Then
Dim onekey As Integer =
Convert.ToInt32(row.Cells("idalquiler").Value)
Dim vdb As New valquiler
Dim func As New falquiler
vdb.gidalquiler = onekey
If func.eliminar(vdb) Then
Else
MessageBox.Show("El alquiler no fue eliminado",
"Eliminando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
Next
Call mostrar()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
32
MessageBox.Show("Cancelando eliminación de registros", "Eliminando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
Call mostrar()
End If
Call limpiar()
End Sub
End Class
End Try
btnnuevo.Visible = True
buscar()
End Sub
Else
inexistente.Visible = True
datalistado.DataSource = Nothing
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
If marcado Then
Dim onekey As Integer =
Convert.ToInt32(row.Cells("iddetalle_alquiler").Value)
Dim vdb As New vdetalle_alquiler
Dim func As New fdetalle_alquiler
vdb.giddetalle_alquiler = onekey
vdb.gidprenda = datalistado.SelectedCells.Item(3).Value
vdb.gidalquiler = datalistado.SelectedCells.Item(2).Value
vdb.gcantidad = datalistado.SelectedCells.Item(8).Value
If func.eliminar(vdb) Then
If func.disminuir_usos(vdb) Then
If func.aumentar_stock(vdb) Then
End If
End If
Else
MessageBox.Show("Prenda fue quitada del alquiler",
"Eliminando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
Next
Call mostrar()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Cancelando eliminación de registros", "Eliminando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
35
Call mostrar()
End If
Call limpiar()
End Sub
cant = txtcantidad.Value
Else
btnguardar.Visible = 1
End If
If txtcantidad.Value = 0 Then
btnguardar.Visible = 0
Else
btnguardar.Visible = 1
End If
End Sub
dts.gidalquiler = txtidalquiler.Text
dts.gidprenda = txtidprenda.Text
dts.gcantidad = txtcantidad.Text
dts.gprecio_unitario = txtprecio_unitario.Text
If func.insertar(dts) Then
If func.disminuir_stock(dts) Then
If func.aumentar_usos(dts) Then
If func.alquilado(dts) Then
End If
End If
End If
36
MessageBox.Show("Prenda fue añadida correctamente al
alquiler", "Guardando registros", MessageBoxButtons.OK,
MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("La prenda no se añadió, intente de nuevo",
"Guardando registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Guardando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
dts.gidprenda = txtidprenda.Text
If func.devuelto(dts) Then
MessageBox.Show("La prenda se devolvió correctamente",
"Modificando registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
mostrar()
limpiar()
Else
MessageBox.Show("La prenda no se devolvió", "Modificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Error)
mostrar()
limpiar()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MessageBox.Show("Falta ingresar algunos datos", "Modificando
registros", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
38
3.3.8. Formulario Recibo: En este se genera un recibo de acuerdo
a los datos del cliente y las prendas escogidas, aquí se realiza
el cálculo total de cuanto debe pagar el cliente y también se
añade las fechas de alquiler y devolución máxima.
Me.generar_comprobanteTableAdapter.Fill(Me.ALQUILERDataSet2.generar_comprobante,
idalquiler:=txtidalquiler.Text)
Me.ReportViewer1.RefreshReport()
End Sub
End Class
39
3.3.9. Formulario Reporte de Prenda: Se puede tener una visión
más objetiva de las prendas y controlar el número de usos
que tienen y si ya fueron devueltos o no.
Me.ReportViewer1.RefreshReport()
End Sub
End Class
40
4. UBICACIÓN
“Sastrería Morales”
6. BENEFICIARIOS
6.1. DIRECTOS
6.2. INDIRECTO
Clientes
7. METAS RESULTADOS
41