Está en la página 1de 45

PROGRAMACIÓN ORIENTADA A OBJETOS

TEMA

Ventas de autos

SOBRE RUEDAS S.A.C

DOCENTE

ARMANDO RICARDO HUAPAYA SOTERO

INTEGRANTES

Quispe Quiñones Lizeth Milagros (U19311139)

Ríos Mendoza, Jason Bryan (U182026664)

Silvera Huamani, David Santiago (U19206135)

Soria Cárdenas, Luy (U19206144)

Vílchez Chávez Jhon (1637288)

SECCIÓN

15698

CICLO

2021-2
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

PRESENTACIÓN

La empresa Sobre
Ruedas S.A.C, está
centrado en vender autos
de alta calidad y brindar
un servicio excelente en
atención al cliente, el
personal está altamente
calificado y capacitado a
la necesidad del cliente.
Su funcionalidad se basa en hacer convenios con empresas de producción de
autos, a su vez contamos con equipos altamente calificados que ayudará en
recomendar autos dependiendo a la necesidad de cada comprador, así sí
mismo, se cumplirá en mantener actualizado el conocimiento y la rentabilidad
del negocio.

● RUC: 20123458975
● Razón Social: Sobre Ruedas S.A.C
● Página Web: http://www.SobreRuedas.com.pe
● Representante legal: Jason, David, Luy, Jhon
● Gerente General: Lizeth
● Tipo Empresa: Sociedad Anónima Cerrada
● Condición: Activo
● Fecha Inicio Actividades: 02/09/2021
● Actividad: Servicios
● Dirección Legal: Av. San Martin 123 Urb. El Pachacamac
● Distrito / Ciudad: Pachacamac-Lima
● Departamento: Lima
● Teléfono: Cel 999987123
● Correo electrónico: SobreRuedas@hotmail.com

2
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

CULTURA ORGANIZACIONAL

MISIÓN

Posicionarnos en el mercado con el servicio responsable de gran reconocimiento,


garantizando la satisfacción de los clientes gracias al servicio brindado y el uso de
tecnología actualizada continua.

VISIÓN

Ser la empresa líder en brindar un excelente servicio para la venta de autos, a su vez,
tener convenios con todas las marcas de autos, contando con nuestra propia marca y
llegar a fortalecer la confianza y satisfacción con nuestros clientes.

VALORES

● Innovador: Somos una empresa que buscamos brindar un servicio innovador


por la coyuntura actual y brindar conocimientos a futuro,
● Empatía: Actuamos con mucho respeto y siempre nos tomamos el tiempo en la
enseñanza ya que no todos aprenden de la misma manera.
● Competitividad: Aunque no contamos con mucha competencia, siempre somos
competitivos con nosotros mismos para así estar en constante mejora.
● Calidad: El personal está correctamente capacitado para representar a la
empresa y mostrar la calidad de la que estamos comprometidos.
● Orientación al cliente: El cliente cumple una función importante para brindar
por eso siempre estamos dispuestos de orientar al cliente y darle el mejor
servicio posible.
● Responsabilidad social: Cada día nos esforzamos por actuar de manera justa
con nuestros clientes y siempre tratamos con respeto.
● Adaptabilidad: Como somos una empresa de servicios, siempre se trata de
brindar un servicio actual, por eso nuestro personal siempre está
capacitándose para brindar la información más actual.

3
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

PROPÓSITOS

GENERALES

● Elevar la calidad de las ventas al utilizar las herramientas virtuales que


se usarán para brindar mejor perspectiva en los autos.
● Asociarnos con las diversas marcas nacionales e internacionales para
mejor calidad de autos.
● Captar la atención del público de los diferentes sectores sociales para
un grado de aceptabilidad.
● Mantener actualizado los sistemas y herramientas virtuales de diversos
proveedores para brindar servicio de vanguardia.
● Aumento en un 90% el desarrollo del personal de los trabajadores de la
empresa y su inherencia a los valores de esta.
● Mejorar la experiencia del servicio no solo para Lima metropolitana si
no a nivel nacional.
ESPECÍFICOS

