├── nbproject
├── private
│ ├── config.properties
│ ├── private.properties
│ └── private.xml
├── genfiles.properties
├── project.xml
└── project.properties
├── .idea
├── .gitignore
├── vcs.xml
├── libraries
│ ├── System.xml
│ └── lib.xml
├── modules.xml
├── misc.xml
└── uiDesigner.xml
├── manifest.mf
├── dist
├── System.jar
├── lib
│ ├── jcalendar-1.4.jar
│ └── mssql-jdbc-12.2.0.jre8.jar
└── README.TXT
├── src
├── files
│ ├── 37_104846.png
│ ├── Reports_25409.png
│ ├── homepage1_114609.png
│ ├── minuscirclehd_106108.png
│ ├── sign-info-icon_34361.png
│ ├── systemshutdown_103390.png
│ ├── add_icon-icons.com_74429.png
│ ├── apps_network_config_15750.png
│ ├── shipping_products_22121.png
│ ├── sign-question-icon_34359.png
│ ├── profile_config_icon_149889.png
│ ├── warehause_products_safety_5996.png
│ ├── employee_group_solid_icon_235378.png
│ ├── exit_closethesession_close_6317.png
│ ├── shoppingcart_accept_compra_12832.png
│ ├── User_Group-80_icon-icons.com_57247.png
│ ├── barchart_statistics_diagram_icon_187071.png
│ ├── blue_users_customers_clients_people_12438.png
│ ├── supermarket_cart_store_market_icon_180221.png
│ ├── offer_discount_sales_pay_online_icon_227992.png
│ ├── shoppaymentorderbuy-10_icon-icons.com_73874.png
│ ├── pngtree-computer-online-shopping-png-image_1695221.png
│ ├── black_friday_sales_tag_sale_offers_deals_icon_159225.png
│ ├── analytic_dashboard_home_manage_user_interface_icon_123286.png
│ ├── iconfinder-654-categories-check-list-listing-mark-4017597_113091.png
│ ├── masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png
│ └── report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png
└── com
│ ├── capaData
│ ├── MCategory.java
│ ├── MSupplier.java
│ ├── MUser.java
│ ├── MBuysDetails.java
│ ├── MSaleDetails.java
│ ├── MEmployee.java
│ ├── MProduct.java
│ ├── MClients.java
│ ├── MBuys.java
│ └── MSale.java
│ ├── capaLogica
│ ├── Functions.java
│ ├── CConnetion.java
│ ├── NCategory.java
│ ├── NBuysDetails.java
│ ├── NSaleDetails.java
│ ├── NSupplier.java
│ ├── NEmployee.java
│ ├── NClients.java
│ ├── NBuys.java
│ ├── NSale.java
│ ├── NUser.java
│ └── NProduct.java
│ └── capaPresentacion
│ ├── FrmSale.form
│ ├── FrmSale.java
│ ├── FrmSaleDetails.form
│ ├── FrmBuysDetails.form
│ ├── FrmBuysDetails.java
│ ├── FrmCategory.form
│ ├── FrmSaleDetails.java
│ ├── FrmSupplierView.form
│ ├── FrmProductView.form
│ ├── FrmCategory.java
│ ├── FrmEmployeeView.form
│ ├── FrmSupplierView.java
│ ├── FrmProductView.java
│ └── FrmEmployeeView.java
├── out
└── production
│ └── SystemVIP
│ └── files
│ ├── 37_104846.png
│ ├── Reports_25409.png
│ ├── homepage1_114609.png
│ ├── minuscirclehd_106108.png
│ ├── sign-info-icon_34361.png
│ ├── systemshutdown_103390.png
│ ├── add_icon-icons.com_74429.png
│ ├── shipping_products_22121.png
│ ├── sign-question-icon_34359.png
│ ├── apps_network_config_15750.png
│ ├── profile_config_icon_149889.png
│ ├── exit_closethesession_close_6317.png
│ ├── warehause_products_safety_5996.png
│ ├── User_Group-80_icon-icons.com_57247.png
│ ├── employee_group_solid_icon_235378.png
│ ├── shoppingcart_accept_compra_12832.png
│ ├── barchart_statistics_diagram_icon_187071.png
│ ├── blue_users_customers_clients_people_12438.png
│ ├── supermarket_cart_store_market_icon_180221.png
│ ├── offer_discount_sales_pay_online_icon_227992.png
│ ├── shoppaymentorderbuy-10_icon-icons.com_73874.png
│ ├── pngtree-computer-online-shopping-png-image_1695221.png
│ ├── black_friday_sales_tag_sale_offers_deals_icon_159225.png
│ ├── analytic_dashboard_home_manage_user_interface_icon_123286.png
│ ├── iconfinder-654-categories-check-list-listing-mark-4017597_113091.png
│ ├── masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png
│ └── report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png
├── SystemVIP.iml
├── .gitignore
├── DB
├── Soporte1.txt
└── Soporte.txt
└── README.md
/nbproject/private/config.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/dist/System.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/dist/System.jar
--------------------------------------------------------------------------------
/src/files/37_104846.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/37_104846.png
--------------------------------------------------------------------------------
/dist/lib/jcalendar-1.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/dist/lib/jcalendar-1.4.jar
--------------------------------------------------------------------------------
/src/files/Reports_25409.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/Reports_25409.png
--------------------------------------------------------------------------------
/src/files/homepage1_114609.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/homepage1_114609.png
--------------------------------------------------------------------------------
/src/files/minuscirclehd_106108.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/minuscirclehd_106108.png
--------------------------------------------------------------------------------
/src/files/sign-info-icon_34361.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/sign-info-icon_34361.png
--------------------------------------------------------------------------------
/dist/lib/mssql-jdbc-12.2.0.jre8.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/dist/lib/mssql-jdbc-12.2.0.jre8.jar
--------------------------------------------------------------------------------
/src/files/systemshutdown_103390.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/systemshutdown_103390.png
--------------------------------------------------------------------------------
/src/files/add_icon-icons.com_74429.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/add_icon-icons.com_74429.png
--------------------------------------------------------------------------------
/src/files/apps_network_config_15750.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/apps_network_config_15750.png
--------------------------------------------------------------------------------
/src/files/shipping_products_22121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/shipping_products_22121.png
--------------------------------------------------------------------------------
/src/files/sign-question-icon_34359.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/sign-question-icon_34359.png
--------------------------------------------------------------------------------
/src/files/profile_config_icon_149889.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/profile_config_icon_149889.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/37_104846.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/37_104846.png
--------------------------------------------------------------------------------
/src/files/warehause_products_safety_5996.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/warehause_products_safety_5996.png
--------------------------------------------------------------------------------
/src/files/employee_group_solid_icon_235378.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/employee_group_solid_icon_235378.png
--------------------------------------------------------------------------------
/src/files/exit_closethesession_close_6317.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/exit_closethesession_close_6317.png
--------------------------------------------------------------------------------
/src/files/shoppingcart_accept_compra_12832.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/shoppingcart_accept_compra_12832.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/Reports_25409.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/Reports_25409.png
--------------------------------------------------------------------------------
/src/files/User_Group-80_icon-icons.com_57247.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/User_Group-80_icon-icons.com_57247.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/homepage1_114609.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/homepage1_114609.png
--------------------------------------------------------------------------------
/src/files/barchart_statistics_diagram_icon_187071.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/barchart_statistics_diagram_icon_187071.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/minuscirclehd_106108.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/minuscirclehd_106108.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/sign-info-icon_34361.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/sign-info-icon_34361.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/systemshutdown_103390.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/systemshutdown_103390.png
--------------------------------------------------------------------------------
/src/files/blue_users_customers_clients_people_12438.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/blue_users_customers_clients_people_12438.png
--------------------------------------------------------------------------------
/src/files/supermarket_cart_store_market_icon_180221.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/supermarket_cart_store_market_icon_180221.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/add_icon-icons.com_74429.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/add_icon-icons.com_74429.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/shipping_products_22121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/shipping_products_22121.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/sign-question-icon_34359.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/sign-question-icon_34359.png
--------------------------------------------------------------------------------
/src/files/offer_discount_sales_pay_online_icon_227992.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/offer_discount_sales_pay_online_icon_227992.png
--------------------------------------------------------------------------------
/src/files/shoppaymentorderbuy-10_icon-icons.com_73874.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/shoppaymentorderbuy-10_icon-icons.com_73874.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/apps_network_config_15750.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/apps_network_config_15750.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/profile_config_icon_149889.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/profile_config_icon_149889.png
--------------------------------------------------------------------------------
/src/files/pngtree-computer-online-shopping-png-image_1695221.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/pngtree-computer-online-shopping-png-image_1695221.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/exit_closethesession_close_6317.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/exit_closethesession_close_6317.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/warehause_products_safety_5996.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/warehause_products_safety_5996.png
--------------------------------------------------------------------------------
/src/files/black_friday_sales_tag_sale_offers_deals_icon_159225.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/black_friday_sales_tag_sale_offers_deals_icon_159225.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/User_Group-80_icon-icons.com_57247.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/User_Group-80_icon-icons.com_57247.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/employee_group_solid_icon_235378.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/employee_group_solid_icon_235378.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/shoppingcart_accept_compra_12832.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/shoppingcart_accept_compra_12832.png
--------------------------------------------------------------------------------
/src/files/analytic_dashboard_home_manage_user_interface_icon_123286.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/analytic_dashboard_home_manage_user_interface_icon_123286.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/barchart_statistics_diagram_icon_187071.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/barchart_statistics_diagram_icon_187071.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/blue_users_customers_clients_people_12438.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/blue_users_customers_clients_people_12438.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/supermarket_cart_store_market_icon_180221.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/supermarket_cart_store_market_icon_180221.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/offer_discount_sales_pay_online_icon_227992.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/offer_discount_sales_pay_online_icon_227992.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/shoppaymentorderbuy-10_icon-icons.com_73874.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/shoppaymentorderbuy-10_icon-icons.com_73874.png
--------------------------------------------------------------------------------
/src/files/iconfinder-654-categories-check-list-listing-mark-4017597_113091.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/iconfinder-654-categories-check-list-listing-mark-4017597_113091.png
--------------------------------------------------------------------------------
/src/files/masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/pngtree-computer-online-shopping-png-image_1695221.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/pngtree-computer-online-shopping-png-image_1695221.png
--------------------------------------------------------------------------------
/.idea/libraries/System.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/black_friday_sales_tag_sale_offers_deals_icon_159225.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/black_friday_sales_tag_sale_offers_deals_icon_159225.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/analytic_dashboard_home_manage_user_interface_icon_123286.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/analytic_dashboard_home_manage_user_interface_icon_123286.png
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/iconfinder-654-categories-check-list-listing-mark-4017597_113091.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/iconfinder-654-categories-check-list-listing-mark-4017597_113091.png
--------------------------------------------------------------------------------
/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | compile.on.save=true
2 | do.depend=false
3 | do.jar=true
4 | do.jlink=false
5 | javac.debug=true
6 | javadoc.preview=true
7 | jlink.strip=false
8 | user.properties.file=C:\\Users\\Miguel Antonio\\AppData\\Roaming\\NetBeans\\16\\build.properties
9 |
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/masculine-user-with-suit-tie-and-locked-padlock_icon-icons.com_68295.png
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/files/report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/src/files/report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/out/production/SystemVIP/files/report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MiguelAntonioRS/Gestion-Project-of-Buys-and-Sales/HEAD/out/production/SystemVIP/files/report_data_analytics_user_interface_statistics_website_browser_bar_chart_dashboard_icon_210838.png
--------------------------------------------------------------------------------
/.idea/libraries/lib.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SystemVIP.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### IntelliJ IDEA ###
2 | out/
3 | !**/src/main/**/out/
4 | !**/src/test/**/out/
5 |
6 | ### Eclipse ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 | bin/
15 | !**/src/main/**/bin/
16 | !**/src/test/**/bin/
17 |
18 | ### NetBeans ###
19 | /nbproject/private/
20 | /nbbuild/
21 | /dist/
22 | /nbdist/
23 | /.nb-gradle/
24 |
25 | ### VS Code ###
26 | .vscode/
27 |
28 | ### Mac OS ###
29 | .DS_Store
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=c922a781
2 | build.xml.script.CRC32=47349c86
3 | build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=c922a781
7 | nbproject/build-impl.xml.script.CRC32=f8890476
8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
9 |
--------------------------------------------------------------------------------
/src/com/capaData/MCategory.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MCategory {
8 | private String nCategory;
9 |
10 | public MCategory() {
11 | }
12 |
13 | public MCategory(String nCategory) {
14 | this.nCategory = nCategory;
15 | }
16 |
17 | public String getnCategory() {
18 | return nCategory;
19 | }
20 |
21 | public void setnCategory(String nCategory) {
22 | this.nCategory = nCategory;
23 | }
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | System
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/DB/Soporte1.txt:
--------------------------------------------------------------------------------
1 | sp_listar_clientes
2 | sp_guardar_clientes
3 | sp_editar_clientes
4 | sp_eliminar_clientes
5 | sp_buscar_clientes
6 | sp_listar_empleados
7 | sp_guardar_empleados
8 | sp_eliminar_empleados
9 | sp_editar_empleados
10 | sp_buscar_empleados
11 | sp_listar_proveedor
12 | sp_guardar_proveedor
13 | sp_eliminar_proveedor
14 | sp_editar_proveedor
15 | sp_buscar_proveedor
16 | sp_sesion
17 | sp_listar_usuario
18 | sp_eliminar_usuarios
19 | sp_editar_usuarios
20 | sp_listar_categoria
21 | registrarCategoria
22 | sp_listar_producto
23 | sp_guardar_producto
24 | sp_eliminar_producto
25 |
--------------------------------------------------------------------------------
/src/com/capaLogica/Functions.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 | /**
6 | *
7 | * @author Miguel Antonio
8 | */
9 | public class Functions {
10 | public static String getHourActual(){
11 |
12 | Date hour = new Date();
13 | SimpleDateFormat formats = new SimpleDateFormat("hh,mm,ss");
14 | return formats.format(hour);
15 | }
16 |
17 | public static String getDateActual(){
18 |
19 | Date hour = new Date();
20 | SimpleDateFormat formats = new SimpleDateFormat("yyyy-MM-dd");
21 | return formats.format(hour);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/com/capaLogica/CConnetion.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 | import java.sql.SQLException;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class CConnetion {
12 |
13 | public static Connection getconec(){
14 |
15 | String url = "jdbc:sqlserver://localhost:1433;"
16 | + "database=DB_Ventas;"
17 | + "user=soporte;"
18 | + "password=soporte;"
19 | + "loginTimeout=30;"
20 | + "TrustServerCertificate=True";
21 |
22 | try {
23 | Connection con = DriverManager.getConnection(url);
24 | return con;
25 | } catch (SQLException ex) {
26 | System.out.println(ex.toString());
27 | return null;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/com/capaLogica/NCategory.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MCategory;
4 | import java.sql.Connection;
5 | import java.sql.PreparedStatement;
6 | import javax.swing.JOptionPane;
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class NCategory {
12 |
13 | private CConnetion SQL = new CConnetion();
14 | private Connection cn = SQL.getconec();
15 | String sql = "";
16 |
17 | public boolean insert(MCategory dts){
18 |
19 | sql = ("{call registrarCategoria (?)}");
20 | try {
21 | PreparedStatement pst = cn.prepareStatement(sql);
22 | pst.setString(1, dts.getnCategory());
23 |
24 | int n = pst.executeUpdate();
25 | if (n != 0) {
26 |
27 | return true;
28 | } else {
29 |
30 | return false;
31 | }
32 | } catch (Exception e) {
33 | JOptionPane.showMessageDialog(null, e.toString());
34 | return false;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaPresentacion/FrmMenu.java
7 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaLogica/NBuys.java
8 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaLogica/NSale.java
9 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaPresentacion/FrmLogIn.java
10 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaData/MSale.java
11 | file:/C:/Users/Miguel%20Antonio/Documents/NetBeansProjects/System/src/com/capaPresentacion/FrmSale.java
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/dist/README.TXT:
--------------------------------------------------------------------------------
1 | ========================
2 | BUILD OUTPUT DESCRIPTION
3 | ========================
4 |
5 | When you build an Java application project that has a main class, the IDE
6 | automatically copies all of the JAR
7 | files on the projects classpath to your projects dist/lib folder. The IDE
8 | also adds each of the JAR files to the Class-Path element in the application
9 | JAR files manifest file (MANIFEST.MF).
10 |
11 | To run the project from the command line, go to the dist folder and
12 | type the following:
13 |
14 | java -jar "System.jar"
15 |
16 | To distribute this project, zip up the dist folder (including the lib folder)
17 | and distribute the ZIP file.
18 |
19 | Notes:
20 |
21 | * If two JAR files on the project classpath have the same name, only the first
22 | JAR file is copied to the lib folder.
23 | * Only JAR files are copied to the lib folder.
24 | If the classpath contains other types of files or folders, these files (folders)
25 | are not copied.
26 | * If a library on the projects classpath also has a Class-Path element
27 | specified in the manifest,the content of the Class-Path element has to be on
28 | the projects runtime path.
29 | * To set a main class in a standard Java project, right-click the project node
30 | in the Projects window and choose Properties. Then click Run and enter the
31 | class name in the Main Class field. Alternatively, you can manually type the
32 | class name in the manifest Main-Class element.
33 |
--------------------------------------------------------------------------------
/src/com/capaData/MSupplier.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MSupplier {
8 | private String idSupplier;
9 | private String socialRazon;
10 | private String ruc;
11 | private String phone;
12 | private String address;
13 |
14 | public MSupplier() {
15 | }
16 |
17 | public MSupplier(String idSupplier, String socialRazon, String ruc, String phone, String direction) {
18 | this.idSupplier = idSupplier;
19 | this.socialRazon = socialRazon;
20 | this.ruc = ruc;
21 | this.phone = phone;
22 | this.address = direction;
23 | }
24 |
25 | public String getIdSupplier() {
26 | return idSupplier;
27 | }
28 |
29 | public void setIdSupplier(String idSupplier) {
30 | this.idSupplier = idSupplier;
31 | }
32 |
33 | public String getSocialRazon() {
34 | return socialRazon;
35 | }
36 |
37 | public void setSocialRazon(String socialRazon) {
38 | this.socialRazon = socialRazon;
39 | }
40 |
41 | public String getRuc() {
42 | return ruc;
43 | }
44 |
45 | public void setRuc(String ruc) {
46 | this.ruc = ruc;
47 | }
48 |
49 | public String getPhone() {
50 | return phone;
51 | }
52 |
53 | public void setPhone(String phone) {
54 | this.phone = phone;
55 | }
56 |
57 | public String getAddress() {
58 | return address;
59 | }
60 |
61 | public void setAddress(String address) {
62 | this.address = address;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/capaData/MUser.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MUser {
8 |
9 | private int idUser;
10 | private String idEmployee;
11 | private String user;
12 | private String password;
13 | private String access;
14 | private String status;
15 |
16 | public MUser() {
17 | }
18 |
19 | public MUser(int idUser, String idEmployee, String user, String password, String access, String status) {
20 | this.idUser = idUser;
21 | this.idEmployee = idEmployee;
22 | this.user = user;
23 | this.password = password;
24 | this.access = access;
25 | this.status = status;
26 | }
27 |
28 | public int getIdUser() {
29 | return idUser;
30 | }
31 |
32 | public void setIdUser(int idUser) {
33 | this.idUser = idUser;
34 | }
35 |
36 | public String getIdEmployee() {
37 | return idEmployee;
38 | }
39 |
40 | public void setIdEmployee(String idEmployee) {
41 | this.idEmployee = idEmployee;
42 | }
43 |
44 | public String getUser() {
45 | return user;
46 | }
47 |
48 | public void setUser(String user) {
49 | this.user = user;
50 | }
51 |
52 | public String getPassword() {
53 | return password;
54 | }
55 |
56 | public void setPassword(String password) {
57 | this.password = password;
58 | }
59 |
60 | public String getAccess() {
61 | return access;
62 | }
63 |
64 | public void setAccess(String access) {
65 | this.access = access;
66 | }
67 |
68 | public String getStatus() {
69 | return status;
70 | }
71 |
72 | public void setStatus(String status) {
73 | this.status = status;
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/com/capaData/MBuysDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MBuysDetails {
8 |
9 | private int idBuysDetails;
10 | private int idBuys;
11 | private String idProduct;
12 | private int amount;
13 | private double price;
14 | private double total;
15 |
16 | public MBuysDetails() {
17 | }
18 |
19 | public MBuysDetails(int idBuysDetails, int idBuys, String idProduct, int amount, double price, double total) {
20 | this.idBuysDetails = idBuysDetails;
21 | this.idBuys = idBuys;
22 | this.idProduct = idProduct;
23 | this.amount = amount;
24 | this.price = price;
25 | this.total = total;
26 | }
27 |
28 | public int getIdBuysDetails() {
29 | return idBuysDetails;
30 | }
31 |
32 | public void setIdBuysDetails(int idBuysDetails) {
33 | this.idBuysDetails = idBuysDetails;
34 | }
35 |
36 | public int getIdBuys() {
37 | return idBuys;
38 | }
39 |
40 | public void setIdBuys(int idBuys) {
41 | this.idBuys = idBuys;
42 | }
43 |
44 | public String getIdProduct() {
45 | return idProduct;
46 | }
47 |
48 | public void setIdProduct(String idProduct) {
49 | this.idProduct = idProduct;
50 | }
51 |
52 | public int getAmount() {
53 | return amount;
54 | }
55 |
56 | public void setAmount(int amount) {
57 | this.amount = amount;
58 | }
59 |
60 | public double getPrice() {
61 | return price;
62 | }
63 |
64 | public void setPrice(double price) {
65 | this.price = price;
66 | }
67 |
68 | public double getTotal() {
69 | return total;
70 | }
71 |
72 | public void setTotal(double total) {
73 | this.total = total;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSale.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
36 |
--------------------------------------------------------------------------------
/src/com/capaData/MSaleDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MSaleDetails {
8 |
9 | private int idSaleDetails;
10 | private int idSale;
11 | private String idProduct;
12 | private int quantity;
13 | private Double price;
14 | private Double total;
15 |
16 | public MSaleDetails() {
17 | }
18 |
19 | public MSaleDetails(int idSaleDetails, int idSale, String idProduct, int quantity, Double price, Double total) {
20 | this.idSaleDetails = idSaleDetails;
21 | this.idSale = idSale;
22 | this.idProduct = idProduct;
23 | this.quantity = quantity;
24 | this.price = price;
25 | this.total = total;
26 | }
27 |
28 | public int getIdSaleDetails() {
29 | return idSaleDetails;
30 | }
31 |
32 | public void setIdSaleDetails(int idSaleDetails) {
33 | this.idSaleDetails = idSaleDetails;
34 | }
35 |
36 | public int getIdSale() {
37 | return idSale;
38 | }
39 |
40 | public void setIdSale(int idSale) {
41 | this.idSale = idSale;
42 | }
43 |
44 | public String getIdProduct() {
45 | return idProduct;
46 | }
47 |
48 | public void setIdProduct(String idProduct) {
49 | this.idProduct = idProduct;
50 | }
51 |
52 | public int getQuantity() {
53 | return quantity;
54 | }
55 |
56 | public void setQuantity(int quantity) {
57 | this.quantity = quantity;
58 | }
59 |
60 | public Double getPrice() {
61 | return price;
62 | }
63 |
64 | public void setPrice(Double price) {
65 | this.price = price;
66 | }
67 |
68 | public Double getTotal() {
69 | return total;
70 | }
71 |
72 | public void setTotal(Double total) {
73 | this.total = total;
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/com/capaData/MEmployee.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | *
5 | * @author Miguel Antonio
6 | */
7 | public class MEmployee {
8 |
9 | private String idEmployee;
10 | private String firstName;
11 | private String lastName;
12 | private String dni;
13 | private String phone;
14 | private String direction;
15 |
16 | public MEmployee() {
17 | }
18 |
19 | public MEmployee(String idEmployee, String firstName, String lastName, String dni, String phone, String direction) {
20 | this.idEmployee = idEmployee;
21 | this.firstName = firstName;
22 | this.lastName = lastName;
23 | this.dni = dni;
24 | this.phone = phone;
25 | this.direction = direction;
26 | }
27 |
28 | public String getIdEmployee() {
29 | return idEmployee;
30 | }
31 |
32 | public void setIdEmployee(String idEmployee) {
33 | this.idEmployee = idEmployee;
34 | }
35 |
36 | public String getFirstName() {
37 | return firstName;
38 | }
39 |
40 | public void setFirstName(String firstName) {
41 | this.firstName = firstName;
42 | }
43 |
44 | public String getLastName() {
45 | return lastName;
46 | }
47 |
48 | public void setLastName(String lastName) {
49 | this.lastName = lastName;
50 | }
51 |
52 | public String getDni() {
53 | return dni;
54 | }
55 |
56 | public void setDni(String dni) {
57 | this.dni = dni;
58 | }
59 |
60 | public String getPhone() {
61 | return phone;
62 | }
63 |
64 | public void setPhone(String phone) {
65 | this.phone = phone;
66 | }
67 |
68 | public String getDirection() {
69 | return direction;
70 | }
71 |
72 | public void setDirection(String direction) {
73 | this.direction = direction;
74 | }
75 |
76 | @Override
77 | public String toString() {
78 | return "MEmployee{" + "idEmployee=" + idEmployee + ", firstName=" + firstName +
79 | ", lastName=" + lastName + ", dni=" + dni + ", phone=" + phone + ", direction=" + direction + '}';
80 | }
81 |
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/src/com/capaData/MProduct.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | import java.sql.Date;
4 | /**
5 | *
6 | * @author Miguel Antonio
7 | */
8 | public class MProduct {
9 |
10 | private String idProduct;
11 | private int idCategory;
12 | private String serie;
13 | private String name;
14 | private Date fIncome;
15 | private Date fExpiration;
16 | private double pSale;
17 | private double pBuys;
18 |
19 | public MProduct() {
20 | }
21 |
22 | public MProduct(String idProduct, int idCategory, String serie, String name, Date fIncome, Date fExpiration, double pSale, double pBuys) {
23 | this.idProduct = idProduct;
24 | this.idCategory = idCategory;
25 | this.serie = serie;
26 | this.name = name;
27 | this.fIncome = fIncome;
28 | this.fExpiration = fExpiration;
29 | this.pSale = pSale;
30 | this.pBuys = pBuys;
31 | }
32 |
33 | public String getIdProduct() {
34 | return idProduct;
35 | }
36 |
37 | public void setIdProduct(String idProduct) {
38 | this.idProduct = idProduct;
39 | }
40 |
41 | public int getIdCategory() {
42 | return idCategory;
43 | }
44 |
45 | public void setIdCategory(int idCategory) {
46 | this.idCategory = idCategory;
47 | }
48 |
49 | public String getSerie() {
50 | return serie;
51 | }
52 |
53 | public void setSerie(String serie) {
54 | this.serie = serie;
55 | }
56 |
57 | public String getName() {
58 | return name;
59 | }
60 |
61 | public void setName(String name) {
62 | this.name = name;
63 | }
64 |
65 | public Date getfIncome() {
66 | return fIncome;
67 | }
68 |
69 | public void setfIncome(Date fIncome) {
70 | this.fIncome = fIncome;
71 | }
72 |
73 | public Date getfExpiration() {
74 | return fExpiration;
75 | }
76 |
77 | public void setfExpiration(Date fExpiration) {
78 | this.fExpiration = fExpiration;
79 | }
80 |
81 | public double getpSale() {
82 | return pSale;
83 | }
84 |
85 | public void setpSale(double pSale) {
86 | this.pSale = pSale;
87 | }
88 |
89 | public double getpBuys() {
90 | return pBuys;
91 | }
92 |
93 | public void setpBuys(double pBuys) {
94 | this.pBuys = pBuys;
95 | }
96 |
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NBuysDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MBuysDetails;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import javax.swing.JOptionPane;
9 | import javax.swing.table.DefaultTableModel;
10 |
11 | /**
12 | *
13 | * @author Miguel Antonio
14 | */
15 | public class NBuysDetails {
16 |
17 | private CConnetion SQL = new CConnetion();
18 | private Connection cn = SQL.getconec();
19 | String sql = "";
20 |
21 | public DefaultTableModel showA(String buscar) {
22 | DefaultTableModel model;
23 |
24 | String[] tittles = {"ID", "ID Compra", "Producto", "Cantidad", "Precio", "Total"};
25 | model = new DefaultTableModel(null, tittles);
26 | String[] register = new String[6];
27 | sql = ("sp_listar_detalle_compra'" + buscar + "'");
28 | try {
29 | Statement st = cn.createStatement();
30 | ResultSet rs = st.executeQuery(sql);
31 |
32 | while (rs.next()) {
33 | register[0] = rs.getString(1);
34 | register[1] = rs.getString(2);
35 | register[2] = rs.getString(3);
36 | register[3] = rs.getString(4);
37 | register[4] = rs.getString(5);
38 | register[5] = rs.getString(6);
39 | model.addRow(register);
40 | }
41 | return model;
42 |
43 | } catch (Exception ex) {
44 | JOptionPane.showMessageDialog(null, ex.toString());
45 | return null;
46 | }
47 | }
48 |
49 | public boolean insert(MBuysDetails dts) {
50 | sql = ("{call sp_guardar_detalle_compra (?,?,?,?,?)}");
51 |
52 | try {
53 |
54 | PreparedStatement pst = cn.prepareStatement(sql);
55 | pst.setInt(1, dts.getIdBuys());
56 | pst.setString(2, dts.getIdProduct());
57 | pst.setInt(3, dts.getAmount());
58 | pst.setDouble(4, dts.getPrice());
59 | pst.setDouble(5, dts.getTotal());
60 |
61 | int n = pst.executeUpdate();
62 |
63 | if (n != 0) {
64 | return true;
65 | } else {
66 | return false;
67 | }
68 |
69 | } catch (Exception e) {
70 | JOptionPane.showMessageDialog(null, "Error");
71 | return false;
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NSaleDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MSaleDetails;
4 | import java.sql.Connection;
5 | import java.sql.PreparedStatement;
6 | import java.sql.ResultSet;
7 | import java.sql.Statement;
8 | import javax.swing.JOptionPane;
9 | import javax.swing.table.DefaultTableModel;
10 |
11 | /**
12 | *
13 | * @author Miguel Antonio
14 | */
15 | public class NSaleDetails {
16 |
17 | private CConnetion SQL = new CConnetion();
18 | private Connection cn = SQL.getconec();
19 | String sql = "";
20 |
21 | public DefaultTableModel showA(String search) {
22 | DefaultTableModel model;
23 |
24 | String[] tittles = {"ID Venta", "ID Producto", "Producto", "Cantidad", "Precio Venta", "Total"};
25 | model = new DefaultTableModel(null, tittles);
26 | String[] register = new String[6];
27 | sql = ("sp_listar_detalle_venta'" + search + "'");
28 | try {
29 | Statement st = cn.createStatement();
30 | ResultSet rs = st.executeQuery(sql);
31 |
32 | while (rs.next()) {
33 | register[0] = rs.getString(1);
34 | register[1] = rs.getString(2);
35 | register[2] = rs.getString(3);
36 | register[3] = rs.getString(4);
37 | register[4] = rs.getString(5);
38 | register[5] = rs.getString(6);
39 | model.addRow(register);
40 | }
41 | return model;
42 |
43 | } catch (Exception ex) {
44 | JOptionPane.showMessageDialog(null, ex.toString());
45 | return null;
46 | }
47 | }
48 |
49 | public boolean insert(MSaleDetails dts) {
50 | sql = ("{call sp_guardar_detalle_venta (?,?,?,?,?)}");
51 |
52 | try {
53 |
54 | PreparedStatement pst = cn.prepareStatement(sql);
55 | pst.setInt(1, dts.getIdSale());
56 | pst.setString(2, dts.getIdProduct());
57 | pst.setInt(3, dts.getQuantity());
58 | pst.setDouble(4, dts.getPrice());
59 | pst.setDouble(5, dts.getTotal());
60 |
61 | int n = pst.executeUpdate();
62 |
63 | if (n != 0) {
64 | return true;
65 | } else {
66 | return false;
67 | }
68 |
69 | } catch (Exception e) {
70 | JOptionPane.showMessageDialog(null, e.toString());
71 | return false;
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/capaData/MClients.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | /**
4 | * @author Miguel Antonio
5 | */
6 | public class MClients {
7 |
8 | private String codigo;
9 | private String apellidos;
10 | private String nombres;
11 | private String dni;
12 | private String ruc;
13 | private int edad;
14 | private String sexo;
15 | private String telefono;
16 | private String direccion;
17 |
18 | public MClients() {
19 | }
20 |
21 | public MClients(String codigo, String apellidos, String nombres, String dni, String ruc, int age, String sexo, String telefono, String direccion) {
22 | this.codigo = codigo;
23 | this.apellidos = apellidos;
24 | this.nombres = nombres;
25 | this.dni = dni;
26 | this.ruc = ruc;
27 | this.edad = edad;
28 | this.sexo = sexo;
29 | this.telefono = telefono;
30 | this.direccion = direccion;
31 | }
32 |
33 | public String getCodigo() {
34 | return codigo;
35 | }
36 |
37 | public void setCodigo(String codigo) {
38 | this.codigo = codigo;
39 | }
40 |
41 | public String getApellidos() {
42 | return apellidos;
43 | }
44 |
45 | public void setApellidos(String apellidos) {
46 | this.apellidos = apellidos;
47 | }
48 |
49 | public String getNombres() {
50 | return nombres;
51 | }
52 |
53 | public void setNombres(String nombres) {
54 | this.nombres = nombres;
55 | }
56 |
57 | public String getDni() {
58 | return dni;
59 | }
60 |
61 | public void setDni(String dni) {
62 | this.dni = dni;
63 | }
64 |
65 | public String getRuc() {
66 | return ruc;
67 | }
68 |
69 | public void setRuc(String ruc) {
70 | this.ruc = ruc;
71 | }
72 |
73 | public int getEdad() {
74 | return edad;
75 | }
76 |
77 | public void setEdad(int age) {
78 | this.edad = age;
79 | }
80 |
81 | public String getSexo() {
82 | return sexo;
83 | }
84 |
85 | public void setSexo(String sexo) {
86 | this.sexo = sexo;
87 | }
88 |
89 | public String getTelefono() {
90 | return telefono;
91 | }
92 |
93 | public void setTelefono(String telefono) {
94 | this.telefono = telefono;
95 | }
96 |
97 | public String getDireccion() {
98 | return direccion;
99 | }
100 |
101 | public void setDireccion(String direccion) {
102 | this.direccion = direccion;
103 | }
104 |
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 🛒 Purchase and Sales Management System
2 |
3 | This is a **Java-based desktop application** with a graphical user interface (GUI) built using **Swing**, and uses **SQL Server** as the backend database. The system allows users to manage purchases, sales, and other related operations.
4 |
5 | ---
6 |
7 | ## 🔧 Key Features
8 |
9 | - ✅ User authentication via login form.
10 | - 📋 Main menu with access to modules like:
11 | - Purchase Management
12 | - Sales Management
13 | - And more...
14 |
15 | - 🗂️ Modular architecture:
16 | - Presentation Layer (`capaPresentacion`)
17 | - Data Layer (`capaData`)
18 | - Business Logic Layer (`capaLogica`)
19 |
20 | ---
21 |
22 | ## 📦 Requirements
23 |
24 | Before you begin, make sure you have the following installed:
25 |
26 | - **JDK 8 or higher**
27 | - **IDE**: NetBeans, Eclipse, IntelliJ IDEA, or any Java IDE
28 | - **SQL Server** (or compatible DBMS)
29 | - JDBC Driver for SQL Server ([Download latest .jar](https://learn.microsoft.com/en-us/sql/connect/jdbc/release-notes-for-the-jdbc-driver?view=sql-server-ver15))
30 | - **jCalendar Library** – [Get it here](https://toedter.com/jcalendar)
31 |
32 | ---
33 |
34 | ## 📁 Project Structure
35 |
36 | The project follows a layered architecture:
37 |
38 | - `capaPresentacion`: Contains GUI classes and forms.
39 | - `capaData`: Manages data models and database connections.
40 | - `capaLogica`: Implements business logic and rules.
41 |
42 | Main components include:
43 | - `FrmLogin`: Authentication screen for system access.
44 | - `FrmMenu`: Main dashboard to navigate between modules.
45 |
46 | ---
47 |
48 | ## 💾 Database Setup
49 |
50 | > ⚠️ **Important!**
51 | Inside the `DB` folder, you will find **two `.txt` files**:
52 | - One file contains the **SQL statements to create tables**.
53 | - The other file contains the **stored procedures** required by the system.
54 |
55 | Make sure to run both scripts in your **SQL Server** to set up the necessary database structure and logic before running the application.
56 |
57 | ---
58 |
59 | ## 🚀 How to Run the Project
60 |
61 | ### Step 1: Clone the Repository
62 |
63 | ```bash
64 | git clone https://github.com/MiguelAntonioRS/Gestion-Proyect-of-Buys-and-Sales.git
65 |
66 | cd Gestion-Proyect-of-Buys-and-Sales
67 | ```
68 |
69 | ### Step 2: Setup Database
70 |
71 | Follow the instructions above to execute the SQL scripts found in the DB folder.
72 |
73 | ### Step 3: Configure JDBC Connection
74 |
75 | Add the SQL Server JDBC driver (.jar) to your project's build path.
76 |
77 | ### Step 4: Compile and Run
78 |
79 | Navigate to the presentation layer and compile the login class:
80 | ```bash
81 | cd src/com/presentation
82 | javac FrmLogIn.java
83 | java FrmLogIn
84 | javac FrmLogIn
85 | ```
86 |
87 | © 2024 Miguel Antonio Rojas Sucarino
88 |
--------------------------------------------------------------------------------
/src/com/capaData/MBuys.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | import java.sql.Date;
4 |
5 | /**
6 | *
7 | * @author Miguel Antonio
8 | */
9 | public class MBuys {
10 |
11 | private int idBuys;
12 | private Date date;
13 | private String hour;
14 | private String documentNumber;
15 | private String documentType;
16 | private double igv;
17 | private double subTotal;
18 | private double total;
19 | private String status;
20 | private int idUser;
21 | private String idSupplier;
22 |
23 | public MBuys() {
24 | }
25 |
26 | public MBuys(int idBuys, Date date, String hour, String documentNumber, String documentType, double igv, double subTotal, double total, String status, int idUser, String idSupplier) {
27 | this.idBuys = idBuys;
28 | this.date = date;
29 | this.hour = hour;
30 | this.documentNumber = documentNumber;
31 | this.documentType = documentType;
32 | this.igv = igv;
33 | this.subTotal = subTotal;
34 | this.total = total;
35 | this.status = status;
36 | this.idUser = idUser;
37 | this.idSupplier = idSupplier;
38 | }
39 |
40 | public int getIdBuys() {
41 | return idBuys;
42 | }
43 |
44 | public void setIdBuys(int idBuys) {
45 | this.idBuys = idBuys;
46 | }
47 |
48 | public Date getDate() {
49 | return date;
50 | }
51 |
52 | public void setDate(Date date) {
53 | this.date = date;
54 | }
55 |
56 | public String getHour() {
57 | return hour;
58 | }
59 |
60 | public void setHour(String hour) {
61 | this.hour = hour;
62 | }
63 |
64 | public String getDocumentNumber() {
65 | return documentNumber;
66 | }
67 |
68 | public void setDocumentNumber(String documentNumber) {
69 | this.documentNumber = documentNumber;
70 | }
71 |
72 | public String getDocumentType() {
73 | return documentType;
74 | }
75 |
76 | public void setDocumentType(String documentType) {
77 | this.documentType = documentType;
78 | }
79 |
80 | public double getIgv() {
81 | return igv;
82 | }
83 |
84 | public void setIgv(double igv) {
85 | this.igv = igv;
86 | }
87 |
88 | public double getSubTotal() {
89 | return subTotal;
90 | }
91 |
92 | public void setSubTotal(double subTotal) {
93 | this.subTotal = subTotal;
94 | }
95 |
96 | public double getTotal() {
97 | return total;
98 | }
99 |
100 | public void setTotal(double total) {
101 | this.total = total;
102 | }
103 |
104 | public String getStatus() {
105 | return status;
106 | }
107 |
108 | public void setStatus(String status) {
109 | this.status = status;
110 | }
111 |
112 | public int getIdUser() {
113 | return idUser;
114 | }
115 |
116 | public void setIdUser(int idUser) {
117 | this.idUser = idUser;
118 | }
119 |
120 | public String getIdSupplier() {
121 | return idSupplier;
122 | }
123 |
124 | public void setIdSupplier(String idSupplier) {
125 | this.idSupplier = idSupplier;
126 | }
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/src/com/capaData/MSale.java:
--------------------------------------------------------------------------------
1 | package com.capaData;
2 |
3 | import java.sql.Date;
4 | /**
5 | *
6 | * @author Miguel Antonio
7 | */
8 | public class MSale {
9 |
10 | private int idSale;
11 | private Date date;
12 | private String hour;
13 | private String serie;
14 | private String documentNumber;
15 | private String documentType;
16 | private double subtotal;
17 | private double igv;
18 | private double total;
19 | private String status;
20 | private int idUser;
21 | private String idClient;
22 |
23 | public MSale() {
24 | }
25 |
26 | public MSale(int idSale, Date date, String hour, String serie, String documentNumber, String documentType, double subtotal, double igv, double total, String status, int idUser, String idClient) {
27 | this.idSale = idSale;
28 | this.date = date;
29 | this.hour = hour;
30 | this.serie = serie;
31 | this.documentNumber = documentNumber;
32 | this.documentType = documentType;
33 | this.subtotal = subtotal;
34 | this.igv = igv;
35 | this.total = total;
36 | this.status = status;
37 | this.idUser = idUser;
38 | this.idClient = idClient;
39 | }
40 |
41 | public int getIdSale() {
42 | return idSale;
43 | }
44 |
45 | public void setIdSale(int idSale) {
46 | this.idSale = idSale;
47 | }
48 |
49 | public Date getDate() {
50 | return date;
51 | }
52 |
53 | public void setDate(Date date) {
54 | this.date = date;
55 | }
56 |
57 | public String getHour() {
58 | return hour;
59 | }
60 |
61 | public void setHour(String hour) {
62 | this.hour = hour;
63 | }
64 |
65 | public String getSerie() {
66 | return serie;
67 | }
68 |
69 | public void setSerie(String serie) {
70 | this.serie = serie;
71 | }
72 |
73 | public String getDocumentNumber() {
74 | return documentNumber;
75 | }
76 |
77 | public void setDocumentNumber(String documentNumber) {
78 | this.documentNumber = documentNumber;
79 | }
80 |
81 | public String getDocumentType() {
82 | return documentType;
83 | }
84 |
85 | public void setDocumentType(String documentType) {
86 | this.documentType = documentType;
87 | }
88 |
89 | public double getSubtotal() {
90 | return subtotal;
91 | }
92 |
93 | public void setSubtotal(double subtotal) {
94 | this.subtotal = subtotal;
95 | }
96 |
97 | public double getIgv() {
98 | return igv;
99 | }
100 |
101 | public void setIgv(double igv) {
102 | this.igv = igv;
103 | }
104 |
105 | public double getTotal() {
106 | return total;
107 | }
108 |
109 | public void setTotal(double total) {
110 | this.total = total;
111 | }
112 |
113 | public String getStatus() {
114 | return status;
115 | }
116 |
117 | public void setStatus(String status) {
118 | this.status = status;
119 | }
120 |
121 | public int getIdUser() {
122 | return idUser;
123 | }
124 |
125 | public void setIdUser(int idUser) {
126 | this.idUser = idUser;
127 | }
128 |
129 | public String getIdClient() {
130 | return idClient;
131 | }
132 |
133 | public void setIdClient(String idClient) {
134 | this.idClient = idClient;
135 | }
136 |
137 |
138 | }
139 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSale.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3 | * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
4 | */
5 | package com.capaPresentacion;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class FrmSale extends javax.swing.JFrame {
12 |
13 | /**
14 | * Creates new form FrmSale
15 | */
16 | public FrmSale() {
17 | initComponents();
18 | }
19 |
20 | /**
21 | * This method is called from within the constructor to initialize the form.
22 | * WARNING: Do NOT modify this code. The content of this method is always
23 | * regenerated by the Form Editor.
24 | */
25 | @SuppressWarnings("unchecked")
26 | // //GEN-BEGIN:initComponents
27 | private void initComponents() {
28 |
29 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
30 |
31 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
32 | getContentPane().setLayout(layout);
33 | layout.setHorizontalGroup(
34 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
35 | .addGap(0, 400, Short.MAX_VALUE)
36 | );
37 | layout.setVerticalGroup(
38 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
39 | .addGap(0, 300, Short.MAX_VALUE)
40 | );
41 |
42 | pack();
43 | }// //GEN-END:initComponents
44 |
45 | /**
46 | * @param args the command line arguments
47 | */
48 | public static void main(String args[]) {
49 | /* Set the Nimbus look and feel */
50 | //
51 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
52 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
53 | */
54 | try {
55 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
56 | if ("Nimbus".equals(info.getName())) {
57 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
58 | break;
59 | }
60 | }
61 | } catch (ClassNotFoundException ex) {
62 | java.util.logging.Logger.getLogger(FrmSale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
63 | } catch (InstantiationException ex) {
64 | java.util.logging.Logger.getLogger(FrmSale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
65 | } catch (IllegalAccessException ex) {
66 | java.util.logging.Logger.getLogger(FrmSale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
67 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
68 | java.util.logging.Logger.getLogger(FrmSale.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
69 | }
70 | //
71 |
72 | /* Create and display the form */
73 | java.awt.EventQueue.invokeLater(new Runnable() {
74 | public void run() {
75 | new FrmSale().setVisible(true);
76 | }
77 | });
78 | }
79 |
80 | // Variables declaration - do not modify//GEN-BEGIN:variables
81 | // End of variables declaration//GEN-END:variables
82 | }
83 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false
4 | annotation.processing.processors.list=
5 | annotation.processing.run.all.processors=true
6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
7 | application.title=System
8 | application.vendor=Miguel Antonio
9 | build.classes.dir=${build.dir}/classes
10 | build.classes.excludes=**/*.java,**/*.form
11 | # This directory is removed when the project is cleaned:
12 | build.dir=build
13 | build.generated.dir=${build.dir}/generated
14 | build.generated.sources.dir=${build.dir}/generated-sources
15 | # Only compile against the classpath explicitly listed here:
16 | build.sysclasspath=ignore
17 | build.test.classes.dir=${build.dir}/test/classes
18 | build.test.results.dir=${build.dir}/test/results
19 | # Uncomment to specify the preferred debugger connection transport:
20 | #debug.transport=dt_socket
21 | debug.classpath=\
22 | ${run.classpath}
23 | debug.modulepath=\
24 | ${run.modulepath}
25 | debug.test.classpath=\
26 | ${run.test.classpath}
27 | debug.test.modulepath=\
28 | ${run.test.modulepath}
29 | # Files in build.classes.dir which should be excluded from distribution jar
30 | dist.archive.excludes=
31 | # This directory is removed when the project is cleaned:
32 | dist.dir=dist
33 | dist.jar=${dist.dir}/System.jar
34 | dist.javadoc.dir=${dist.dir}/javadoc
35 | dist.jlink.dir=${dist.dir}/jlink
36 | dist.jlink.output=${dist.jlink.dir}/System
37 | endorsed.classpath=
38 | excludes=
39 | file.reference.jcalendar-1.4.jar=D:\\_Programacion\\Instalation\\jcalendar-1.4.jar
40 | file.reference.mssql-jdbc-12.2.0.jre8.jar=D:\\_Programacion\\SQL JDBC\\mssql-jdbc-12.2.0.jre8.jar
41 | includes=**
42 | jar.compress=true
43 | javac.classpath=\
44 | ${file.reference.jcalendar-1.4.jar}:\
45 | ${file.reference.mssql-jdbc-12.2.0.jre8.jar}:\
46 | ${libs.JavaFX21.classpath}:\
47 | ${libs.eclipselink.classpath}
48 | # Space-separated list of extra javac options
49 | javac.compilerargs=
50 | javac.deprecation=false
51 | javac.external.vm=true
52 | javac.modulepath=
53 | javac.processormodulepath=
54 | javac.processorpath=\
55 | ${javac.classpath}:\
56 | ${libs.eclipselinkmodelgen.classpath}
57 | javac.source=17
58 | javac.target=17
59 | javac.test.classpath=\
60 | ${javac.classpath}:\
61 | ${build.classes.dir}
62 | javac.test.modulepath=\
63 | ${javac.modulepath}
64 | javac.test.processorpath=\
65 | ${javac.test.classpath}
66 | javadoc.additionalparam=
67 | javadoc.author=false
68 | javadoc.encoding=${source.encoding}
69 | javadoc.html5=false
70 | javadoc.noindex=false
71 | javadoc.nonavbar=false
72 | javadoc.notree=false
73 | javadoc.private=false
74 | javadoc.splitindex=true
75 | javadoc.use=true
76 | javadoc.version=false
77 | javadoc.windowtitle=
78 | # The jlink additional root modules to resolve
79 | jlink.additionalmodules=
80 | # The jlink additional command line parameters
81 | jlink.additionalparam=
82 | jlink.launcher=true
83 | jlink.launcher.name=System
84 | main.class=com.capaPresentacion.FrmLogIn
85 | manifest.file=manifest.mf
86 | meta.inf.dir=${src.dir}/META-INF
87 | mkdist.disabled=false
88 | platform.active=default_platform
89 | run.classpath=\
90 | ${javac.classpath}:\
91 | ${build.classes.dir}
92 | # Space-separated list of JVM arguments used when running the project.
93 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
94 | # To set system properties for unit tests define test-sys-prop.name=value:
95 | run.jvmargs=
96 | run.modulepath=\
97 | ${javac.modulepath}
98 | run.test.classpath=\
99 | ${javac.test.classpath}:\
100 | ${build.test.classes.dir}
101 | run.test.modulepath=\
102 | ${javac.test.modulepath}
103 | source.encoding=UTF-8
104 | src.dir=src
105 | test.src.dir=test
106 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NSupplier.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MSupplier;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 |
12 | /**
13 | *
14 | * @author Miguel Antonio
15 | */
16 | public class NSupplier {
17 |
18 | private CConnetion SQL = new CConnetion();
19 | private Connection cn = SQL.getconec();
20 | String sql = "";
21 |
22 | public DefaultTableModel showA(String search) {
23 | DefaultTableModel model;
24 |
25 | String[] tittles = {"ID", "Razon Social", "RUC", "Telefono", "Direccion"};
26 | model = new DefaultTableModel(null, tittles);
27 | String[] register = new String[5];
28 |
29 | sql = ("sp_buscar_proveedor'" + search + "'");
30 |
31 | try {
32 | Statement st = cn.createStatement();
33 | ResultSet rs = st.executeQuery(sql);
34 |
35 | while (rs.next()) {
36 | register[0] = rs.getString(1);
37 | register[1] = rs.getString(2);
38 | register[2] = rs.getString(3);
39 | register[3] = rs.getString(4);
40 | register[4] = rs.getString(5);
41 | model.addRow(register);
42 |
43 | }
44 | return model;
45 |
46 | } catch (Exception e) {
47 | JOptionPane.showMessageDialog(null, "Error");
48 | return null;
49 | }
50 | }
51 |
52 | public boolean insert(MSupplier dts) {
53 |
54 | sql = ("{call sp_guardar_proveedor (?,?,?,?,?)}");
55 |
56 | try {
57 | PreparedStatement pst = cn.prepareStatement(sql);
58 | pst.setString(1, dts.getIdSupplier());
59 | pst.setString(2, dts.getSocialRazon());
60 | pst.setString(3, dts.getRuc());
61 | pst.setString(4, dts.getPhone());
62 | pst.setString(5, dts.getAddress());
63 |
64 | int n = pst.executeUpdate();
65 |
66 | if (n != 0) {
67 | return true;
68 | } else {
69 | return false;
70 | }
71 |
72 | } catch (Exception e) {
73 | JOptionPane.showMessageDialog(null, e.toString());
74 | return false;
75 | }
76 | }
77 |
78 | public boolean edit(MSupplier dts) {
79 |
80 | sql = ("{call sp_editar_proveedor (?,?,?,?,?)}");
81 |
82 | try {
83 | PreparedStatement pst = cn.prepareStatement(sql);
84 | pst.setString(1, dts.getIdSupplier());
85 | pst.setString(2, dts.getSocialRazon());
86 | pst.setString(3, dts.getRuc());
87 | pst.setString(4, dts.getPhone());
88 | pst.setString(5, dts.getAddress());
89 |
90 | int n = pst.executeUpdate();
91 |
92 | if (n != 0) {
93 | return true;
94 | } else {
95 | return false;
96 | }
97 |
98 | } catch (Exception e) {
99 | JOptionPane.showMessageDialog(null, e.toString());
100 | return false;
101 | }
102 | }
103 |
104 | public boolean delete(MSupplier dts) {
105 |
106 | sql = ("{call sp_eliminar_proveedor (?)}");
107 | try {
108 | PreparedStatement pst = cn.prepareStatement(sql);
109 | pst.setString(1, dts.getIdSupplier());
110 |
111 | int n = pst.executeUpdate();
112 | if (n != 0) {
113 | return true;
114 |
115 | } else {
116 |
117 | return false;
118 | }
119 | } catch (Exception e) {
120 | JOptionPane.showMessageDialog(null, e.toString());
121 | return false;
122 | }
123 | }
124 |
125 | public int generateIDSupplier(){
126 | String sql = ("SELECT MAX(idProveedor) AS id FROM proveedor");
127 | int cod = 0;
128 |
129 |
130 | try {
131 | Statement st = cn.createStatement();
132 | ResultSet rs = st.executeQuery(sql);
133 |
134 | if(rs.next()){
135 | cod = rs.getInt("id")+1;
136 | }
137 | } catch (SQLException e) {
138 | JOptionPane.showMessageDialog(null, "Error"+e.toString());
139 |
140 | }
141 | return cod;
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NEmployee.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MEmployee;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 |
12 | /**
13 | *
14 | * @author Miguel Antonio
15 | */
16 | public class NEmployee {
17 |
18 | private CConnetion SQL = new CConnetion();
19 | private Connection cn = SQL.getconec();
20 | String sql = "";
21 |
22 | public DefaultTableModel showA(String search) {
23 | DefaultTableModel model;
24 |
25 | String[] tittles = {"Codigo", "Nombre", "Apellidos", "DNI", "Telefono", "Direccion"};
26 | model = new DefaultTableModel(null, tittles);
27 | String[] register = new String[8];
28 | sql = ("sp_buscar_empleados'" + search + "'");
29 | try {
30 | Statement st = cn.createStatement();
31 | ResultSet rs = st.executeQuery(sql);
32 |
33 | while (rs.next()) {
34 | register[0] = rs.getString(1);
35 | register[1] = rs.getString(2);
36 | register[2] = rs.getString(3);
37 | register[3] = rs.getString(4);
38 | register[4] = rs.getString(5);
39 | register[5] = rs.getString(6);
40 | model.addRow(register);
41 | }
42 | return model;
43 |
44 | } catch (Exception ex) {
45 | JOptionPane.showMessageDialog(null, "Error");
46 | return null;
47 | }
48 | }
49 |
50 | public boolean insert(MEmployee dts) {
51 |
52 | sql = ("{call sp_guardar_empleados (?,?,?,?,?,?)}");
53 |
54 | try {
55 | PreparedStatement pst = cn.prepareStatement(sql);
56 | pst.setString(1, dts.getIdEmployee());
57 | pst.setString(2, dts.getFirstName());
58 | pst.setString(3, dts.getLastName());
59 | pst.setString(4, dts.getDni());
60 | pst.setString(5, dts.getPhone());
61 | pst.setString(6, dts.getDirection());
62 |
63 | int n = pst.executeUpdate();
64 |
65 | if (n != 0) {
66 | return true;
67 | } else {
68 | return false;
69 | }
70 |
71 | } catch (Exception e) {
72 | JOptionPane.showMessageDialog(null, e.toString());
73 | return false;
74 | }
75 | }
76 |
77 | public boolean edit(MEmployee dts) {
78 |
79 | sql = ("{call sp_editar_empleados (?,?,?,?,?,?)}");
80 |
81 | try {
82 | PreparedStatement pst = cn.prepareStatement(sql);
83 | pst.setString(1, dts.getIdEmployee());
84 | pst.setString(2, dts.getFirstName());
85 | pst.setString(3, dts.getLastName());
86 | pst.setString(4, dts.getDni());
87 | pst.setString(5, dts.getPhone());
88 | pst.setString(6, dts.getDirection());
89 |
90 | int n = pst.executeUpdate();
91 |
92 | if (n != 0) {
93 | return true;
94 | } else {
95 | return false;
96 | }
97 |
98 | } catch (Exception e) {
99 | JOptionPane.showMessageDialog(null, e.toString());
100 | return false;
101 | }
102 | }
103 |
104 | public boolean delete(MEmployee dts) {
105 |
106 | sql = ("{call sp_eliminar_empleados (?)}");
107 |
108 | try {
109 | PreparedStatement pst = cn.prepareStatement(sql);
110 | pst.setString(1, dts.getIdEmployee());
111 |
112 | int n = pst.executeUpdate();
113 |
114 | if (n != 0) {
115 | return true;
116 | } else {
117 | return false;
118 | }
119 |
120 | } catch (Exception e) {
121 | JOptionPane.showMessageDialog(null, e.toString());
122 | return false;
123 | }
124 | }
125 |
126 | public int generateIDEmployee(){
127 | String sql = ("SELECT MAX(idEmpleados) AS id FROM empleados");
128 | int cod = 0;
129 |
130 |
131 | try {
132 | Statement st = cn.createStatement();
133 | ResultSet rs = st.executeQuery(sql);
134 |
135 | if(rs.next()){
136 | cod = rs.getInt("id")+1;
137 | }
138 | } catch (SQLException e) {
139 | JOptionPane.showMessageDialog(null, "Error"+e.toString());
140 |
141 | }
142 | return cod;
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NClients.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MClients;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 |
12 | /**
13 | *
14 | * @author Miguel Antonio
15 | */
16 | public class NClients {
17 |
18 | private CConnetion SQL = new CConnetion();
19 | private Connection cn = SQL.getconec();
20 | String sql = "";
21 |
22 | public DefaultTableModel showA(String search) {
23 | DefaultTableModel model;
24 |
25 | String[] titles = {"ID", "Nombre", "Apellidos", "DNI", "Edad", "RUC", "Sexo", "Telefono", "Direccion"};
26 | model = new DefaultTableModel(null, titles);
27 | String[] register = new String[9];
28 | sql = ("sp_buscar_clientes'" + search + "'");
29 | try {
30 | Statement st = cn.createStatement();
31 | ResultSet rs = st.executeQuery(sql);
32 |
33 | while (rs.next()) {
34 | register[0] = rs.getString(1);
35 | register[1] = rs.getString(2);
36 | register[2] = rs.getString(3);
37 | register[3] = rs.getString(4);
38 | register[4] = rs.getString(5);
39 | register[5] = rs.getString(6);
40 | register[6] = rs.getString(7);
41 | register[7] = rs.getString(8);
42 | register[8] = rs.getString(9);
43 | model.addRow(register);
44 | }
45 | return model;
46 |
47 | } catch (Exception ex) {
48 | JOptionPane.showMessageDialog(null, "Error");
49 | return null;
50 | }
51 | }
52 |
53 | public boolean insert(MClients dts) {
54 | sql = ("{call sp_guardar_clientes (?,?,?,?,?,?,?,?,?)}");
55 |
56 | try {
57 |
58 | PreparedStatement pst = cn.prepareStatement(sql);
59 | pst.setString(1, dts.getCodigo());
60 | pst.setString(2, dts.getNombres());
61 | pst.setString(3, dts.getApellidos());
62 | pst.setString(4, dts.getDni());
63 | pst.setInt(5, dts.getEdad());
64 | pst.setString(6, dts.getRuc());
65 | pst.setString(7, dts.getSexo());
66 | pst.setString(8, dts.getTelefono());
67 | pst.setString(9, dts.getDireccion());
68 |
69 | int n = pst.executeUpdate();
70 |
71 | if (n != 0) {
72 | return true;
73 | } else {
74 | return false;
75 | }
76 |
77 | } catch (Exception e) {
78 | JOptionPane.showMessageDialog(null, "Error");
79 | return false;
80 | }
81 | }
82 |
83 | public boolean edit(MClients dts) {
84 | sql = ("{call sp_editar_clientes (?,?,?,?,?,?,?,?,?)}");
85 |
86 | try {
87 | PreparedStatement pst = cn.prepareStatement(sql);
88 | pst.setString(1, dts.getCodigo());
89 | pst.setString(2, dts.getNombres());
90 | pst.setString(3, dts.getApellidos());
91 | pst.setString(4, dts.getDni());
92 | pst.setInt(5, dts.getEdad());
93 | pst.setString(6, dts.getRuc());
94 | pst.setString(7, dts.getSexo());
95 | pst.setString(8, dts.getTelefono());
96 | pst.setString(9, dts.getDireccion());
97 |
98 | int n = pst.executeUpdate();
99 |
100 | if (n != 0) {
101 | return true;
102 | } else {
103 | return false;
104 | }
105 |
106 | } catch (Exception e) {
107 | JOptionPane.showMessageDialog(null, "Error");
108 | return false;
109 | }
110 | }
111 |
112 | public boolean delete(MClients dts) {
113 | sql = ("{call sp_eliminar_clientes (?)}");
114 |
115 | try {
116 | PreparedStatement pst = cn.prepareStatement(sql);
117 | pst.setString(1, dts.getCodigo());
118 |
119 | int n = pst.executeUpdate();
120 |
121 | if (n != 0) {
122 | return true;
123 | } else {
124 | return false;
125 | }
126 |
127 | } catch (Exception e) {
128 | JOptionPane.showMessageDialog(null, "Error");
129 | return false;
130 | }
131 | }
132 |
133 | public int generateIDClient(){
134 | String sql = ("SELECT MAX(idClientes) AS id FROM clientes");
135 | int cod = 0;
136 |
137 |
138 | try {
139 | Statement st = cn.createStatement();
140 | ResultSet rs = st.executeQuery(sql);
141 |
142 | if(rs.next()){
143 | cod = rs.getInt("id")+1;
144 | }
145 | } catch (SQLException e) {
146 | JOptionPane.showMessageDialog(null, "Error"+e.toString());
147 |
148 | }
149 | return cod;
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NBuys.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MBuys;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 |
12 | /**
13 | *
14 | * @author Miguel Antonio
15 | */
16 | public class NBuys {
17 |
18 | private CConnetion SQL = new CConnetion();
19 | private Connection cn = SQL.getconec();
20 | String sql = "";
21 | ResultSet rs;
22 |
23 | public DefaultTableModel showA() {
24 | DefaultTableModel modelo;
25 |
26 | String[] titulos = {"ID Producto", "Descripcion", "Cantidad", "Precio", "IGV", "Total"};
27 | modelo = new DefaultTableModel(null, titulos);
28 | String[] registro = new String[6];
29 | return modelo;
30 | }
31 |
32 | public DefaultTableModel showBuy(String search) {
33 | DefaultTableModel model;
34 |
35 | String[] tittles = {"ID Venta", "Cliente", "Fecha", "Empleado", "Comprobante", "Numero", "Estado", "Sub Total", "Impuesto", "Total"};
36 | model = new DefaultTableModel(null, tittles);
37 | String[] register = new String[10];
38 | sql = ("sp_listar_compras'" + search + "'");
39 | try {
40 | Statement st = cn.createStatement();
41 | ResultSet rs = st.executeQuery(sql);
42 |
43 | while (rs.next()) {
44 | register[0] = rs.getString(1);
45 | register[1] = rs.getString(2);
46 | register[2] = rs.getString(3);
47 | register[3] = rs.getString(4);
48 | register[4] = rs.getString(5);
49 | register[5] = rs.getString(6);
50 | register[6] = rs.getString(7);
51 | register[7] = rs.getString(8);
52 | register[8] = rs.getString(9);
53 | register[9] = rs.getString(10);
54 | model.addRow(register);
55 | }
56 | return model;
57 |
58 | } catch (SQLException ex) {
59 | JOptionPane.showMessageDialog(null, "Error");
60 | return null;
61 | }
62 | }
63 |
64 | public boolean insert(MBuys dts) {
65 | String date;
66 | String hour;
67 | date = Functions.getDateActual();
68 | hour = Functions.getHourActual();
69 |
70 | sql = ("{call sp_guardar_compra (?,?,?,?,?,?,?,?,?,?)}");
71 |
72 | try {
73 |
74 | PreparedStatement pst = cn.prepareStatement(sql);
75 | pst.setString(1, date);
76 | pst.setString(2, hour);
77 | pst.setString(3, dts.getDocumentNumber());
78 | pst.setString(4, dts.getDocumentType());
79 | pst.setDouble(5, dts.getSubTotal());
80 | pst.setDouble(6, dts.getIgv());
81 | pst.setDouble(7, dts.getTotal());
82 | pst.setString(8, dts.getStatus());
83 | pst.setInt(9, dts.getIdUser());
84 | pst.setString(10, dts.getIdSupplier());
85 |
86 | int n = pst.executeUpdate();
87 |
88 | if (n != 0) {
89 | return true;
90 | } else {
91 | return false;
92 | }
93 |
94 | } catch (Exception e) {
95 | JOptionPane.showMessageDialog(null, "Error");
96 | return false;
97 | }
98 | }
99 |
100 | public String IDBuy() {
101 | String idv = "";
102 | sql = ("SELECT MAX(idCompra) FROM compra");
103 |
104 | try {
105 | PreparedStatement pst = cn.prepareStatement(idv);
106 | rs = pst.executeQuery();
107 |
108 | while (rs.next()) {
109 | rs.getString(1);
110 |
111 | }
112 | } catch (SQLException e) {
113 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
114 |
115 | }
116 | return idv;
117 | }
118 |
119 | public int generateComprobantFacture() {
120 | String sql = ("SELECT MAX(numDocumento) AS id FROM compras where tipoDocumento = 'Factura'");
121 | int cod = 0;
122 |
123 | try {
124 | Statement st = cn.createStatement();
125 | ResultSet rs = st.executeQuery(sql);
126 |
127 | if (rs.next()) {
128 | cod = rs.getInt("id") + 1;
129 | }
130 | } catch (SQLException e) {
131 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
132 |
133 | }
134 | return cod;
135 | }
136 |
137 | public int generateComprobantBolet() {
138 | String sql = ("SELECT MAX(numDocumento) AS id FROM compras where tipoDocumento = 'Boleta'");
139 | int cod = 0;
140 |
141 | try {
142 | Statement st = cn.createStatement();
143 | ResultSet rs = st.executeQuery(sql);
144 |
145 | if (rs.next()) {
146 | cod = rs.getInt("id") + 1;
147 | }
148 | } catch (SQLException e) {
149 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
150 |
151 | }
152 | return cod;
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NSale.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MSale;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 | /**
12 | *
13 | * @author Miguel Antonio
14 | */
15 | public class NSale {
16 |
17 | private CConnetion SQL = new CConnetion();
18 | private Connection cn = SQL.getconec();
19 | String sql = "";
20 | ResultSet rs;
21 |
22 | public DefaultTableModel see() {
23 | DefaultTableModel modelo;
24 |
25 | String[] tittles = {"ID Producto", "Descripcion", "Cantidad", "Precio", "IGV", "Total"};
26 | modelo = new DefaultTableModel(null, tittles);
27 | String[] registro = new String[6];
28 | return modelo;
29 | }
30 |
31 | public DefaultTableModel showSale(String search) {
32 | DefaultTableModel model;
33 |
34 | String[] tittles = {"ID Venta", "Cliente", "Fecha", "Empleado", "Comprobante", "Numero", "Estado", "Sub Total", "Impuesto", "Total"};
35 | model = new DefaultTableModel(null, tittles);
36 | String[] register = new String[10];
37 | sql = ("sp_listar_ventas'" + search + "'");
38 | try {
39 | Statement st = cn.createStatement();
40 | ResultSet rs = st.executeQuery(sql);
41 |
42 | while (rs.next()) {
43 | register[0] = rs.getString(1);
44 | register[1] = rs.getString(2);
45 | register[2] = rs.getString(3);
46 | register[3] = rs.getString(4);
47 | register[4] = rs.getString(5);
48 | register[5] = rs.getString(6);
49 | register[6] = rs.getString(7);
50 | register[7] = rs.getString(8);
51 | register[8] = rs.getString(9);
52 | register[9] = rs.getString(10);
53 | model.addRow(register);
54 | }
55 | return model;
56 |
57 | } catch (SQLException ex) {
58 | JOptionPane.showMessageDialog(null, "Error");
59 | return null;
60 | }
61 | }
62 |
63 | public boolean insert(MSale dts) {
64 | String date;
65 | String hour;
66 | date = Functions.getDateActual();
67 | hour = Functions.getHourActual();
68 |
69 | sql = ("{call sp_guardar_venta (?,?,?,?,?,?,?,?,?,?,?)}");
70 |
71 | try {
72 |
73 | PreparedStatement pst = cn.prepareStatement(sql);
74 | pst.setString(1, date);
75 | pst.setString(2, hour);
76 | pst.setString(3, dts.getSerie());
77 | pst.setString(4, dts.getDocumentNumber());
78 | pst.setString(5, dts.getDocumentType());
79 | pst.setDouble(6, dts.getSubtotal());
80 | pst.setDouble(7, dts.getIgv());
81 | pst.setDouble(8, dts.getTotal());
82 | pst.setString(9, dts.getStatus());
83 | pst.setInt(10, dts.getIdUser());
84 | pst.setString(11, dts.getIdClient());
85 |
86 | int n = pst.executeUpdate();
87 |
88 | if (n != 0) {
89 | return true;
90 | } else {
91 | return false;
92 | }
93 |
94 | } catch (Exception e) {
95 | JOptionPane.showMessageDialog(null, "Error");
96 | return false;
97 | }
98 | }
99 |
100 | public String IDSale() {
101 | String idv = "";
102 | sql = ("SELECT MAX(idVentas) FROM ventas");
103 |
104 | try {
105 | PreparedStatement pst = cn.prepareStatement(idv);
106 | rs = pst.executeQuery();
107 |
108 | while (rs.next()) {
109 | rs.getString(1);
110 |
111 | }
112 | } catch (SQLException e) {
113 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
114 |
115 | }
116 | return idv;
117 | }
118 |
119 | public int generateComprobantFacture() {
120 | String sql = ("SELECT MAX(numDocumento) AS id FROM ventas where tipoDocumento = 'Factura'");
121 | int cod = 0;
122 |
123 | try {
124 | Statement st = cn.createStatement();
125 | ResultSet rs = st.executeQuery(sql);
126 |
127 | if (rs.next()) {
128 | cod = rs.getInt("id") + 1;
129 | }
130 | } catch (SQLException e) {
131 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
132 |
133 | }
134 | return cod;
135 | }
136 |
137 | public int generateComprobantBolet() {
138 | String sql = ("SELECT MAX(numDocumento) AS id FROM ventas where tipoDocumento = 'Boleta'");
139 | int cod = 0;
140 |
141 | try {
142 | Statement st = cn.createStatement();
143 | ResultSet rs = st.executeQuery(sql);
144 |
145 | if (rs.next()) {
146 | cod = rs.getInt("id") + 1;
147 | }
148 | } catch (SQLException e) {
149 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
150 |
151 | }
152 | return cod;
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSaleDetails.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
103 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmBuysDetails.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
103 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NUser.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MUser;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import javax.swing.JOptionPane;
9 | import javax.swing.table.DefaultTableModel;
10 | /**
11 | *
12 | * @author Miguel Antonio
13 | */
14 | public class NUser {
15 |
16 | private CConnetion SQL = new CConnetion();
17 | private Connection cn = SQL.getconec();
18 | String sql = "";
19 | public int registerTotal;
20 |
21 | public DefaultTableModel showA(String search) {
22 | DefaultTableModel model;
23 |
24 | String[] tittles = {"ID Usuario", "ID Empleado", "Nombre", "Apellidos", "Usuario", "Acceso", "Contraseña", "Estado"};
25 | model = new DefaultTableModel(null, tittles);
26 | String[] register = new String[8];
27 | sql = ("sp_listar_usuario'" + search + "'");
28 | try {
29 | Statement st = cn.createStatement();
30 | ResultSet rs = st.executeQuery(sql);
31 |
32 | while (rs.next()) {
33 | register[0] = rs.getString(1);
34 | register[1] = rs.getString(2);
35 | register[2] = rs.getString(3);
36 | register[3] = rs.getString(4);
37 | register[4] = rs.getString(5);
38 | register[5] = rs.getString(6);
39 | register[6] = rs.getString(7);
40 | register[7] = rs.getString(8);
41 | model.addRow(register);
42 | }
43 | return model;
44 |
45 | } catch (Exception ex) {
46 | JOptionPane.showMessageDialog(null, ex.toString());
47 | return null;
48 | }
49 | }
50 |
51 | public boolean insert(MUser dts) {
52 |
53 | sql = ("{call sp_guardar_usuarios (?,?,?,?,?)}");
54 |
55 | try {
56 | PreparedStatement pst = cn.prepareStatement(sql);
57 | pst.setString(1, dts.getIdEmployee());
58 | pst.setString(2, dts.getUser());
59 | pst.setString(3, dts.getPassword());
60 | pst.setString(4, dts.getAccess());
61 | pst.setString(5, dts.getStatus());
62 |
63 | int n = pst.executeUpdate();
64 |
65 | if (n != 0) {
66 | return true;
67 | } else {
68 | return false;
69 | }
70 |
71 | } catch (Exception e) {
72 | JOptionPane.showMessageDialog(null, e.toString());
73 | return false;
74 | }
75 | }
76 |
77 | public boolean edit(MUser dts) {
78 |
79 | sql = ("{call sp_editar_usuarios (?,?,?,?,?)}");
80 |
81 | try {
82 | PreparedStatement pst = cn.prepareStatement(sql);
83 | pst.setString(1, dts.getIdEmployee());
84 | pst.setString(2, dts.getUser());
85 | pst.setString(3, dts.getPassword());
86 | pst.setString(4, dts.getAccess());
87 | pst.setString(5, dts.getStatus());
88 |
89 | int n = pst.executeUpdate();
90 |
91 | if (n != 0) {
92 | return true;
93 | } else {
94 | return false;
95 | }
96 |
97 | } catch (Exception e) {
98 | JOptionPane.showMessageDialog(null, e.toString());
99 | return false;
100 | }
101 | }
102 |
103 | public boolean delete(MUser dts) {
104 |
105 | sql = ("{call sp_eliminar_usuarios (?)}");
106 |
107 | try {
108 | PreparedStatement pst = cn.prepareStatement(sql);
109 | pst.setInt(1, dts.getIdUser());
110 |
111 | int n = pst.executeUpdate();
112 |
113 | if (n != 0) {
114 | return true;
115 | } else {
116 | return false;
117 | }
118 |
119 | } catch (Exception e) {
120 | JOptionPane.showMessageDialog(null, e.toString());
121 | return false;
122 | }
123 | }
124 |
125 | public DefaultTableModel log(String user, String password) {
126 | DefaultTableModel modelo;
127 |
128 | String[] titulos = {"ID Usuario", "ID Empleado", "Nombre", "Apellidos", "Usuario", "Contraseña", "Acceso", "Estado"};
129 | modelo = new DefaultTableModel(null, titulos);
130 | String[] registro = new String[8];
131 | sql = ("sp_sesion'" + user + "','" + password + "'");
132 | registerTotal = 0;
133 | try {
134 | Statement st = cn.createStatement();
135 | ResultSet rs = st.executeQuery(sql);
136 |
137 | while (rs.next()) {
138 | registro[0] = rs.getString(1);
139 | registro[1] = rs.getString(2);
140 | registro[2] = rs.getString(3);
141 | registro[3] = rs.getString(4);
142 | registro[4] = rs.getString(5);
143 | registro[5] = rs.getString(6);
144 | registro[6] = rs.getString(7);
145 | registro[7] = rs.getString(8);
146 | registerTotal = registerTotal+1;
147 | modelo.addRow(registro);
148 | }
149 | return modelo;
150 |
151 | } catch (Exception ex) {
152 | JOptionPane.showMessageDialog(null, "Error");
153 | return null;
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/src/com/capaLogica/NProduct.java:
--------------------------------------------------------------------------------
1 | package com.capaLogica;
2 |
3 | import com.capaData.MProduct;
4 | import java.sql.Connection;
5 | import java.sql.Statement;
6 | import java.sql.PreparedStatement;
7 | import java.sql.ResultSet;
8 | import java.sql.SQLException;
9 | import javax.swing.JOptionPane;
10 | import javax.swing.table.DefaultTableModel;
11 | /**
12 | *
13 | * @author Miguel Antonio
14 | */
15 | public class NProduct {
16 |
17 | private CConnetion SQL = new CConnetion();
18 | private Connection cn = SQL.getconec();
19 | String sql = "";
20 |
21 | public DefaultTableModel showA(String search) {
22 | DefaultTableModel model;
23 |
24 | String[] tittles = {"ID", "Serie", "Nombre", "Fecha de Ingreso", "Fecha de Vencimiento", "Precio Compra",
25 | "Precio Venta", "Cantidad", "ID Categoria", "Categoria"};
26 | model = new DefaultTableModel(null, tittles);
27 | String[] register = new String[10];
28 | sql = ("sp_listar_producto'" + search + "'");
29 | try {
30 | Statement st = cn.createStatement();
31 | ResultSet rs = st.executeQuery(sql);
32 |
33 | while (rs.next()) {
34 | register[0] = rs.getString(1);
35 | register[1] = rs.getString(2);
36 | register[2] = rs.getString(3);
37 | register[3] = rs.getString(4);
38 | register[4] = rs.getString(5);
39 | register[5] = rs.getString(6);
40 | register[6] = rs.getString(7);
41 | register[7] = rs.getString(8);
42 | register[8] = rs.getString(9);
43 | register[9] = rs.getString(10);
44 | model.addRow(register);
45 | }
46 | return model;
47 |
48 | } catch (Exception ex) {
49 | JOptionPane.showMessageDialog(null, "Error");
50 | return null;
51 | }
52 | }
53 |
54 | public boolean insert(MProduct dts) {
55 |
56 | sql = ("{call sp_guardar_producto (?,?,?,?,?,?,?,?)}");
57 |
58 | try {
59 | PreparedStatement pst = cn.prepareStatement(sql);
60 | pst.setString(1, dts.getIdProduct());
61 | pst.setString(3, dts.getName());
62 | pst.setString(2, dts.getSerie());
63 | pst.setDate(4, dts.getfIncome());
64 | pst.setDate(5, dts.getfExpiration());
65 | pst.setDouble(6, dts.getpBuys());
66 | pst.setDouble(7, dts.getpSale());
67 | pst.setInt(8, dts.getIdCategory());
68 |
69 | int n = pst.executeUpdate();
70 |
71 | if (n != 0) {
72 | return true;
73 | } else {
74 | return false;
75 | }
76 |
77 | } catch (Exception e) {
78 | JOptionPane.showMessageDialog(null, e.toString());
79 | return false;
80 | }
81 | }
82 |
83 | public boolean edit(MProduct dts) {
84 |
85 | sql = ("{call sp_editar_producto (?,?,?,?,?,?,?,?)}");
86 |
87 | try {
88 | PreparedStatement pst = cn.prepareStatement(sql);
89 | pst.setString(1, dts.getIdProduct());
90 | pst.setString(2, dts.getName());
91 | pst.setString(3, dts.getSerie());
92 | pst.setDate(4, dts.getfIncome());
93 | pst.setDate(5, dts.getfExpiration());
94 | pst.setDouble(6, dts.getpBuys());
95 | pst.setDouble(7, dts.getpSale());
96 | pst.setInt(8, dts.getIdCategory());
97 |
98 | int n = pst.executeUpdate();
99 |
100 | if (n != 0) {
101 | return true;
102 | } else {
103 | return false;
104 | }
105 |
106 | } catch (Exception e) {
107 | JOptionPane.showMessageDialog(null, e);
108 | return false;
109 | }
110 | }
111 |
112 | public boolean delete(MProduct dts) {
113 |
114 | sql = ("{call sp_eliminar_producto (?)}");
115 |
116 | try {
117 | PreparedStatement pst = cn.prepareStatement(sql);
118 | pst.setString(1, dts.getIdProduct());
119 |
120 | int n = pst.executeUpdate();
121 |
122 | if (n != 0) {
123 | return true;
124 | } else {
125 | return false;
126 | }
127 |
128 | } catch (Exception e) {
129 | JOptionPane.showMessageDialog(null, "Error");
130 | return false;
131 | }
132 | }
133 |
134 | public int generateIDProduct() {
135 | String sql = ("SELECT MAX(idProducto) AS id FROM productos");
136 | int cod = 0;
137 |
138 | try {
139 | Statement st = cn.createStatement();
140 | ResultSet rs = st.executeQuery(sql);
141 |
142 | if (rs.next()) {
143 | cod = rs.getInt("id") + 1;
144 | }
145 | } catch (SQLException e) {
146 | JOptionPane.showMessageDialog(null, "Error" + e.toString());
147 |
148 | }
149 | return cod;
150 | }
151 |
152 | public boolean rest(int idProduct, int amount) {
153 |
154 | sql = "update productos set cantidad=cantidad-?"
155 | + "where idProducto = ?";
156 |
157 | try {
158 | PreparedStatement pst = cn.prepareStatement(sql);
159 | pst.setInt(1, amount);
160 | pst.setInt(2, idProduct);
161 |
162 | int n = pst.executeUpdate();
163 |
164 | if (n != 0) {
165 | return true;
166 | } else {
167 | return false;
168 | }
169 |
170 | } catch (Exception e) {
171 | JOptionPane.showMessageDialog(null, "Error");
172 | return false;
173 | }
174 | }
175 |
176 | public boolean sum(int idProduct, int amount) {
177 |
178 | sql = "update productos set cantidad=cantidad+?"
179 | + "where idProducto = ?";
180 |
181 | try {
182 | PreparedStatement pst = cn.prepareStatement(sql);
183 | pst.setInt(1, amount);
184 | pst.setInt(2, idProduct);
185 |
186 | int n = pst.executeUpdate();
187 |
188 | if (n != 0) {
189 | return true;
190 | } else {
191 | return false;
192 | }
193 |
194 | } catch (Exception e) {
195 | JOptionPane.showMessageDialog(null, "Error");
196 | return false;
197 | }
198 | }
199 | }
200 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmBuysDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaLogica.NBuysDetails;
4 | import javax.swing.JOptionPane;
5 | import javax.swing.table.DefaultTableModel;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class FrmBuysDetails extends javax.swing.JInternalFrame {
12 |
13 | public static int idBuys;
14 |
15 | public FrmBuysDetails() {
16 | initComponents();
17 | showA(String.valueOf(idBuys));
18 | this.setTitle("Detalles de Compras");
19 | }
20 |
21 |
22 | void showA(String search) {
23 | try {
24 |
25 | DefaultTableModel model;
26 | NBuysDetails func = new NBuysDetails();
27 | model = func.showA(search);
28 | tblList.setModel(model);
29 |
30 | } catch (Exception e) {
31 | JOptionPane.showMessageDialog(null, "Error");
32 | }
33 | }
34 |
35 |
36 | @SuppressWarnings("unchecked")
37 | // //GEN-BEGIN:initComponents
38 | private void initComponents() {
39 |
40 | jPanel1 = new javax.swing.JPanel();
41 | jScrollPane1 = new javax.swing.JScrollPane();
42 | tblList = new javax.swing.JTable();
43 | btnExit = new javax.swing.JButton();
44 |
45 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
46 |
47 | jPanel1.setBackground(new java.awt.Color(157, 43, 36));
48 |
49 | tblList.setModel(new javax.swing.table.DefaultTableModel(
50 | new Object [][] {
51 | {null, null, null, null},
52 | {null, null, null, null},
53 | {null, null, null, null},
54 | {null, null, null, null}
55 | },
56 | new String [] {
57 | "Title 1", "Title 2", "Title 3", "Title 4"
58 | }
59 | ));
60 | jScrollPane1.setViewportView(tblList);
61 |
62 | btnExit.setText("Cerrar");
63 | btnExit.addActionListener(new java.awt.event.ActionListener() {
64 | public void actionPerformed(java.awt.event.ActionEvent evt) {
65 | btnExitActionPerformed(evt);
66 | }
67 | });
68 |
69 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
70 | jPanel1.setLayout(jPanel1Layout);
71 | jPanel1Layout.setHorizontalGroup(
72 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
73 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
74 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
75 | .addComponent(btnExit)
76 | .addGap(58, 58, 58))
77 | .addGroup(jPanel1Layout.createSequentialGroup()
78 | .addGap(14, 14, 14)
79 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 722, javax.swing.GroupLayout.PREFERRED_SIZE)
80 | .addContainerGap(18, Short.MAX_VALUE))
81 | );
82 | jPanel1Layout.setVerticalGroup(
83 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
84 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
85 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
86 | .addComponent(btnExit)
87 | .addGap(18, 18, 18)
88 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
89 | .addGap(7, 7, 7))
90 | );
91 |
92 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
93 | getContentPane().setLayout(layout);
94 | layout.setHorizontalGroup(
95 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 | .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
97 | );
98 | layout.setVerticalGroup(
99 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
101 | );
102 |
103 | pack();
104 | }// //GEN-END:initComponents
105 |
106 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
107 | dispose();
108 | }//GEN-LAST:event_btnExitActionPerformed
109 |
110 | /**
111 | * @param args the command line arguments
112 | */
113 | public static void main(String args[]) {
114 | /* Set the Nimbus look and feel */
115 | //
116 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
117 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
118 | */
119 | try {
120 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
121 | if ("Nimbus".equals(info.getName())) {
122 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
123 | break;
124 | }
125 | }
126 | } catch (ClassNotFoundException ex) {
127 | java.util.logging.Logger.getLogger(FrmBuysDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
128 | } catch (InstantiationException ex) {
129 | java.util.logging.Logger.getLogger(FrmBuysDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
130 | } catch (IllegalAccessException ex) {
131 | java.util.logging.Logger.getLogger(FrmBuysDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
132 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
133 | java.util.logging.Logger.getLogger(FrmBuysDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
134 | }
135 | //
136 |
137 | /* Create and display the form */
138 | java.awt.EventQueue.invokeLater(new Runnable() {
139 | public void run() {
140 | new FrmBuysDetails().setVisible(true);
141 | }
142 | });
143 | }
144 |
145 | // Variables declaration - do not modify//GEN-BEGIN:variables
146 | private javax.swing.JButton btnExit;
147 | private javax.swing.JPanel jPanel1;
148 | private javax.swing.JScrollPane jScrollPane1;
149 | private javax.swing.JTable tblList;
150 | // End of variables declaration//GEN-END:variables
151 | }
152 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmCategory.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
130 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSaleDetails.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaLogica.NSaleDetails;
4 | import javax.swing.JOptionPane;
5 | import javax.swing.table.DefaultTableModel;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class FrmSaleDetails extends javax.swing.JInternalFrame {
12 |
13 | public static int idVenta;
14 |
15 | public FrmSaleDetails() {
16 | initComponents();
17 | showA(String.valueOf(idVenta));
18 | this.setTitle("Detalles de Ventas");
19 | }
20 |
21 | void showA(String search) {
22 | try {
23 |
24 | DefaultTableModel model;
25 | NSaleDetails func = new NSaleDetails();
26 | model = func.showA(search);
27 | tblList.setModel(model);
28 |
29 | } catch (Exception e) {
30 | JOptionPane.showMessageDialog(null, e.toString());
31 | }
32 | }
33 |
34 | /**
35 | * This method is called from within the constructor to initialize the form.
36 | * WARNING: Do NOT modify this code. The content of this method is always
37 | * regenerated by the Form Editor.
38 | */
39 | @SuppressWarnings("unchecked")
40 | // //GEN-BEGIN:initComponents
41 | private void initComponents() {
42 |
43 | jPanel1 = new javax.swing.JPanel();
44 | jScrollPane1 = new javax.swing.JScrollPane();
45 | tblList = new javax.swing.JTable();
46 | btnExit = new javax.swing.JButton();
47 |
48 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
49 |
50 | jPanel1.setBackground(new java.awt.Color(157, 43, 36));
51 |
52 | tblList.setModel(new javax.swing.table.DefaultTableModel(
53 | new Object [][] {
54 | {null, null, null, null},
55 | {null, null, null, null},
56 | {null, null, null, null},
57 | {null, null, null, null}
58 | },
59 | new String [] {
60 | "Title 1", "Title 2", "Title 3", "Title 4"
61 | }
62 | ));
63 | jScrollPane1.setViewportView(tblList);
64 |
65 | btnExit.setText("Cerrar");
66 | btnExit.addActionListener(new java.awt.event.ActionListener() {
67 | public void actionPerformed(java.awt.event.ActionEvent evt) {
68 | btnExitActionPerformed(evt);
69 | }
70 | });
71 |
72 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
73 | jPanel1.setLayout(jPanel1Layout);
74 | jPanel1Layout.setHorizontalGroup(
75 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
76 | .addGroup(jPanel1Layout.createSequentialGroup()
77 | .addContainerGap()
78 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 730, javax.swing.GroupLayout.PREFERRED_SIZE)
79 | .addContainerGap(12, Short.MAX_VALUE))
80 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
81 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
82 | .addComponent(btnExit)
83 | .addGap(52, 52, 52))
84 | );
85 | jPanel1Layout.setVerticalGroup(
86 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
87 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
88 | .addContainerGap(12, Short.MAX_VALUE)
89 | .addComponent(btnExit)
90 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
91 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
92 | .addContainerGap())
93 | );
94 |
95 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
96 | getContentPane().setLayout(layout);
97 | layout.setHorizontalGroup(
98 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
99 | .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
100 | );
101 | layout.setVerticalGroup(
102 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
104 | );
105 |
106 | pack();
107 | }// //GEN-END:initComponents
108 |
109 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
110 | dispose();
111 | }//GEN-LAST:event_btnExitActionPerformed
112 |
113 | /**
114 | * @param args the command line arguments
115 | */
116 | public static void main(String args[]) {
117 | /* Set the Nimbus look and feel */
118 | //
119 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
120 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
121 | */
122 | try {
123 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
124 | if ("Nimbus".equals(info.getName())) {
125 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
126 | break;
127 | }
128 | }
129 | } catch (ClassNotFoundException ex) {
130 | java.util.logging.Logger.getLogger(FrmSaleDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
131 | } catch (InstantiationException ex) {
132 | java.util.logging.Logger.getLogger(FrmSaleDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
133 | } catch (IllegalAccessException ex) {
134 | java.util.logging.Logger.getLogger(FrmSaleDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
135 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
136 | java.util.logging.Logger.getLogger(FrmSaleDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
137 | }
138 | //
139 |
140 | /* Create and display the form */
141 | java.awt.EventQueue.invokeLater(new Runnable() {
142 | public void run() {
143 | new FrmSaleDetails().setVisible(true);
144 | }
145 | });
146 | }
147 |
148 | // Variables declaration - do not modify//GEN-BEGIN:variables
149 | private javax.swing.JButton btnExit;
150 | private javax.swing.JPanel jPanel1;
151 | private javax.swing.JScrollPane jScrollPane1;
152 | private javax.swing.JTable tblList;
153 | // End of variables declaration//GEN-END:variables
154 | }
155 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSupplierView.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
151 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmProductView.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
151 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmCategory.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaData.MCategory;
4 | import com.capaLogica.NCategory;
5 | import javax.swing.JOptionPane;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class FrmCategory extends javax.swing.JInternalFrame {
12 |
13 |
14 | public FrmCategory() {
15 | initComponents();
16 | this.setTitle("Categorias");
17 | }
18 |
19 |
20 | @SuppressWarnings("unchecked")
21 | // //GEN-BEGIN:initComponents
22 | private void initComponents() {
23 |
24 | jPanel1 = new javax.swing.JPanel();
25 | jLabel1 = new javax.swing.JLabel();
26 | jLabel2 = new javax.swing.JLabel();
27 | txtCategory = new javax.swing.JTextField();
28 | btnSave = new javax.swing.JButton();
29 | btnExit = new javax.swing.JButton();
30 |
31 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
32 | setTitle("Registro de Categorias");
33 |
34 | jPanel1.setBackground(new java.awt.Color(245, 129, 100));
35 | jPanel1.setToolTipText("");
36 |
37 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
38 | jLabel1.setText("Ingreso de Categoria");
39 |
40 | jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N
41 | jLabel2.setText("Ingreso de Categoria:");
42 |
43 | btnSave.setText("Guardar");
44 | btnSave.addActionListener(new java.awt.event.ActionListener() {
45 | public void actionPerformed(java.awt.event.ActionEvent evt) {
46 | btnSaveActionPerformed(evt);
47 | }
48 | });
49 |
50 | btnExit.setText("Salir");
51 | btnExit.addActionListener(new java.awt.event.ActionListener() {
52 | public void actionPerformed(java.awt.event.ActionEvent evt) {
53 | btnExitActionPerformed(evt);
54 | }
55 | });
56 |
57 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
58 | jPanel1.setLayout(jPanel1Layout);
59 | jPanel1Layout.setHorizontalGroup(
60 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
61 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
62 | .addGap(78, 78, 78)
63 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
64 | .addComponent(jLabel1)
65 | .addGroup(jPanel1Layout.createSequentialGroup()
66 | .addComponent(jLabel2)
67 | .addGap(18, 18, 18)
68 | .addComponent(txtCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
69 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
70 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
71 | .addComponent(btnExit)
72 | .addComponent(btnSave))
73 | .addGap(60, 60, 60))
74 | );
75 | jPanel1Layout.setVerticalGroup(
76 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77 | .addGroup(jPanel1Layout.createSequentialGroup()
78 | .addContainerGap()
79 | .addComponent(jLabel1)
80 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
81 | .addGroup(jPanel1Layout.createSequentialGroup()
82 | .addGap(23, 23, 23)
83 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
84 | .addComponent(jLabel2)
85 | .addComponent(txtCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
86 | .addGroup(jPanel1Layout.createSequentialGroup()
87 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
88 | .addComponent(btnSave)))
89 | .addGap(18, 18, 18)
90 | .addComponent(btnExit)
91 | .addContainerGap(28, Short.MAX_VALUE))
92 | );
93 |
94 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
95 | getContentPane().setLayout(layout);
96 | layout.setHorizontalGroup(
97 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
99 | );
100 | layout.setVerticalGroup(
101 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
102 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
103 | );
104 |
105 | pack();
106 | }// //GEN-END:initComponents
107 |
108 | private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
109 | MCategory dts = new MCategory();
110 | NCategory func = new NCategory();
111 |
112 | if (txtCategory.getText().length()==0) {
113 |
114 | JOptionPane.showMessageDialog(null, "Ingrese la Categoria");
115 | txtCategory.requestFocus();
116 | return;
117 | }
118 | dts.setnCategory(txtCategory.getText());
119 |
120 | if (func.insert(dts)) {
121 |
122 | JOptionPane.showMessageDialog(null, "Categoria Registrada");
123 | txtCategory.setText("");
124 | }
125 | }//GEN-LAST:event_btnSaveActionPerformed
126 |
127 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
128 | dispose();
129 | }//GEN-LAST:event_btnExitActionPerformed
130 |
131 | /**
132 | * @param args the command line arguments
133 | */
134 | public static void main(String args[]) {
135 | /* Set the Nimbus look and feel */
136 | //
137 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
138 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
139 | */
140 | try {
141 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
142 | if ("Nimbus".equals(info.getName())) {
143 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
144 | break;
145 | }
146 | }
147 | } catch (ClassNotFoundException ex) {
148 | java.util.logging.Logger.getLogger(FrmCategory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
149 | } catch (InstantiationException ex) {
150 | java.util.logging.Logger.getLogger(FrmCategory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
151 | } catch (IllegalAccessException ex) {
152 | java.util.logging.Logger.getLogger(FrmCategory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
153 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
154 | java.util.logging.Logger.getLogger(FrmCategory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
155 | }
156 | //
157 | //
158 |
159 | /* Create and display the form */
160 | java.awt.EventQueue.invokeLater(new Runnable() {
161 | public void run() {
162 | new FrmCategory().setVisible(true);
163 | }
164 | });
165 | }
166 |
167 | // Variables declaration - do not modify//GEN-BEGIN:variables
168 | private javax.swing.JButton btnExit;
169 | private javax.swing.JButton btnSave;
170 | private javax.swing.JLabel jLabel1;
171 | private javax.swing.JLabel jLabel2;
172 | private javax.swing.JPanel jPanel1;
173 | private javax.swing.JTextField txtCategory;
174 | // End of variables declaration//GEN-END:variables
175 | }
176 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmEmployeeView.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
159 |
--------------------------------------------------------------------------------
/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmSupplierView.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaLogica.NSupplier;
4 | import javax.swing.JOptionPane;
5 | import javax.swing.table.DefaultTableModel;
6 | /**
7 | *
8 | * @author Miguel Antonio
9 | */
10 | public class FrmSupplierView extends javax.swing.JFrame {
11 |
12 |
13 | public FrmSupplierView() {
14 | initComponents();
15 | showA("");
16 | this.setLocationRelativeTo(null);
17 | this.setTitle("Lista de Proveedores");
18 | }
19 |
20 |
21 | void showA(String search) {
22 | try {
23 |
24 | DefaultTableModel model;
25 | NSupplier func = new NSupplier();
26 | model = func.showA(search);
27 | tblList.setModel(model);
28 |
29 | } catch (Exception e) {
30 | JOptionPane.showMessageDialog(null, "Error");
31 | }
32 | }
33 |
34 |
35 | @SuppressWarnings("unchecked")
36 | // //GEN-BEGIN:initComponents
37 | private void initComponents() {
38 |
39 | jPanel1 = new javax.swing.JPanel();
40 | jLabel1 = new javax.swing.JLabel();
41 | jScrollPane1 = new javax.swing.JScrollPane();
42 | tblList = new javax.swing.JTable();
43 | jLabel2 = new javax.swing.JLabel();
44 | txtSearch = new javax.swing.JTextField();
45 | btnSearch = new javax.swing.JButton();
46 | btnExit = new javax.swing.JButton();
47 |
48 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
49 | setUndecorated(true);
50 |
51 | jPanel1.setBackground(new java.awt.Color(229, 0, 0));
52 |
53 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
54 | jLabel1.setText("Lista de Proveedores");
55 |
56 | tblList.setModel(new javax.swing.table.DefaultTableModel(
57 | new Object [][] {
58 | {null, null, null, null},
59 | {null, null, null, null},
60 | {null, null, null, null},
61 | {null, null, null, null}
62 | },
63 | new String [] {
64 | "Title 1", "Title 2", "Title 3", "Title 4"
65 | }
66 | ));
67 | tblList.addMouseListener(new java.awt.event.MouseAdapter() {
68 | public void mousePressed(java.awt.event.MouseEvent evt) {
69 | tblListMousePressed(evt);
70 | }
71 | });
72 | jScrollPane1.setViewportView(tblList);
73 |
74 | jLabel2.setText("Buscar por Razon Social");
75 |
76 | btnSearch.setText("Buscar");
77 | btnSearch.addActionListener(new java.awt.event.ActionListener() {
78 | public void actionPerformed(java.awt.event.ActionEvent evt) {
79 | btnSearchActionPerformed(evt);
80 | }
81 | });
82 |
83 | btnExit.setText("Salir");
84 | btnExit.addActionListener(new java.awt.event.ActionListener() {
85 | public void actionPerformed(java.awt.event.ActionEvent evt) {
86 | btnExitActionPerformed(evt);
87 | }
88 | });
89 |
90 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
91 | jPanel1.setLayout(jPanel1Layout);
92 | jPanel1Layout.setHorizontalGroup(
93 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
94 | .addGroup(jPanel1Layout.createSequentialGroup()
95 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 | .addGroup(jPanel1Layout.createSequentialGroup()
97 | .addGap(235, 235, 235)
98 | .addComponent(jLabel1))
99 | .addGroup(jPanel1Layout.createSequentialGroup()
100 | .addGap(29, 29, 29)
101 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE))
102 | .addGroup(jPanel1Layout.createSequentialGroup()
103 | .addGap(50, 50, 50)
104 | .addComponent(jLabel2)
105 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
106 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
107 | .addGap(26, 26, 26)
108 | .addComponent(btnSearch)
109 | .addGap(27, 27, 27)
110 | .addComponent(btnExit)))
111 | .addContainerGap(37, Short.MAX_VALUE))
112 | );
113 | jPanel1Layout.setVerticalGroup(
114 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115 | .addGroup(jPanel1Layout.createSequentialGroup()
116 | .addGap(19, 19, 19)
117 | .addComponent(jLabel1)
118 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
119 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
120 | .addComponent(jLabel2)
121 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
122 | .addComponent(btnSearch)
123 | .addComponent(btnExit))
124 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
125 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
126 | .addGap(16, 16, 16))
127 | );
128 |
129 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
130 | getContentPane().setLayout(layout);
131 | layout.setHorizontalGroup(
132 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
133 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
134 | );
135 | layout.setVerticalGroup(
136 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
137 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
138 | );
139 |
140 | pack();
141 | }// //GEN-END:initComponents
142 |
143 | private void tblListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblListMousePressed
144 | if (evt.getClickCount()==2) {
145 |
146 | int row = tblList.getSelectedRow();
147 | String cod;
148 | String firstName;
149 |
150 | cod = tblList.getValueAt(row, 0).toString();
151 | firstName = tblList.getValueAt(row, 1).toString();
152 |
153 | FrmBuys.txtIdSupplier.setText(cod);
154 | FrmBuys.txtSupplier.setText(firstName);
155 | this.dispose();
156 | }
157 | }//GEN-LAST:event_tblListMousePressed
158 |
159 | private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
160 | showA(txtSearch.getText());
161 | }//GEN-LAST:event_btnSearchActionPerformed
162 |
163 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
164 | dispose();
165 | }//GEN-LAST:event_btnExitActionPerformed
166 |
167 | /**
168 | * @param args the command line arguments
169 | */
170 | public static void main(String args[]) {
171 | /* Set the Nimbus look and feel */
172 | //
173 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
174 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
175 | */
176 | try {
177 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
178 | if ("Nimbus".equals(info.getName())) {
179 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
180 | break;
181 | }
182 | }
183 | } catch (ClassNotFoundException ex) {
184 | java.util.logging.Logger.getLogger(FrmSupplierView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
185 | } catch (InstantiationException ex) {
186 | java.util.logging.Logger.getLogger(FrmSupplierView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
187 | } catch (IllegalAccessException ex) {
188 | java.util.logging.Logger.getLogger(FrmSupplierView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
189 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
190 | java.util.logging.Logger.getLogger(FrmSupplierView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
191 | }
192 | //
193 |
194 | /* Create and display the form */
195 | java.awt.EventQueue.invokeLater(new Runnable() {
196 | public void run() {
197 | new FrmSupplierView().setVisible(true);
198 | }
199 | });
200 | }
201 |
202 | // Variables declaration - do not modify//GEN-BEGIN:variables
203 | private javax.swing.JButton btnExit;
204 | private javax.swing.JButton btnSearch;
205 | private javax.swing.JLabel jLabel1;
206 | private javax.swing.JLabel jLabel2;
207 | private javax.swing.JPanel jPanel1;
208 | private javax.swing.JScrollPane jScrollPane1;
209 | private javax.swing.JTable tblList;
210 | private javax.swing.JTextField txtSearch;
211 | // End of variables declaration//GEN-END:variables
212 | }
213 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmProductView.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaLogica.NProduct;
4 | import javax.swing.JOptionPane;
5 | import javax.swing.table.DefaultTableModel;
6 |
7 | /**
8 | *
9 | * @author Miguel Antonio
10 | */
11 | public class FrmProductView extends javax.swing.JFrame {
12 |
13 | public byte option;
14 |
15 | public FrmProductView() {
16 | initComponents();
17 | see("");
18 | this.setLocationRelativeTo(null);
19 | this.setTitle("Lista de Productos");
20 | }
21 |
22 | void see(String buscar) {
23 | try {
24 |
25 | DefaultTableModel modelo;
26 | NProduct func = new NProduct();
27 | modelo = func.showA(buscar);
28 | tblList.setModel(modelo);
29 |
30 | } catch (Exception e) {
31 | JOptionPane.showMessageDialog(null, "Error");
32 | }
33 | }
34 |
35 |
36 | @SuppressWarnings("unchecked")
37 | // //GEN-BEGIN:initComponents
38 | private void initComponents() {
39 |
40 | jPanel1 = new javax.swing.JPanel();
41 | jLabel1 = new javax.swing.JLabel();
42 | jScrollPane1 = new javax.swing.JScrollPane();
43 | tblList = new javax.swing.JTable();
44 | jLabel2 = new javax.swing.JLabel();
45 | txtSearch = new javax.swing.JTextField();
46 | btnSearch = new javax.swing.JButton();
47 | btnExit = new javax.swing.JButton();
48 |
49 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
50 | setUndecorated(true);
51 |
52 | jPanel1.setBackground(new java.awt.Color(229, 0, 0));
53 |
54 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
55 | jLabel1.setText("Lista de Productos");
56 |
57 | tblList.setModel(new javax.swing.table.DefaultTableModel(
58 | new Object [][] {
59 | {null, null, null, null},
60 | {null, null, null, null},
61 | {null, null, null, null},
62 | {null, null, null, null}
63 | },
64 | new String [] {
65 | "Title 1", "Title 2", "Title 3", "Title 4"
66 | }
67 | ));
68 | tblList.addMouseListener(new java.awt.event.MouseAdapter() {
69 | public void mousePressed(java.awt.event.MouseEvent evt) {
70 | tblListMousePressed(evt);
71 | }
72 | });
73 | jScrollPane1.setViewportView(tblList);
74 |
75 | jLabel2.setText("Buscar por Razon Social");
76 |
77 | btnSearch.setText("Buscar");
78 | btnSearch.addActionListener(new java.awt.event.ActionListener() {
79 | public void actionPerformed(java.awt.event.ActionEvent evt) {
80 | btnSearchActionPerformed(evt);
81 | }
82 | });
83 |
84 | btnExit.setText("Salir");
85 | btnExit.addActionListener(new java.awt.event.ActionListener() {
86 | public void actionPerformed(java.awt.event.ActionEvent evt) {
87 | btnExitActionPerformed(evt);
88 | }
89 | });
90 |
91 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
92 | jPanel1.setLayout(jPanel1Layout);
93 | jPanel1Layout.setHorizontalGroup(
94 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95 | .addGroup(jPanel1Layout.createSequentialGroup()
96 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
97 | .addGroup(jPanel1Layout.createSequentialGroup()
98 | .addGap(235, 235, 235)
99 | .addComponent(jLabel1))
100 | .addGroup(jPanel1Layout.createSequentialGroup()
101 | .addGap(29, 29, 29)
102 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE))
103 | .addGroup(jPanel1Layout.createSequentialGroup()
104 | .addGap(50, 50, 50)
105 | .addComponent(jLabel2)
106 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
107 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
108 | .addGap(26, 26, 26)
109 | .addComponent(btnSearch)
110 | .addGap(27, 27, 27)
111 | .addComponent(btnExit)))
112 | .addContainerGap(48, Short.MAX_VALUE))
113 | );
114 | jPanel1Layout.setVerticalGroup(
115 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
116 | .addGroup(jPanel1Layout.createSequentialGroup()
117 | .addGap(19, 19, 19)
118 | .addComponent(jLabel1)
119 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
120 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
121 | .addComponent(jLabel2)
122 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
123 | .addComponent(btnSearch)
124 | .addComponent(btnExit))
125 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
126 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
127 | .addGap(16, 16, 16))
128 | );
129 |
130 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
131 | getContentPane().setLayout(layout);
132 | layout.setHorizontalGroup(
133 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
134 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
135 | );
136 | layout.setVerticalGroup(
137 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
138 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
139 | );
140 |
141 | pack();
142 | }// //GEN-END:initComponents
143 |
144 | private void tblListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblListMousePressed
145 |
146 | if (option == 1) {
147 | if (evt.getClickCount() == 2) {
148 |
149 | int row = tblList.getSelectedRow();
150 | String cod;
151 | String product;
152 | String price;
153 |
154 | cod = tblList.getValueAt(row, 0).toString();
155 | product = tblList.getValueAt(row, 2).toString();
156 | price = tblList.getValueAt(row, 5).toString();
157 |
158 | FrmBuys.txtIdProduct.setText(cod);
159 | FrmBuys.txtProduct.setText(product);
160 | FrmBuys.txtBuysPrice.setText(price);
161 | this.dispose();
162 | }
163 | }
164 |
165 | }//GEN-LAST:event_tblListMousePressed
166 |
167 | private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
168 | see(txtSearch.getText());
169 | }//GEN-LAST:event_btnSearchActionPerformed
170 |
171 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
172 | dispose();
173 | }//GEN-LAST:event_btnExitActionPerformed
174 |
175 | /**
176 | * @param args the command line arguments
177 | */
178 | public static void main(String args[]) {
179 | /* Set the Nimbus look and feel */
180 | //
181 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
182 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
183 | */
184 | try {
185 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
186 | if ("Nimbus".equals(info.getName())) {
187 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
188 | break;
189 | }
190 | }
191 | } catch (ClassNotFoundException ex) {
192 | java.util.logging.Logger.getLogger(FrmProductView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
193 | } catch (InstantiationException ex) {
194 | java.util.logging.Logger.getLogger(FrmProductView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
195 | } catch (IllegalAccessException ex) {
196 | java.util.logging.Logger.getLogger(FrmProductView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
197 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
198 | java.util.logging.Logger.getLogger(FrmProductView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
199 | }
200 | //
201 |
202 | /* Create and display the form */
203 | java.awt.EventQueue.invokeLater(new Runnable() {
204 | public void run() {
205 | new FrmProductView().setVisible(true);
206 | }
207 | });
208 | }
209 |
210 | // Variables declaration - do not modify//GEN-BEGIN:variables
211 | private javax.swing.JButton btnExit;
212 | private javax.swing.JButton btnSearch;
213 | private javax.swing.JLabel jLabel1;
214 | private javax.swing.JLabel jLabel2;
215 | private javax.swing.JPanel jPanel1;
216 | private javax.swing.JScrollPane jScrollPane1;
217 | private javax.swing.JTable tblList;
218 | private javax.swing.JTextField txtSearch;
219 | // End of variables declaration//GEN-END:variables
220 | }
221 |
--------------------------------------------------------------------------------
/src/com/capaPresentacion/FrmEmployeeView.java:
--------------------------------------------------------------------------------
1 | package com.capaPresentacion;
2 |
3 | import com.capaLogica.NEmployee;
4 | import javax.swing.JOptionPane;
5 | import javax.swing.table.DefaultTableModel;
6 | /**
7 | *
8 | * @author Miguel Antonio
9 | */
10 | public class FrmEmployeeView extends javax.swing.JFrame {
11 |
12 |
13 | public FrmEmployeeView() {
14 | initComponents();
15 | showA("");
16 | this.setLocationRelativeTo(null);
17 | this.setTitle("Lista de Empleados");
18 | }
19 |
20 | void showA(String search) {
21 | try {
22 |
23 | DefaultTableModel model;
24 | NEmployee func = new NEmployee();
25 | model = func.showA(search);
26 | tblList.setModel(model);
27 |
28 | } catch (Exception e) {
29 | JOptionPane.showMessageDialog(null, "Error");
30 | }
31 | }
32 |
33 |
34 | @SuppressWarnings("unchecked")
35 | // //GEN-BEGIN:initComponents
36 | private void initComponents() {
37 |
38 | jPanel1 = new javax.swing.JPanel();
39 | jLabel1 = new javax.swing.JLabel();
40 | jScrollPane1 = new javax.swing.JScrollPane();
41 | tblList = new javax.swing.JTable();
42 | jLabel = new javax.swing.JLabel();
43 | txtSearch = new javax.swing.JTextField();
44 | btnSearch = new javax.swing.JButton();
45 | btnExit = new javax.swing.JButton();
46 |
47 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
48 | setTitle("Lista de Empleados");
49 | setUndecorated(true);
50 |
51 | jPanel1.setBackground(new java.awt.Color(229, 0, 0));
52 | jPanel1.setForeground(new java.awt.Color(255, 255, 0));
53 |
54 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
55 | jLabel1.setText("Lista de Empleados");
56 |
57 | tblList.setModel(new javax.swing.table.DefaultTableModel(
58 | new Object [][] {
59 | {null, null, null, null},
60 | {null, null, null, null},
61 | {null, null, null, null},
62 | {null, null, null, null}
63 | },
64 | new String [] {
65 | "Title 1", "Title 2", "Title 3", "Title 4"
66 | }
67 | ));
68 | tblList.addMouseListener(new java.awt.event.MouseAdapter() {
69 | public void mousePressed(java.awt.event.MouseEvent evt) {
70 | tblListMousePressed(evt);
71 | }
72 | });
73 | jScrollPane1.setViewportView(tblList);
74 |
75 | jLabel.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N
76 | jLabel.setText("Buscar:");
77 |
78 | btnSearch.setText("Buscar");
79 | btnSearch.addActionListener(new java.awt.event.ActionListener() {
80 | public void actionPerformed(java.awt.event.ActionEvent evt) {
81 | btnSearchActionPerformed(evt);
82 | }
83 | });
84 |
85 | btnExit.setText("Salir");
86 | btnExit.addActionListener(new java.awt.event.ActionListener() {
87 | public void actionPerformed(java.awt.event.ActionEvent evt) {
88 | btnExitActionPerformed(evt);
89 | }
90 | });
91 |
92 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
93 | jPanel1.setLayout(jPanel1Layout);
94 | jPanel1Layout.setHorizontalGroup(
95 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
97 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
98 | .addComponent(jLabel1)
99 | .addGap(324, 324, 324))
100 | .addGroup(jPanel1Layout.createSequentialGroup()
101 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
102 | .addGroup(jPanel1Layout.createSequentialGroup()
103 | .addContainerGap()
104 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 776, javax.swing.GroupLayout.PREFERRED_SIZE))
105 | .addGroup(jPanel1Layout.createSequentialGroup()
106 | .addGap(17, 17, 17)
107 | .addComponent(jLabel)
108 | .addGap(28, 28, 28)
109 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
110 | .addGap(73, 73, 73)
111 | .addComponent(btnSearch)
112 | .addGap(43, 43, 43)
113 | .addComponent(btnExit)))
114 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
115 | );
116 | jPanel1Layout.setVerticalGroup(
117 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
118 | .addGroup(jPanel1Layout.createSequentialGroup()
119 | .addContainerGap()
120 | .addComponent(jLabel1)
121 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
122 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
123 | .addComponent(jLabel)
124 | .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
125 | .addComponent(btnSearch)
126 | .addComponent(btnExit))
127 | .addGap(42, 42, 42)
128 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
129 | .addGap(16, 16, 16))
130 | );
131 |
132 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
133 | getContentPane().setLayout(layout);
134 | layout.setHorizontalGroup(
135 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
136 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
137 | );
138 | layout.setVerticalGroup(
139 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
140 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
141 | );
142 |
143 | pack();
144 | }// //GEN-END:initComponents
145 |
146 | private void tblListMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblListMousePressed
147 | if (evt.getClickCount()==2) {
148 |
149 | int row = tblList.getSelectedRow();
150 | String cod;
151 | String firstName;
152 | String lastName;
153 |
154 | cod = tblList.getValueAt(row, 0).toString();
155 | firstName = tblList.getValueAt(row, 1).toString();
156 | lastName = tblList.getValueAt(row, 2).toString();
157 |
158 | FrmUsers.txtIdEmployee.setText(cod);
159 | FrmUsers.txtFirstName.setText(firstName);
160 | FrmUsers.txtLastName.setText(lastName);
161 | this.dispose();
162 | }
163 | }//GEN-LAST:event_tblListMousePressed
164 |
165 | private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
166 | showA(txtSearch.getText());
167 | }//GEN-LAST:event_btnSearchActionPerformed
168 |
169 | private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
170 | dispose();
171 | }//GEN-LAST:event_btnExitActionPerformed
172 |
173 | /**
174 | * @param args the command line arguments
175 | */
176 | public static void main(String args[]) {
177 | /* Set the Nimbus look and feel */
178 | //
179 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
180 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
181 | */
182 | try {
183 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
184 | if ("Nimbus".equals(info.getName())) {
185 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
186 | break;
187 | }
188 | }
189 | } catch (ClassNotFoundException ex) {
190 | java.util.logging.Logger.getLogger(FrmEmployeeView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
191 | } catch (InstantiationException ex) {
192 | java.util.logging.Logger.getLogger(FrmEmployeeView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
193 | } catch (IllegalAccessException ex) {
194 | java.util.logging.Logger.getLogger(FrmEmployeeView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
195 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
196 | java.util.logging.Logger.getLogger(FrmEmployeeView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
197 | }
198 | //
199 | //
200 |
201 | /* Create and display the form */
202 | java.awt.EventQueue.invokeLater(new Runnable() {
203 | public void run() {
204 | new FrmEmployeeView().setVisible(true);
205 | }
206 | });
207 | }
208 |
209 | // Variables declaration - do not modify//GEN-BEGIN:variables
210 | private javax.swing.JButton btnExit;
211 | private javax.swing.JButton btnSearch;
212 | private javax.swing.JLabel jLabel;
213 | private javax.swing.JLabel jLabel1;
214 | private javax.swing.JPanel jPanel1;
215 | private javax.swing.JScrollPane jScrollPane1;
216 | private javax.swing.JTable tblList;
217 | private javax.swing.JTextField txtSearch;
218 | // End of variables declaration//GEN-END:variables
219 | }
220 |
--------------------------------------------------------------------------------
/DB/Soporte.txt:
--------------------------------------------------------------------------------
1 | create table clientes(
2 | idClientes varchar(10) primary key,
3 | nombre varchar (20),
4 | apellido varchar (20),
5 | dni varchar (11),
6 | ruc varchar (11),
7 | edad int,
8 | sexo char (1),
9 | telefono char (8),
10 | direccion varchar (50)
11 | )
12 | go
13 |
14 | create table proveedor(
15 | idProveedor varchar (10) primary key,
16 | razonSocial varchar (30),
17 | ruc varchar(11)
18 | telefono char (8),
19 | direccion varchar (50)
20 | )
21 | go
22 |
23 | create table categoria(
24 | idCategoria int identity primary key,
25 | descripcion varchar (15)
26 | )
27 | go
28 |
29 | create table productos(
30 | idProducto varchar (10) primary key,
31 | serie varchar (30),
32 | nombre varchar (30),
33 | fechaIngre date,
34 | fechaVenc date,
35 | precioCompra decimal(9,2),
36 | precioVenta decimal (9,2),
37 | cantidad int,
38 | idCategoria int references categoria(idCategoria)
39 | )
40 | go
41 |
42 | create table empleados(
43 | idEmpleado varchar (5) primary key,
44 | nombre varchar (20),
45 | apellido varchar (20),
46 | dni varchar (11),
47 | telefono varchar (8),
48 | direccion varchar (50)
49 | )
50 | go
51 |
52 | create table usuarios(
53 | idUsuario int identity primary key,
54 | idEmpleado varchar (5) references empleados(idEmpleado),
55 | usuario varchar (20),
56 | pass varchar (20),
57 | acceso varchar (20),
58 | estado char (2)
59 | )
60 | go
61 |
62 | create table compras(
63 | idCompra int identity primary key,
64 | fecha date,
65 | hora varchar (10),
66 | numDocumento varchar (7),
67 | tipoDocumento varchar (7),
68 | subtotal decimal (8,2),
69 | igv decimal (8,2),
70 | total decimal (8,2),
71 | estado varchar (20),
72 | idUsuario int references usuarios(idUsuario),
73 | idProveedor varchar (10) references proveedor(idProveedor)
74 | )
75 | go
76 |
77 | create table detalle_compras(
78 | idDetalleCompra int identity primary key,
79 | idCompra int references compras(idCompra),
80 | idProducto varchar (10) references productos(idProducto),
81 | cantidad int,
82 | precio decimal (8,2)
83 | total decimal (8,2)
84 | )
85 | go
86 |
87 | create table ventas(
88 | idVenta int identity primary key,
89 | fecha date,
90 | hora varchar (10),
91 | serie varchar (7),
92 | numDocumento varchar (7),
93 | tipoDocumento varchar (7),
94 | igv decimal (8,2),
95 | total decimal (8,2),
96 | estado varchar (20),
97 | idUsuario int references usuarios(idUsuario),
98 | idClientes varchar (10) references clientes(idClientes)
99 | )
100 | go
101 |
102 | create table detalle_ventas(
103 | idDetalleVentas int identity primary key,
104 | idVenta int references ventas(idVenta),
105 | idProducto varchar (10) references productos(idProducto),
106 | cantidad int,
107 | precio decimal (8,2)
108 | total decimal (8,2)
109 | )
110 | go
111 |
112 | .:PROCEDIMIENTOS:.
113 |
114 | create proc sp_listar_clientes
115 | as
116 | select * from clientes
117 | go
118 |
119 | create proc sp_guardar_clientes
120 | @codigo varchar (10),
121 | @nombre varchar (30),
122 | @apellido varchar (30),
123 | @dni int,
124 | @ruc varchar (11),
125 | @edad int,
126 | @sexo char (1),
127 | @telef char(9),
128 | @direc varchar (50)
129 | as
130 | insert into clientes
131 | values (@codigo,@nombre,@apellido,@dni,@ruc,@edad,@sexo,@telef,@direc)
132 | go
133 |
134 | create proc sp_editar_clientes
135 | @codigo varchar (10),
136 | @nombre varchar (30),
137 | @apellido varchar (30),
138 | @dni int,
139 | @ruc varchar (11),
140 | @edad int,
141 | @sexo char (1),
142 | @telef char(9),
143 | @direc varchar (50)
144 | as
145 | update clientes set nombre=@nombre, apellidos=@apellido, dni=@dni, ruc=@ruc, edad=@edad, sexo=@sexo, telefono=@telef, direccion=@direc
146 | WHERE idClientes=@codigo
147 | go
148 |
149 | create proc sp_eliminar_clientes
150 | @codigo varchar (10)
151 | as
152 | delete from clientes WHERE idClientes=@codigo;
153 |
154 | create proc sp_buscar_clientes
155 | @dni varchar (11)
156 | as
157 | select * from clientes WHERE dni like @dni+'%'
158 | go
159 |
160 | create proc sp_listar_empleados
161 | as
162 | select * from empleados
163 | go
164 |
165 | create proc sp_guardar_empleados
166 | @idempleado varchar (5),
167 | @nombre varchar (30),
168 | @apellido varchar (30),
169 | @dni varchar (11),
170 | @telef varchar (8),
171 | @direc varchar (50)
172 | as
173 | insert into empleados values(@idempleado,@nombre,@apellido,@dni,@telef,@direc)
174 | go
175 |
176 | create proc sp_eliminar_empleados
177 | @idempleado varchar (5)
178 | as
179 | delete from empleados where idEmpleados=@idempleado
180 | go
181 |
182 | create proc sp_editar_empleados
183 | @idempleado varchar (5),
184 | @nombre varchar (30),
185 | @apellido varchar (30),
186 | @dni varchar (11),
187 | @telef varchar (8),
188 | @direc varchar (50)
189 | as
190 | update empleados set nombre=@nombre,apellidos=@apellido,dni=@dni,telefono=@telef,direccion=@direc
191 | where idEmpleados=@idempleado
192 | go
193 |
194 | create proc sp_buscar_empleados
195 | @dni varchar (11)
196 | as
197 | select * from empleados where dni like @dni+'%'
198 | go
199 |
200 | create proc sp_listar_proveedor
201 | AS
202 | SELECT * FROM proveedor
203 | go
204 |
205 | create proc sp_guardar_proveedor
206 | @codigo varchar(10), @razon varchar(30), @ruc varchar(11),
207 | @telef varchar(11), @direc varchar(50)
208 | AS
209 | INSERT INTO proveedor VALUES(@codigo, @razon, @ruc, @telef, @direc)
210 | go
211 |
212 | create proc sp_eliminar_proveedor
213 | @codigo varchar(10)
214 | AS
215 | DELETE FROM proveedor WHERE idProveedor=@codigo
216 | go
217 |
218 | create proc sp_editar_proveedor
219 | @codigo varchar(10), @razon varchar(30), @ruc varchar(11),
220 | @telef varchar(11), @direc varchar(50)
221 | AS
222 | UPDATE proveedor SET razonSocial=@razon, ruc=@ruc, telefono=@telef, direccion=@direc
223 | WHERE idProveedor=@codigo
224 | go
225 |
226 | create proc sp_buscar_proveedor
227 | @nombre varchar(30)
228 | AS
229 | SELECT * FROM proveedor
230 | WHERE razonSocial LIKE @nombre+'%'
231 | go
232 |
233 | create proc sp_sesion
234 | @usuario varchar (20),
235 | @password varchar (20)
236 | as
237 | select usuarios.idUsuarios, usuarios.idEmpleados as idemple,
238 | empleados.nombre as nombre, empleados.apellidos apellidos,
239 | usuarios.usuario,usuarios.pass,usuarios.acceso,usuarios.estado
240 | from usuarios inner join empleados on
241 | usuarios.idEmpleados = empleados.idEmpleados
242 | where usuario=@usuario and pass=@password and estado='SI'
243 | go
244 |
245 | create proc sp_listar_usuario
246 | @usuario varchar (20)
247 | as
248 | select usuarios.idUsuarios,usuarios.idEmpleados,empleados.nombre,
249 | empleados.apellidos,usuarios.usuario,usuarios.acceso,usuarios.pass,
250 | usuarios.estado from usuarios inner join empleados
251 | on usuarios.idEmpleados=empleados.idEmpleados
252 | where usuario like @usuario+'%'
253 | go
254 |
255 | create proc sp_eliminar_usuarios
256 | @idusuario int
257 | as
258 | delete from usuarios where idUsuarios=@idusuario
259 | go
260 |
261 | create proc sp_editar_usuarios
262 | @idempleado varchar (5),
263 | @usuario varchar (20),
264 | @password varchar (20),
265 | @acceso varchar (20),
266 | @estado char (2)
267 | as
268 | update usuarios set usuario=@usuario,pass=@password,acceso=@acceso,estado=@estado
269 | where idEmpleados=@idempleado
270 | go
271 |
272 | create proc sp_listar_categoria
273 | as
274 | select * from categoria;
275 | go
276 |
277 | create proc registrarCategoria
278 | @descripcion varchar(15)
279 | AS
280 | INSERT INTO categoria VALUES(@descripcion)
281 | go
282 |
283 | create proc sp_listar_producto
284 | @nombre varchar (30)
285 | as
286 | select productos.idProducto, productos.serie, productos.nombre,
287 | productos.fechaIngreso, productos.fechaVencimiento, productos.precioCompra,
288 | productos.precioVenta, productos.cantidad, productos.idCategoria, categoria.descripcion
289 | as categ from categoria INNER JOIN productos on categoria.idCategoria=productos.idCategoria
290 | where nombre like @nombre+'%' order by idCategoria
291 | go
292 |
293 | create proc sp_guardar_producto
294 | @codigo varchar (10),
295 | @serie varchar (10),
296 | @nombre varchar (30),
297 | @fechaIngre varchar (15),
298 | @fechaCadu varchar (15),
299 | @precioCompra decimal (9,2),
300 | @precioVenta decimal (9,2),
301 | @categoria int
302 | as
303 | insert into productos
304 | VALUES(@codigo,@serie,@nombre,@fechaIngre,@fechaCadu,@precioCompra,@precioVenta,0,@categoria)
305 | go
306 |
307 | create proc sp_eliminar_producto
308 | @codigo varchar (10)
309 | as
310 | delete from productos where idCategoria=@codigo
311 | go
312 |
313 | create proc sp_editar_producto
314 | @codigo varchar (10),
315 | @serie varchar (10),
316 | @nombre varchar (30),
317 | @fechaIngre varchar (15),
318 | @fechaCadu varchar (15),
319 | @precioCompra decimal (9,2),
320 | @precioVenta decimal (9,2),
321 | @categoria int AS UPDATE productos SET
322 | serie=@serie, nombre=@nombre, fechaIngreso=@fechaIngre, fechaVencimiento=@fechaCadu, precioCompra=@precioCompra, precioVenta=@precioVenta, idCategoria=@categoria
323 | WHERE idProducto=@codigo
324 | go
325 |
326 | CREATE PROC listar_compras
327 | AS
328 | SELECT compras.idCompra, proveedor.razonSocial, compras.fecha, empleados.nombre +' '+ empleados.apellidos,
329 | compras.numDocumento, compras.tipoDocumento, compras.estado, compras.subtotal,
330 | compras.igv, compras.total FROM compras INNER JOIN proveedor
331 | ON compras.idProveedor = proveedor.idProveedor INNER JOIN usuarios
332 | ON compras.idUsuarios = usuarios.idUsuarios INNER JOIN empleados
333 | ON usuarios.idEmpleados = empleados.idEmpleados
334 | GO
335 |
336 | CREATE PROC sp_guardar_compra
337 | @fecha varchar (10),
338 | @hora varchar (10),
339 | @numDocumento varchar (7),
340 | @tipoDocumento varchar (7),
341 | @subtotal decimal (8,2),
342 | @igv decimal (8,2),
343 | @total decimal (8,2),
344 | @estado varchar (20),
345 | @idUser int,
346 | @idProveedor varchar (10)
347 | AS
348 | INSERT INTO compras
349 | VALUES (@fecha,@hora,@numDocumento,@tipoDocumento,@subtotal,@igv,@total,@estado,@idUser,@idProveedor)
350 | GO
351 |
352 | CREATE PROC sp_listar_detalle_venta
353 | @idventa int
354 | AS
355 | SELECT detalle_ventas.idVentas,productos.idProducto,productos.nombre,
356 | detalle_ventas.cantidad,productos.precioVenta,detalle_ventas.total
357 | FROM detalle_ventas inner join productos
358 | on detalle_ventas.idProducto = productos.idProducto
359 | WHERE idVentas=@idventa
360 | GO
361 |
362 | CREATE PROC sp_guardar_detalle_venta
363 | @idventa int,
364 | @idproducto varchar (10),
365 | @cantidad int,
366 | @precio decimal(8,2),
367 | @total decimal(8,2)
368 | AS
369 | INSERT INTO detalle_ventas VALUES (@idventa,@idproducto,@cantidad,@precio,@total)
370 | GO
--------------------------------------------------------------------------------