● Fortalecer lazos de trabajo con los clientes brindando una capacitación


de calidad.
● Fortalecer valores empresariales en un 30% analizando la cultura
organizacional
● Reorganizar el sistema de comunicación interna en un 80%.
● Impulsar el desarrollo del personal.
● Mejorar y mantener la satisfacción del cliente en un 70%

4
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

DIAGRAMA UML

5
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

PROGRAMA
PACKEGE “ HERENCIA “
JAVA CLASS “ DOCUMENTO “
package Herencias;

public class Documento {


private int nrodocumento;
private String fecha;
private double importeu;
private String NombreProducto;

public Documento(int nrodocumento, String fecha, double importeu, String


NombreProducto) {
this.nrodocumento = nrodocumento;
this.fecha = fecha;
this.importeu = importeu;
this.NombreProducto = NombreProducto;
}

/**
* @return the nrodocumento
*/
public int getNrodocumento() {
return nrodocumento;
}

/**
* @param nrodocumento the nrodocumento to set
*/
public void setNrodocumento(int nrodocumento) {
this.nrodocumento = nrodocumento;

6
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

/**
* @return the fecha
*/
public String getFecha() {
return fecha;
}

/**
* @param fecha the fecha to set
*/
public void setFecha(String fecha) {
this.fecha = fecha;
}

/**
* @return the importeu
*/
public double getImporteu() {
return importeu;
}

/**
* @param importeu the importeu to set
*/
public void setImporteu(double importeu) {
this.importeu = importeu;
}

/**
* @return the NombreProducto

7
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

*/
public String getNombreProducto() {
return NombreProducto;
}

/**
* @param NombreProducto the NombreProducto to set
*/
public void setNombreProducto(String NombreProducto) {
this.NombreProducto = NombreProducto;
}
}
JAVA CLASS “PERSONA “
package Herencias;

import datos.Admi;

public class persona extends Admi {


private int Dni ;
private String Nombre;
private String Apelldio ;
private String Contraseña;

public persona(String Estado, String apellido,String contraseña, int dni , String


nombre) {
super(Estado);
this.Apelldio=apellido;
this.Contraseña=contraseña;
this.Dni=dni;
this.Nombre=nombre;
}

8
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

/**
* @return the Dni
*/
public int getDni() {
return Dni;
}

/**
* @param Dni the Dni to set
*/
public void setDni(int Dni) {
this.Dni = Dni;
}

/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}

/**
* @param Nombre the Nombre to set
*/
public void setNombre(String Nombre) {
this.Nombre = Nombre;
}

/**
* @return the Apelldio
*/
public String getApelldio() {

9
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

return Apelldio;
}

/**
* @param Apelldio the Apelldio to set
*/
public void setApelldio(String Apelldio) {
this.Apelldio = Apelldio;
}

/**
* @return the Contraseña
*/
public String getContraseña() {
return Contraseña;
}

/**
* @param Contraseña the Contraseña to set
*/
public void setContraseña(String Contraseña) {
this.Contraseña = Contraseña;
}
}
PACKEGE “ DATOS”
JAVA CLASS “ ADMI “
package datos;

public class Admi {


private String Estado;

public Admi(String Estado) {

10
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

this.Estado = Estado;
}

/**
* @return the Estado
*/
public String getEstado() {
return Estado;
}

/**
* @param Estado the Estado to set
*/
public void setEstado(String Estado) {
this.Estado = Estado;
}

}
JAVA CLASS “ AUXILIAR “
package datos;

import java.awt.event.KeyEvent;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import precentacion.frmPrincipal;

11
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

public class auxiliar {


//---------------- ESCRITORIO ---------------------
public static void validarNumeros(KeyEvent tecla, String texto , int cantidad){
char t=tecla.getKeyChar();
if(Character.isDigit(t) && texto.length()<cantidad){

}else{
tecla.consume();
}
}
public static void verPantalla(JDesktopPane escritorio, JInternalFrame frame){
if(frame.isShowing()==false){
frmPrincipal.jdpEscritorio.add(frame);
frame.show();
frame.setLocation((escritorio.getWidth()-frame.getWidth())/2,
(escritorio.getHeight()-frame.getHeight())/2);
}
}
//-------------PRODUCTOO -----------------
public static void formatoTablaProducto(JTable tabla,int[] tamaño){
for(int i=0;i<tamaño.length;i++){
tabla.getColumnModel().getColumn(i).setPreferredWidth(tamaño[i]);
}
}
public static String GenerarCodigoProducto(int Cantidad , int Tamaño){
clsProductoTrans pro=new clsProductoTrans();
boolean salir=false;
String codigo="";
int talla=0;
int existe=0;
while(salir==false){

12
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

codigo=""+(int)(Math.random()*Cantidad);
talla=codigo.length();
if(talla<Tamaño){
for(int i =0;i<(Tamaño-talla);i++){
codigo+="0";
}
}
existe=0;
for(int p=0;p<pro.tamaño();p++){
if(Integer.parseInt(codigo)==pro.obtener(p).getCodigo()){
existe++;
break;
}
}
if(existe<1){
salir=true;
}
}
return codigo;
}
public static String Nombre(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el nombre del producto :");
if(texto==null){
texto="";
}
}
}
return texto;
}

13
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

public static void validarDecimales(KeyEvent tecla){


char t= tecla.getKeyChar();
if(Character.isDigit(t) || t=='.'){

}else{
tecla.consume();
}
}
public static double precio (JTextField cajaTexto){
double pre=0;
String preStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
pre=Double.parseDouble(preStr);
salir=true;
} catch (Exception e) {
salir=false;
preStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el precio
");
}
}
return pre;
}
public static int stock(JTextField cajaTexto){
int sto=0;
String stoStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
sto=Integer.parseInt(stoStr);
salir=true;

14
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

} catch (Exception e) {
salir=false;
stoStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el Stock ");
}
}
return sto;
}
public static String estado(JCheckBox chec){
String mensaje="";
if(chec.isSelected()){
mensaje="Habilitado";
}else{
mensaje="Desabilitado";
}
return mensaje;
}
public static String tipo(JComboBox box){
return box.getSelectedItem().toString();
}
public static int provedor(JTextField text){
String texto=text.getText();
boolean salir=false;

while(salir==false){
if(texto.length()<1){
JOptionPane.showMessageDialog(null,"Ingrese el codigo del proveedor ");
texto=text.getText();
}else{
salir=true;
}
}
return Integer.parseInt(texto);

15
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

}
public static void listarProducto(DefaultTableModel dtm, int cantidad){
clsProductoTrans pro=new clsProductoTrans();
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}
}
for(int i=0;i<cantidad;i++){
Object[] obj=new Object[]{
pro.obtener(i).getCodigo(),pro.obtener(i).getNombre(),pro.obtener(i).getPreci
o(),pro.obtener(i).getStock(),
pro.obtener(i).getEstado(),pro.obtener(i).getTipo(),pro.obtener(i).getFecha(),
pro.obtener(i).getCodProvedor()
};
dtm.addRow(obj);
}
}
public static void buscarProducto(KeyEvent tecla,String texto,DefaultTableModel
dtm){
clsProductoTrans pro=new clsProductoTrans();
char t=tecla.getKeyChar();
String cadena=texto+""+t;
if(t==KeyEvent.VK_BACK_SPACE){
cadena=texto.substring(0,cadena.length()-1);
}
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}

16
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

}
for(int i=0;i<pro.tamaño();i++){
if(pro.obtener(i).getNombre().contains(cadena)){
Object[] obj=new Object[]{
pro.obtener(i).getCodigo(),pro.obtener(i).getNombre(),pro.obtener(i).getPr
ecio(),pro.obtener(i).getStock(),
pro.obtener(i).getEstado(),pro.obtener(i).getTipo(),pro.obtener(i).getFecha(),
pro.obtener(i).getCodProvedor()
};
dtm.addRow(obj);
}
}
}
public static void formatoTablaCliente(JTable tabla,int[] tamaño){
for(int i=0;i<tamaño.length;i++){
tabla.getColumnModel().getColumn(i).setPreferredWidth(tamaño[i]);
}
}
// --------------CLIENTEE -----------------------------//
public static int dni(JTextField cajaTexto){
int sto=0;
String stoStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
sto=Integer.parseInt(stoStr);
salir=true;
} catch (Exception e) {
salir=false;
stoStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el DNI ");
}
}

17
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

return sto;
}
public static void validarNumerosCliente(KeyEvent tecla, String texto , int cantidad){
char t=tecla.getKeyChar();
if(Character.isDigit(t) && texto.length()<cantidad){

}else{
tecla.consume();
}
}
public static String NombreCliente(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el nombre del cliente :");
if(texto==null){
texto="";
}
}
}
return texto;
}
public static String ApellidoCliente(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el apellido del cliente :");
if(texto==null){
texto="";
}
}
}

18
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

return texto;
}
public static String tipoClinte(JComboBox box){
return box.getSelectedItem().toString();
}
public static int ruc (JTextField cajaTexto){
int r=0;
String preStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
r =Integer.parseInt(preStr);
salir=true;
} catch (Exception e) {
salir=false;
preStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el precio
");
}
}
return r;
}
public static void listarCliente(DefaultTableModel dtm, int cantidad){
clsClienteTrans pro=new clsClienteTrans();
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}
}
for(int i=0;i<cantidad;i++){
Object[] obj=new Object[]{

19
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

pro.obtener(i).getDni(),pro.obtener(i).getNombre(),pro.obtener(i).getApellido
(),pro.obtener(i).getDia(),
pro.obtener(i).getMes(),pro.obtener(i).getAño(),pro.obtener(i).getRuc(),pro.o
btener(i).getOperacion(),
};
dtm.addRow(obj);
}
}
}
JAVA CLASS “INGRESOTRANS”
package datos;

import Herencias.persona;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;

public class clsIngresoTrans {


ArrayList<persona> emple;

public clsIngresoTrans(){
emple=new ArrayList<persona>();
cargar();
}
public void cargar(){
try{

20
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

File archivo=new File("Emple.txt");


if(archivo.exists()){
BufferedReader br= new BufferedReader (new FileReader(archivo));
String linea="";
while((linea=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(linea,",");
String estado=st.nextToken();
String apellido=st.nextToken();
String contraseña=st.nextToken();
int dni=Integer.parseInt(st.nextToken());
String nombre=st.nextToken();

persona p = new persona(estado, apellido, contraseña, dni, nombre);


adicionar(p);
}
br.close();
}else{
JOptionPane.showMessageDialog(null,"eror al archivo empleados.txt no
existe");
}
}catch (Exception e){
JOptionPane.showMessageDialog(null,"ha sucedido un error al momento de
cargar los registro de empleados ");
}
}

public persona obtener(int pos){


return emple.get(pos);
}
public int tamaño(){
return emple.size();
}

21
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

public void adicionar(persona p){


emple.add(p);
}
public void grabar() throws IOException{
try {
PrintWriter pw=new PrintWriter(new FileWriter("Emple.txt"));
for(int i=0;i<tamaño();i++){
pw.print(obtener(i).getEstado()+","+obtener(i).getApelldio()
+","+obtener(i).getContraseña()+","+obtener(i).getDni()+
","+obtener(i).getNombre()+"\r\n");
}
pw.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null,"error al momento de gravar" +e);
}
}
}
JAVA CLASS “ CLIENTE “
package datos;

public class clsCliente {


private int Dni;
private String Nombre;
private String Apellido;
private int dia;
private int mes;
private int año;
private int ruc ;
private String operacion;

public clsCliente(int Dni, String Nombre, String Apellido, int dia, int mes, int año, int
ruc, String operacion) {

22
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

this.Dni = Dni;
this.Nombre = Nombre;
this.Apellido = Apellido;
this.dia = dia;
this.mes = mes;
this.año = año;
this.ruc = ruc;
this.operacion = operacion;
}

/**
* @return the Dni
*/
public int getDni() {
return Dni;
}

/**
* @param Dni the Dni to set
*/
public void setDni(int Dni) {
this.Dni = Dni;
}

/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}

/**

23
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

* @param Nombre the Nombre to set


*/
public void setNombre(String Nombre) {
this.Nombre = Nombre;
}

/**
* @return the Apellido
*/
public String getApellido() {
return Apellido;
}

/**
* @param Apellido the Apellido to set
*/
public void setApellido(String Apellido) {
this.Apellido = Apellido;
}

/**
* @return the dia
*/
public int getDia() {
return dia;
}

/**
* @param dia the dia to set
*/
public void setDia(int dia) {
this.dia = dia;

24
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

/**
* @return the mes
*/
public int getMes() {
return mes;
}

/**
* @param mes the mes to set
*/
public void setMes(int mes) {
this.mes = mes;
}

/**
* @return the año
*/
public int getAño() {
return año;
}

/**
* @param año the año to set
*/
public void setAño(int año) {
this.año = año;
}

/**
* @return the ruc

25
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

*/
public int getRuc() {
return ruc;
}

/**
* @param ruc the ruc to set
*/
public void setRuc(int ruc) {
this.ruc = ruc;
}

/**
* @return the operacion
*/
public String getOperacion() {
return operacion;
}

/**
* @param operacion the operacion to set
*/
public void setOperacion(String operacion) {
this.operacion = operacion;
}

}
JAVA CLASS “ CLIENTETRANS “
package datos;

import java.io.BufferedReader;
import java.io.File;

26
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public class clsClienteTrans {
ArrayList<clsCliente>pro;

public clsClienteTrans() {
pro = new ArrayList<>() ;
cargar();
}
public void cargar(){
try{
File archivo= new File("cliente.txt");
if(archivo.exists()){
BufferedReader br=new BufferedReader (new FileReader(archivo));
String linea="";
while((linea=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(linea,",");
int dni=Integer.parseInt(st.nextToken());
String nombre=st.nextToken();
String apellido=st.nextToken();
int dia=Integer.parseInt(st.nextToken());
int mes=Integer.parseInt(st.nextToken());
int año=Integer.parseInt(st.nextToken());
int ruc=Integer.parseInt(st.nextToken());
String operacion=st.nextToken();
clsCliente x = new
clsCliente(dni,nombre,apellido,dia,mes,año,ruc,operacion);
adicionar(x);

27
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

}
}else{
JOptionPane.showMessageDialog(null,"el archivo no existe");
}
}catch (Exception e){
}
}
public clsCliente obtener(int pos){
return pro.get(pos);
}
public int tamaño(){
return pro.size();
}
public void adicionar(clsCliente x){
pro.add(x);
}
public void grabar(){
try{
PrintWriter pw=new PrintWriter(new FileWriter("cliente.txt"));
for(int i=0;i<tamaño();i++){
pw.print(obtener(i).getDni()+","+obtener(i).getNombre()
+","+obtener(i).getApellido()+","+obtener(i).getDia()+","+obtener(i).getMes()+
","+obtener(i).getAño()+","+obtener(i).getRuc()+","+obtener(i).getOperacion()
+"\r\n");
}
pw.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Se produjo un error al grabar el
cliente");
}
}
}

28
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

JAVA CLASS “PRODUCTO”


package datos;

public class clsProducto {


private int Codigo;
private String Nombre;
private double Precio;
private int Stock;
private String Estado;
private String fecha;
private String Tipo;
private int CodProvedor;

public clsProducto(int Codigo, String Nombre, double Precio, int Stock, String Estado,
String fecha, String Tipo, int CodProvedor) {
this.Codigo = Codigo;
this.Nombre = Nombre;
this.Precio = Precio;
this.Stock = Stock;
this.Estado = Estado;
this.fecha=fecha;
this.Tipo = Tipo;
this.CodProvedor = CodProvedor;
}

/**
* @return the Codigo
*/
public int getCodigo() {
return Codigo;
}

29
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

/**
* @param Codigo the Codigo to set
*/
public void setCodigo(int Codigo) {
this.Codigo = Codigo;
}

/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}

/**
* @param Nombre the Nombre to set
*/
public void setNombre(String Nombre) {
this.Nombre = Nombre;
}

/**
* @return the Precio
*/
public double getPrecio() {
return Precio;
}

/**
* @param Precio the Precio to set
*/
public void setPrecio(double Precio) {

30
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

this.Precio = Precio;
}

/**
* @return the Stock
*/
public int getStock() {
return Stock;
}

/**
* @param Stock the Stock to set
*/
public void setStock(int Stock) {
this.Stock = Stock;
}

/**
* @return the Estado
*/
public String getEstado() {
return Estado;
}

/**
* @param Estado the Estado to set
*/
public void setEstado(String Estado) {
this.Estado = Estado;
}

/**

31
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

* @return the fecha


*/
public String getFecha() {
return fecha;
}

/**
* @param fecha the fecha to set
*/
public void setFecha(String fecha) {
this.fecha = fecha;
}

/**
* @return the Tipo
*/
public String getTipo() {
return Tipo;
}

/**
* @param Tipo the Tipo to set
*/
public void setTipo(String Tipo) {
this.Tipo = Tipo;
}

/**
* @return the CodProvedor
*/
public int getCodProvedor() {
return CodProvedor;

32
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

/**
* @param CodProvedor the CodProvedor to set
*/
public void setCodProvedor(int CodProvedor) {
this.CodProvedor = CodProvedor;
}

}
JAVA CLASS “PRODUCTOTRANS “
package datos;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;

public class clsProductoTrans {


ArrayList<clsProducto>pro;

public clsProductoTrans() {
pro =new ArrayList<>();
cargar();
}
public void cargar(){
try{
File archivo= new File("Producto.txt");

33
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

if(archivo.exists()){
BufferedReader br=new BufferedReader (new FileReader(archivo));
String linea="";
while((linea=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(linea,",");
int codigo=Integer.parseInt(st.nextToken());
String nombre=st.nextToken();
double precio = Double.parseDouble(st.nextToken());
int stock =Integer.parseInt(st.nextToken());
String estado=st.nextToken();
String fecha = st.nextToken();
String tipo=st.nextToken();
int codPro=Integer.parseInt(st.nextToken());
clsProducto x = new clsProducto(codigo, nombre, precio, stock,
estado,fecha, tipo, codPro);
adicionar(x);
}
}else{
JOptionPane.showMessageDialog(null,"el archivo no existe");
}
}catch (Exception e){
}
}

public clsProducto obtener(int pos){


return pro.get(pos);
}
public int tamaño(){
return pro.size();
}
public void adicionar(clsProducto x){
pro.add(x);

34
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

}
public void grabar(){
try{
PrintWriter
pw=new

PrintWriter(new FileWriter("Producto.txt"));
for(int i=0;i<tamaño();i++){
pw.print(obtener(i).getCodigo()+","+obtener(i).getNombre()
+","+obtener(i).getPrecio()+","+obtener(i).getStock()+
","+obtener(i).getEstado()+","+obtener(i).getTipo()+","+obtener(i).getFecha()
+","+obtener(i).getCodProvedor()+"\r\n");

}
pw.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Se produjo un error al gravar el
producto");
}
}
}

35
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

36
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

37
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

38
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

39
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

SQL - XAMP

CONEXIÓN SQL

40
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

Accedemos al SQL y al ingreso de nuestro NetBeans para poder ingresar, se hizo un


escritorio para administrador y otro para usuario o invitado

41
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

42
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

CONEXIÓN A BASE DE DATOS

43
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

44
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ

CONCLUSIONES
Con la implementación de este proyecto ha permitido emplear cada una de las clases
mostradas durante cada sección de aprendizaje semanal para llegar a tomar todas las
herramientas para darle un sistema amigable y fácil para su uso a la empresa que nos
propusimos desarrollar.

45

También podría gustarte