├── ProyectoP2G3
├── src
│ └── main
│ │ ├── resources
│ │ ├── styles
│ │ │ ├── menufxml.css
│ │ │ └── estilos.css
│ │ ├── imagenes
│ │ │ ├── adm.png
│ │ │ ├── ver.png
│ │ │ ├── buscar.png
│ │ │ ├── cerrar.png
│ │ │ ├── editar.png
│ │ │ ├── feria.png
│ │ │ ├── agregar.png
│ │ │ ├── guardar.png
│ │ │ ├── limpiar.png
│ │ │ ├── regresar.png
│ │ │ ├── verificar.png
│ │ │ └── actualizar.png
│ │ └── com
│ │ │ └── mycompany
│ │ │ └── proyectop2g
│ │ │ ├── MenuFXML.fxml
│ │ │ ├── admEmprendedor.fxml
│ │ │ ├── datosFeria.fxml
│ │ │ ├── admStand.fxml
│ │ │ ├── admAuspiciante.fxml
│ │ │ ├── AsignarAuspi.fxml
│ │ │ ├── admFeria.fxml
│ │ │ ├── AgregarAuspi.fxml
│ │ │ └── AgregarEmp.fxml
│ │ └── java
│ │ ├── archivos
│ │ └── datos.ser
│ │ ├── com
│ │ └── mycompany
│ │ │ └── proyectop2g
│ │ │ ├── Principal.java
│ │ │ ├── App.java
│ │ │ ├── AdmEmprendedorController.java
│ │ │ ├── MenuFXMLController.java
│ │ │ ├── AdmAuspicianteController.java
│ │ │ ├── AsignarAuspiController.java
│ │ │ ├── AgregarAuspiController.java
│ │ │ ├── AgregarEmpController.java
│ │ │ ├── AdmFeriaController.java
│ │ │ ├── DatosFeriaController.java
│ │ │ └── AdmStandController.java
│ │ ├── modelo
│ │ ├── participante
│ │ │ ├── SectorCubierto.java
│ │ │ ├── AppSocial.java
│ │ │ ├── Emprendedor.java
│ │ │ ├── RedSocial.java
│ │ │ ├── Auspiciante.java
│ │ │ ├── AuspicianteEnFeria.java
│ │ │ └── Persona.java
│ │ └── evento
│ │ │ ├── SeccionStand.java
│ │ │ ├── Stand.java
│ │ │ ├── Sistema.java
│ │ │ └── Feria.java
│ │ └── module-info.java
├── nb-configuration.xml
├── nbactions.xml
└── pom.xml
├── ProyectoP1G3
├── src
│ └── main
│ │ └── java
│ │ └── modelo
│ │ ├── participante
│ │ ├── SectorCubierto.java
│ │ ├── AppSocial.java
│ │ ├── Emprendedor.java
│ │ ├── RedSocial.java
│ │ ├── AuspicianteEnFeria.java
│ │ ├── Auspiciante.java
│ │ └── Persona.java
│ │ └── evento
│ │ ├── SeccionStand.java
│ │ ├── Stand.java
│ │ ├── Sistema.java
│ │ └── Feria.java
├── target
│ └── maven-status
│ │ └── maven-compiler-plugin
│ │ └── compile
│ │ └── default-compile
│ │ ├── createdFiles.lst
│ │ └── inputFiles.lst
├── pom.xml
├── nbactions.xml
└── LICENSE
└── .gitignore
/ProyectoP2G3/src/main/resources/styles/menufxml.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Empty Stylesheet file.
3 | */
4 |
5 | .mainFxmlClass {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/archivos/datos.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/java/archivos/datos.ser
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/adm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/adm.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/ver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/ver.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/buscar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/buscar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/cerrar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/cerrar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/editar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/editar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/feria.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/feria.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/agregar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/agregar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/guardar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/guardar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/limpiar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/limpiar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/regresar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/regresar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/verificar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/verificar.png
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/imagenes/actualizar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StevenBarzola/POO-P3-G03/HEAD/ProyectoP2G3/src/main/resources/imagenes/actualizar.png
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/SectorCubierto.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | public enum SectorCubierto{
4 | ALIMENTACION, EDUCACION, SALUD, VESTIMENTA;
5 | }
6 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/AppSocial.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | public enum AppSocial{
4 | TWITTER,FACEBOOK, INSTAGRAM, YOUTUBE, TIKTOK, LINKEDIN, PINTEREST;
5 | }
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/Principal.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.proyectop2g;
2 |
3 | public class Principal {
4 | public static void main(final String[] args) {
5 | App.main(args);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/SectorCubierto.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | import java.io.Serializable;
4 |
5 | public enum SectorCubierto implements Serializable{
6 | ALIMENTACION, EDUCACION, SALUD, VESTIMENTA;
7 | }
8 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/AppSocial.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | import java.io.Serializable;
4 |
5 | public enum AppSocial implements Serializable{
6 | TWITTER,FACEBOOK, INSTAGRAM, YOUTUBE, TIKTOK, LINKEDIN, PINTEREST;
7 | }
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | module com.mycompany.proyectop2g {
2 | requires javafx.controls;
3 | requires javafx.fxml;
4 | requires java.base;
5 |
6 | opens com.mycompany.proyectop2g to javafx.fxml;
7 | exports com.mycompany.proyectop2g;
8 | opens modelo.evento to javafx.base;
9 | opens modelo.participante to javafx.base;
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 | replay_pid*
25 | /target/
26 |
--------------------------------------------------------------------------------
/ProyectoP1G3/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst:
--------------------------------------------------------------------------------
1 | modelo\participante\Auspiciante.class
2 | modelo\participante\Persona.class
3 | modelo\evento\Feria.class
4 | modelo\participante\SectorCubierto.class
5 | modelo\participante\AuspicianteEnFeria.class
6 | modelo\participante\RedSocial.class
7 | modelo\evento\Stand.class
8 | modelo\participante\AppSocial.class
9 | ejecucion\Admin.class
10 | modelo\evento\SeccionStand.class
11 | modelo\evento\Sistema.class
12 | modelo\participante\Emprendedor.class
13 |
--------------------------------------------------------------------------------
/ProyectoP1G3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | com.mycompany
5 | Proyecto1Parcial
6 | 1.0-SNAPSHOT
7 | jar
8 |
9 | UTF-8
10 | 20
11 | 20
12 | proyecto1parcial.Proyecto1Parcial
13 |
14 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/evento/SeccionStand.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import java.util.ArrayList;
3 |
4 | public class SeccionStand {
5 | private int canStand;
6 | private ArrayList seccion;
7 |
8 | //Constructor
9 | public SeccionStand(int cs){
10 | canStand=cs;
11 | seccion=new ArrayList<>();
12 | }
13 |
14 | //Getters
15 | public int getCanStand(){
16 | return canStand;
17 | }
18 |
19 | public ArrayList getSeccion(){
20 | return seccion;
21 | }
22 |
23 | //Crear stands
24 | public void crearStands(int n){
25 | int num=1;
26 | String[] letra= {"A","B","C","D"};
27 | while(num<=canStand){
28 | String co= letra[n]+(String.valueOf(num));
29 | seccion.add(new Stand(co));
30 | num++;
31 | }
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/evento/SeccionStand.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import java.io.Serializable;
3 | import java.util.ArrayList;
4 |
5 | public class SeccionStand implements Serializable{
6 | private int canStand;
7 | private ArrayList seccion;
8 |
9 | //Constructor
10 | public SeccionStand(int cs){
11 | canStand=cs;
12 | seccion=new ArrayList<>();
13 | }
14 |
15 | //Getters
16 | public int getCanStand(){
17 | return canStand;
18 | }
19 |
20 | public ArrayList getSeccion(){
21 | return seccion;
22 | }
23 |
24 | //Crear stands
25 | public void crearStands(int n){
26 | int num=1;
27 | String[] letra= {"A","B","C","D"};
28 | while(num<=canStand){
29 | String co= letra[n]+(String.valueOf(num));
30 | seccion.add(new Stand(co));
31 | num++;
32 | }
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/Emprendedor.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | import java.util.ArrayList;
4 |
5 |
6 | public class Emprendedor extends Persona {
7 | private String descripcionServicios;
8 |
9 | //Getters y Setters
10 | public String getDescripcionServicios() {
11 | return descripcionServicios;
12 | }
13 |
14 | public void setDescripcionServicios(String descripcionServicios) {
15 | this.descripcionServicios = descripcionServicios;
16 | }
17 |
18 | public Emprendedor(String numld, String nombrePer, int telefono, String email, String npr, String d, String sw, ArrayList rd, String ds) {
19 | super(numld, nombrePer, telefono, email);
20 | setOtherParams(npr,d,sw,rd);
21 | descripcionServicios=ds;
22 | //Constructor con los atributos heredados de Persona.
23 | }
24 |
25 | @Override
26 | public String toString(){
27 | return super.toString()+"\nDescripcion de los servicios: "+descripcionServicios;
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.proyectop2g;
2 |
3 | import javafx.application.Application;
4 | import javafx.fxml.FXMLLoader;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 |
9 | import java.io.IOException;
10 |
11 | /**
12 | * JavaFX App
13 | */
14 | public class App extends Application {
15 |
16 | private static Scene scene;
17 |
18 | @Override
19 | public void start(Stage stage) throws IOException {
20 | scene = new Scene(loadFXML("/com/mycompany/proyectop2g/MenuFXML"), 730, 555);
21 | stage.setScene(scene);
22 | stage.show();
23 | }
24 |
25 | public static void setRoot(String fxml) throws IOException {
26 | scene.setRoot(loadFXML(fxml));
27 | }
28 |
29 | private static Parent loadFXML(String fxml) throws IOException {
30 | FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
31 | return fxmlLoader.load();
32 | }
33 |
34 | public static void main(String[] args) {
35 | launch();
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/ProyectoP2G3/nb-configuration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 | true
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/RedSocial.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | public class RedSocial {
4 | private AppSocial appsocial;
5 | private String cuenta;
6 |
7 | //Constructor
8 | public RedSocial(AppSocial a, String c){
9 | appsocial=a;
10 | cuenta=c;
11 | }
12 |
13 | //Getters y Setters
14 | public AppSocial getAppSocial(){
15 | return appsocial;
16 | }
17 |
18 | public String getCuenta(){
19 | return cuenta;
20 | }
21 |
22 | public void setAppsocial(AppSocial ap){
23 | appsocial=ap;
24 | }
25 |
26 | public void setCuenta(String c){
27 | cuenta=c;
28 | }
29 |
30 |
31 |
32 | //mostar menu de redes sociales
33 | public static void mostrarMenu(){
34 | System.out.println("Redes Sociales que maneja (elegir): ");
35 | System.out.println("1. Twitter");
36 | System.out.println("2. Facebook");
37 | System.out.println("3. Instagram");
38 | System.out.println("4. Youtube");
39 | System.out.println("5. Tiktok");
40 | System.out.println("6. Linkedln");
41 | System.out.println("7. Pinterest");
42 | System.out.println("8. Salir");
43 | System.out.println("Elegir una opción: ");
44 |
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/ProyectoP1G3/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst:
--------------------------------------------------------------------------------
1 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\Emprendedor.java
2 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\evento\Sistema.java
3 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\evento\Feria.java
4 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\RedSocial.java
5 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\AppSocial.java
6 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\evento\Stand.java
7 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\AuspicianteEnFeria.java
8 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\evento\SeccionStand.java
9 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\SectorCubierto.java
10 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\ejecucion\Admin.java
11 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\Auspiciante.java
12 | C:\Users\User\Documents\MARCIA PROYECTO POO\POO-2S2023-1PG3\src\main\java\modelo\participante\Persona.java
13 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/Emprendedor.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | import java.util.ArrayList;
4 | import modelo.evento.Sistema;
5 |
6 |
7 | public class Emprendedor extends Persona {
8 | private String descripcionServicios;
9 |
10 | //Getters y Setters
11 | public String getDescripcionServicios() {
12 | return descripcionServicios;
13 | }
14 |
15 | public void setDescripcionServicios(String descripcionServicios) {
16 | this.descripcionServicios = descripcionServicios;
17 | }
18 |
19 | public Emprendedor(String numld, String nombrePer, int telefono, String email, String npr, String d, String sw, ArrayList rd, String ds) {
20 | super(numld, nombrePer, telefono, email);
21 | setOtherParams(npr,d,sw,rd);
22 | descripcionServicios=ds;
23 | //Constructor con los atributos heredados de Persona.
24 | }
25 |
26 | // validar cedula o ruc
27 | public static boolean verificarCedula(String cedu){
28 | boolean validar= false;
29 | for (Emprendedor emp : Sistema.emprendedores){
30 | if (emp.numId.contains(cedu)){
31 | validar = true;
32 | }
33 | }
34 | return validar;
35 | }
36 |
37 | @Override
38 | public String toString(){
39 | return super.toString()+"\nDescripcion de los servicios: "+descripcionServicios;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ProyectoP2G3/nbactions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | run
5 |
6 | jar
7 |
8 |
9 | clean
10 | javafx:run
11 |
12 |
13 |
14 | debug
15 |
16 | clean
17 | javafx:run@ide-debug
18 |
19 |
20 | true
21 |
22 |
23 |
24 | profile
25 |
26 | clean
27 | javafx:run@ide-profile
28 |
29 |
30 |
31 | CUSTOM-jlink
32 | jlink
33 |
34 | clean
35 |
36 | compile
37 | javafx:jlink
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/RedSocial.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 |
3 | import java.io.Serializable;
4 |
5 | public class RedSocial implements Serializable{
6 | private AppSocial appsocial;
7 | private String cuenta;
8 |
9 | //Constructor
10 | public RedSocial(AppSocial a, String c){
11 | appsocial=a;
12 | cuenta=c;
13 | }
14 |
15 | //Getters y Setters
16 | public AppSocial getAppSocial(){
17 | return appsocial;
18 | }
19 |
20 | public String getCuenta(){
21 | return cuenta;
22 | }
23 |
24 | public void setAppsocial(AppSocial ap){
25 | appsocial=ap;
26 | }
27 |
28 | public void setCuenta(String c){
29 | cuenta=c;
30 | }
31 |
32 |
33 |
34 | //mostar menu de redes sociales
35 | public static void mostrarMenu(){
36 | System.out.println("Redes Sociales que maneja (elegir): ");
37 | System.out.println("1. Twitter");
38 | System.out.println("2. Facebook");
39 | System.out.println("3. Instagram");
40 | System.out.println("4. Youtube");
41 | System.out.println("5. Tiktok");
42 | System.out.println("6. Linkedln");
43 | System.out.println("7. Pinterest");
44 | System.out.println("8. Salir");
45 | System.out.println("Elegir una opción: ");
46 |
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/AuspicianteEnFeria.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 | import modelo.evento.*;
3 |
4 | public class AuspicianteEnFeria {
5 | private Auspiciante auspiciante;
6 | private String descripcion;
7 | private boolean tieneStand;
8 |
9 | //Constructor
10 | public AuspicianteEnFeria(Auspiciante a, String d, boolean ts){
11 | auspiciante=a;
12 | descripcion=d;
13 | tieneStand=ts;
14 | }
15 |
16 | //Getters y Setters
17 | public Auspiciante getAuspiciante(){
18 | return auspiciante;
19 | }
20 |
21 | public String getDescripcion(){
22 | return descripcion;
23 | }
24 |
25 | public boolean getTieneStand(){
26 | return tieneStand;
27 | }
28 |
29 | public void setDescripcion(String d){
30 | descripcion=d;
31 | }
32 |
33 | public void setTieneStand(boolean ts){
34 | tieneStand=ts;
35 | }
36 | // 3.3 Asignar Auspiciante en la Feria
37 | public static boolean verificarAuspicianteFeria(String c, String nc){
38 | Persona encPer = Sistema.encontrarPersona(nc);
39 | if(encPer!=null && encPer instanceof Auspiciante){
40 | Feria encFeria = Sistema.encontrarFeria(c);
41 | return encFeria != null;
42 | }
43 | return false;
44 | }
45 |
46 |
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/Auspiciante.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 | import java.util.ArrayList;
3 | import modelo.evento.*;
4 |
5 |
6 | public class Auspiciante extends Persona{
7 | private SectorCubierto secCubierto;
8 |
9 | //Constructor
10 |
11 | public Auspiciante(String ni, String np, String npr, int t, String e, String d, String sw, ArrayList rs, SectorCubierto sc){
12 | super(ni,np,t,e);
13 | super.setOtherParams(npr, d, sw, rs );
14 | secCubierto=sc;
15 | }
16 |
17 | //Getters y Setters
18 | public SectorCubierto getSectorCubierto(){
19 | return secCubierto;
20 | }
21 |
22 | public void setSectorCubierto(SectorCubierto sc){
23 | secCubierto=sc;
24 | }
25 | // validar cedula o ruc
26 | public static boolean verificarCedula(String cedu){
27 | boolean validar= false;
28 | for (Auspiciante auspican : Sistema.auspiciantes){
29 | if (auspican.numId.contains(cedu)){
30 | validar = true;
31 | }
32 | }
33 | return validar;
34 | }
35 |
36 | // Mostrar nombres de los Auspiciante
37 | public static void mostrarAuspiciante(){
38 | for (Auspiciante auspi: Sistema.auspiciantes ){
39 | System.out.println(auspi.nombre);
40 | }
41 | }
42 | //3.2 Todos los metodos para editar el auspiciante
43 | @Override
44 | public String toString(){ // Para mostrar los campos actuales antes de editar
45 | return super.toString()+"\nSector Cubierto: "+secCubierto;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/Auspiciante.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 | import java.util.ArrayList;
3 | import modelo.evento.*;
4 |
5 |
6 | public class Auspiciante extends Persona{
7 | private SectorCubierto secCubierto;
8 |
9 | //Constructor.
10 |
11 | public Auspiciante(String ni, String np, String npr, int t, String e, String d, String sw, ArrayList rs, SectorCubierto sc){
12 | super(ni,np,t,e);
13 | super.setOtherParams(npr, d, sw, rs );
14 | secCubierto=sc;
15 | }
16 |
17 | //Getters y Setters
18 | public SectorCubierto getSectorCubierto(){
19 | return secCubierto;
20 | }
21 |
22 | public void setSectorCubierto(SectorCubierto sc){
23 | secCubierto=sc;
24 | }
25 | // validar cedula o ruc
26 | public static boolean verificarCedula(String cedu){
27 | boolean validar= false;
28 | for (Auspiciante auspican : Sistema.auspiciantes){
29 | if (auspican.numId.contains(cedu)){
30 | validar = true;
31 | }
32 | }
33 | return validar;
34 | }
35 |
36 | // Mostrar nombres de los Auspiciante
37 | public static void mostrarAuspiciante(){
38 | for (Auspiciante auspi: Sistema.auspiciantes ){
39 | System.out.println(auspi.nombre);
40 | }
41 | }
42 | //3.2 Todos los metodos para editar el auspiciante
43 | @Override
44 | public String toString(){ // Para mostrar los campos actuales antes de editar
45 | return super.toString()+"\nSector Cubierto: "+secCubierto;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/participante/AuspicianteEnFeria.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 | import java.io.Serializable;
3 | import modelo.evento.*;
4 |
5 | public class AuspicianteEnFeria implements Serializable{
6 | private Auspiciante auspiciante;
7 | private String descripcion;
8 | private boolean tieneStand;
9 | private Feria feria;
10 |
11 | //Constructor
12 | public AuspicianteEnFeria(Feria f, Auspiciante a, String d, boolean ts){
13 | auspiciante=a;
14 | descripcion=d;
15 | tieneStand=ts;
16 | feria=f;
17 | }
18 |
19 | //Getters y Setters
20 | public Auspiciante getAuspiciante(){
21 | return auspiciante;
22 | }
23 |
24 | public String getDescripcion(){
25 | return descripcion;
26 | }
27 |
28 | public boolean getTieneStand(){
29 | return tieneStand;
30 | }
31 | public Feria getFeria(){
32 | return feria;
33 | }
34 | public void setDescripcion(String d){
35 | descripcion=d;
36 | }
37 |
38 | public void setTieneStand(boolean ts){
39 | tieneStand=ts;
40 | }
41 | public void setFeria(Feria f){
42 | feria=f;
43 | }
44 | // 3.3 Asignar Auspiciante en la Feria
45 | public static boolean verificarAuspicianteFeria(String c, String nc){
46 | Persona encPer = Sistema.encontrarPersona(nc);
47 | if(encPer!=null && encPer instanceof Auspiciante){
48 | Feria encFeria = Sistema.encontrarFeria(c);
49 | return encFeria != null;
50 | }
51 | return false;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/evento/Stand.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import modelo.participante.*;
3 |
4 | public class Stand {
5 | private String codigoSt;
6 | private Persona persona;
7 | private String fechaAsig;
8 |
9 | //Constructor
10 | public Stand(String cs){
11 | codigoSt=cs;
12 | }
13 |
14 | //Getters y Setters
15 | public String getCodigoSt(){
16 | return codigoSt;
17 | }
18 |
19 | public Persona getPersona(){
20 | return persona;
21 | }
22 |
23 | public String getFechaAsig(){
24 | return fechaAsig;
25 | }
26 |
27 | public void setcodigoSt(String co){
28 | codigoSt=co;
29 | }
30 |
31 | public void setPersona(Persona p){
32 | persona=p;
33 | }
34 |
35 | public void setFechaAsig(String f){
36 | fechaAsig=f;
37 | }
38 |
39 | //Metodo toString
40 | @Override
41 | public String toString(){
42 | char cod1= codigoSt.charAt(0);
43 | char cod2= codigoSt.charAt(1);
44 | String pers="";
45 | if(persona instanceof Auspiciante){pers="(Auspiciante):";}
46 | if(persona instanceof Emprendedor){pers="(Emprendedor):";}
47 | return "Codigo: "+String.valueOf(cod1)+String.valueOf(cod2)+"\nfecha de asignacion: "+fechaAsig
48 | +"\nOcupado por "+pers+"\n"+persona.toString();
49 | }
50 |
51 | //Informacion del stand
52 | public void verInformacionStand(){
53 | if(persona!=null){
54 | System.out.println(this.toString());
55 | }else System.out.println("Este stand no tiene a nadie asignado");
56 | }
57 |
58 | //Validar si el stand esta disponible
59 | public boolean estaDisponible(){
60 | if(codigoSt.length()==3){ //Ya que con * serían 3 caracteres
61 | return false;
62 | }return true;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/evento/Stand.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import java.io.Serializable;
3 | import java.time.LocalDate;
4 | import modelo.participante.*;
5 |
6 | public class Stand implements Serializable{
7 | private String codigoSt;
8 | private Persona persona;
9 | private LocalDate fechaAsig;
10 |
11 | //Constructor
12 | public Stand(String cs){
13 | codigoSt=cs;
14 | }
15 |
16 | //Getters y Setters
17 | public String getCodigoSt(){
18 | return codigoSt;
19 | }
20 |
21 | public Persona getPersona(){
22 | return persona;
23 | }
24 |
25 | public LocalDate getFechaAsig(){
26 | return fechaAsig;
27 | }
28 |
29 | public void setcodigoSt(String co){
30 | codigoSt=co;
31 | }
32 |
33 | public void setPersona(Persona p){
34 | persona=p;
35 | }
36 |
37 | public void setFechaAsig(LocalDate f){
38 | fechaAsig=f;
39 | }
40 |
41 | //Metodo toString
42 | @Override
43 | public String toString(){
44 | char cod1= codigoSt.charAt(0);
45 | char cod2= codigoSt.charAt(1);
46 | String pers="";
47 | if(persona instanceof Auspiciante){pers="(Auspiciante):";}
48 | if(persona instanceof Emprendedor){pers="(Emprendedor):";}
49 | return "Codigo: "+String.valueOf(cod1)+String.valueOf(cod2)+"\nfecha de asignacion: "+fechaAsig
50 | +"\nOcupado por "+pers+"\n"+persona.toString();
51 | }
52 |
53 | //Informacion del stand
54 | public void verInformacionStand(){
55 | if(persona!=null){
56 | System.out.println(this.toString());
57 | }else System.out.println("Este stand no tiene a nadie asignado");
58 | }
59 |
60 | //Validar si el stand esta disponible
61 | public boolean estaDisponible(){
62 | if(codigoSt.length()==3){ //Ya que con * serían 3 caracteres
63 | return false;
64 | }return true;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/evento/Sistema.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import modelo.participante.*;
3 | import java.util.ArrayList;
4 |
5 | public class Sistema{
6 | public static ArrayList ferias =new ArrayList<>();
7 | public static ArrayList auspiciantes= new ArrayList<>();
8 | public static ArrayList emprendedores= new ArrayList<>();
9 |
10 | //Registrar feria
11 | public static void registrarFeria(String n, String fi, String ff, String l, String d, String h,
12 | int can1, int can2, int can3, int can4){
13 | String c= "F"+String.valueOf(ferias.size()+1);
14 | Feria feria= new Feria(c,n,fi,ff,l,d,h);
15 | ferias.add(feria);
16 | feria.AsignarSeccionesStand(can1, can2, can3, can4);
17 | System.out.println("Feria registrada con exito!");
18 | System.out.println("El codigo de la feria es "+c);
19 | }
20 |
21 | //Buscar feria por codigo
22 | public static Feria encontrarFeria(String c){
23 | if(ferias.size()!=0){
24 | for(Feria f: ferias){
25 | if(c.equals(f.getCodigo())) return f;
26 | }
27 | }
28 | return null;
29 | }
30 |
31 | //Buscar persona por numero de identificacion
32 | public static Persona encontrarPersona(String c){
33 | if(emprendedores.size()!=0){
34 | for(Emprendedor e: emprendedores){
35 | if(e.getNumId().equals(c)) return e;
36 | }
37 | }
38 | if(auspiciantes.size()!=0){
39 | for(Auspiciante a: auspiciantes){
40 | if(a.getNumId().equals(c)) return a;
41 | }
42 | }
43 | return null;
44 | }
45 |
46 | //Registra un emprendedor si no se encuentra allí.
47 | public static void registrarEmp(Persona p) {
48 | Emprendedor emp=(Emprendedor)p;
49 | if(Sistema.emprendedores.size()!=0){
50 | for (int e=0; e
2 |
3 |
4 | run
5 |
6 | jar
7 |
8 |
9 | process-classes
10 | org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
11 |
12 |
13 |
14 | ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}
15 |
16 | ejecucion.Admin
17 | java
18 |
19 |
20 |
21 | debug
22 |
23 | jar
24 |
25 |
26 | process-classes
27 | org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
28 |
29 |
30 | -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}
31 | ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}
32 |
33 | ejecucion.Admin
34 | java
35 | true
36 |
37 |
38 |
39 | profile
40 |
41 | jar
42 |
43 |
44 | process-classes
45 | org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
46 |
47 |
48 |
49 | ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}
50 | ejecucion.Admin
51 | java
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/styles/estilos.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Empty Stylesheet file.
3 | */
4 |
5 | .mainFxmlClass {
6 |
7 | }
8 |
9 |
10 | .fondo{
11 | -fx-background-color: #78DAC9;
12 | -fx-alignment: CENTER;
13 | }
14 |
15 | .botones{
16 | -fx-alignment:CENTER;
17 | -fx-button-alignment: CENTER;
18 | }
19 |
20 | .encabezado{
21 | -fx-alignment:CENTER;
22 | }
23 |
24 | .titulo{
25 | -fx-background-radius:40px;
26 | -fx-background-color: #FF5E1B;
27 | -fx-alignment:CENTER;
28 | -fx-text-fill: white;
29 | -fx-padding:10;
30 | -fx-font-size: 24;
31 | -fx-font-family: "Poor Richard";
32 | }
33 |
34 | .datos{
35 | -fx-font-size:14;
36 | -fx-font-family:"Arial";
37 | -fx-underline:true;
38 | -fx-padding:5;
39 | }
40 |
41 | .datosSeccion{
42 | -fx-font-size:16;
43 | -fx-font-family: "Poor Richard";
44 | -fx-padding:5;
45 | -fx-background-color: white;
46 | -fx-background-radius: 7;
47 | }
48 |
49 | .labelFeria{
50 | -fx-font-family: "Poor Richard";
51 | -fx-font-size:24;
52 | -fx-background-color: white;
53 | -fx-padding:3;
54 | -fx-background-radius:10px;
55 | }
56 |
57 | .checkbox{
58 | -fx-padding:5;
59 | }
60 |
61 | .segundaVentana{
62 | -fx-background-color: #FCD6D6;
63 | -fx-padding:5;
64 | -fx-alignment:CENTER;
65 | }
66 |
67 | .requerido{
68 | -fx-text-fill: red;
69 | }
70 |
71 | .estilo_botones{
72 | -fx-background-color: #8FF9FB;
73 | -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.3),5,0,5,0);
74 | -fx-font-family: "Impact";
75 | -fx-font-size:14;
76 | }
77 |
78 | .estilo_botones2{
79 | -fx-background-color: #FF7A7A;
80 | -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.3),5,0,5,0);
81 | -fx-font-family: "Garlic";
82 | -fx-text-fill:white;
83 | -fx-background-radius:30px;
84 | -fx-font-size:12px;
85 | -fx-border-color:white;
86 | -fx-border-radius: 30px;
87 | -fx-border-width: 2px;
88 | -fx-alignment: CENTER;
89 | -fx-pref-height: 47px;
90 | }
91 | .table-view{
92 | -fx-background-color:#FBF9C7;
93 | -fx-table-cell-border-color: black;
94 | -fx-border-color:black;
95 | -fx-table-header-border-color: black;
96 | }
97 |
98 | .table-column{
99 | -fx-background-color:#FBF9C7;
100 | }
101 | .table-roll-cell{
102 | -fx-border-color: black;
103 | }
104 | .table-view .column-header{
105 | -fx-border-color: black;
106 | }
107 | .custom-cell {
108 |
109 | -fx-text-fill: black;
110 | -fx-background-color:transparent;
111 | }
112 | .custom-cell:selected{
113 | -fx-control-inner-background-alt: derive(-fx-base, 20%);
114 | }
115 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/AdmEmprendedorController.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.proyectop2g;
2 |
3 | import java.net.URL;
4 | import java.util.ResourceBundle;
5 | import javafx.fxml.Initializable;
6 | import javafx.fxml.*;
7 | import javafx.scene.image.ImageView;
8 | import java.io.*;
9 | import java.util.ArrayList;
10 | import javafx.beans.property.SimpleStringProperty;
11 | import javafx.beans.property.SimpleIntegerProperty;
12 | import javafx.scene.control.Button;
13 | import javafx.scene.control.TableColumn;
14 | import javafx.scene.control.TableView;
15 | import modelo.evento.Sistema;
16 | import modelo.participante.*;
17 |
18 | /**
19 | * FXML Controller class
20 | *
21 | * @author USER
22 | */
23 | public class AdmEmprendedorController implements Initializable {
24 |
25 | @FXML
26 | private ImageView regresar;
27 | @FXML
28 | private Button crearEmp;
29 | @FXML
30 | private TableView tblEmp;
31 | @FXML
32 | private TableColumn colCedula;
33 | @FXML
34 | private TableColumn colNombre;
35 | @FXML
36 | private TableColumn colTelefono;
37 | @FXML
38 | private TableColumn colEmail;
39 |
40 | private ArrayList emprendedores;
41 |
42 |
43 | /**
44 | * Initializes the controller class.
45 | */
46 | @Override
47 | public void initialize(URL url, ResourceBundle rb) {
48 | emprendedores = Sistema.emprendedores;
49 | colCedula.setCellValueFactory( data -> {
50 | String value = data.getValue().getNumId();
51 | return new SimpleStringProperty(value);
52 | });
53 | colNombre.setCellValueFactory( data -> {
54 | String value = data.getValue().getNombre();
55 | return new SimpleStringProperty(value);
56 | });
57 | colTelefono.setCellValueFactory(data -> {
58 | int value = data.getValue().getTelefono();
59 | return new SimpleIntegerProperty(value).asObject();
60 | });
61 | colEmail.setCellValueFactory( data -> {
62 | String value = data.getValue().getEmail();
63 | return new SimpleStringProperty(value);
64 | });
65 | if(!Sistema.emprendedores.isEmpty() ){
66 | tblEmp.getItems().addAll(emprendedores);
67 |
68 | }
69 | }
70 | // TODO
71 |
72 |
73 | @FXML
74 | private void menuPrincipal() throws IOException{
75 | App.setRoot("/com/mycompany/proyectop2g/MenuFXML");
76 | }
77 |
78 | @FXML
79 | private void nuevoEmprendedor() throws IOException{
80 | App.setRoot("/com/mycompany/proyectop2g/AgregarEmp");
81 | }
82 |
83 | @FXML
84 | private void editarEmprendedor() throws IOException{
85 | App.setRoot("/com/mycompany/proyectop2g/EditarEmp");
86 | }
87 |
88 |
89 | }
90 |
91 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/MenuFXMLController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3 | * Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMLController.java to edit this template
4 | */
5 | package com.mycompany.proyectop2g;
6 |
7 | import java.io.*;
8 | import java.net.URL;
9 | import java.util.ResourceBundle;
10 | import javafx.fxml.FXML;
11 | import javafx.fxml.Initializable;
12 | import javafx.scene.control.Button;
13 | import javafx.scene.input.MouseEvent;
14 | import javafx.scene.layout.VBox;
15 | import com.mycompany.proyectop2g.*;
16 | import com.mycompany.proyectop2g.App;
17 | import javafx.scene.control.Alert;
18 | import javafx.scene.control.ButtonType;
19 | import javafx.stage.Stage;
20 | import modelo.evento.Sistema;
21 | /**
22 | * FXML Controller class
23 | *
24 | * @author User
25 | */
26 | public class MenuFXMLController implements Initializable {
27 |
28 | @FXML
29 | private VBox opcionesBox;
30 | @FXML
31 | private Button btnAdmFeria;
32 | @FXML
33 | private Button btnAdmEmprendedor;
34 | @FXML
35 | private Button btnAdmAusp;
36 | @FXML
37 | private Button btnAdmStand;
38 | @FXML
39 | private Button btnSalir;
40 |
41 | private static boolean soloUnaVez=true;
42 | /**
43 | * Initializes the controller class.
44 | */
45 |
46 | //Si existen datos guardados, estos se cargaran en la app
47 | @Override
48 | public void initialize(URL url, ResourceBundle rb) {
49 | if(soloUnaVez==true) {
50 | Sistema.cargarDatos();
51 | soloUnaVez=false;
52 | }
53 | }
54 |
55 | @FXML
56 | private void administrarFeria(MouseEvent event) throws IOException {
57 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
58 | }
59 |
60 | @FXML
61 | private void administrarEmpr(MouseEvent event) throws IOException{
62 | App.setRoot("/com/mycompany/proyectop2g/admEmprendedor");
63 | }
64 |
65 | @FXML
66 | private void administrarAusp() throws IOException {
67 | App.setRoot("/com/mycompany/proyectop2g/admAuspiciante");
68 | }
69 |
70 | //Al salir de la app se valida si se desea guardar los datos o no
71 | @FXML
72 | private void salirMenu(MouseEvent event){
73 | Alert alerta= new Alert(Alert.AlertType.CONFIRMATION);
74 | alerta.setTitle("Aviso");
75 | alerta.setHeaderText("Guardar los datos de la administracion");
76 | alerta.setContentText("¿Desea guardar?");
77 | ButtonType botonSi = new ButtonType("Sí");
78 | ButtonType botonNo = new ButtonType("No");
79 | alerta.getButtonTypes().setAll(botonSi, botonNo);
80 | alerta.showAndWait().ifPresent(response -> {
81 | if (response == botonSi) {
82 | Sistema.guardarDatos();
83 | Stage stage= (Stage) btnSalir.getScene().getWindow();
84 | stage.close();
85 | }else if(response == botonNo){
86 | Stage stage= (Stage) btnSalir.getScene().getWindow();
87 | stage.close();
88 | }
89 | });
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/MenuFXML.fxml:
--------------------------------------------------------------------------------
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 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
44 |
52 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/participante/Persona.java:
--------------------------------------------------------------------------------
1 | package modelo.participante;
2 | import java.util.ArrayList;
3 |
4 | public class Persona {
5 | protected String numId;
6 | protected String nombre;
7 | protected String nomPerRes;
8 | protected int telefono;
9 | protected String email;
10 | protected String direccion;
11 | protected String sitioWeb;
12 | protected ArrayList redesSociales;
13 |
14 | //Getters and setters
15 | public String getNumId() {
16 | return numId;
17 | }
18 |
19 | public String getNomPerRes() {
20 | return nomPerRes;
21 | }
22 |
23 | public int getTelefono() {
24 | return telefono;
25 | }
26 |
27 | public String getEmail() {
28 | return email;
29 | }
30 |
31 | public String getDireccion() {
32 | return direccion;
33 | }
34 |
35 | public String getSitioWeb() {
36 | return sitioWeb;
37 | }
38 |
39 | public String getNombre(){
40 | return nombre;
41 | }
42 |
43 | public ArrayList getRedesSociales() {
44 | return redesSociales;
45 | }
46 |
47 | public void setNomPerRes(String nomPerRes) {
48 | this.nomPerRes = nomPerRes;
49 | }
50 |
51 | public void setDireccion(String direccion) {
52 | this.direccion = direccion;
53 | }
54 |
55 | public void setSitioWeb(String sitioWeb) {
56 | this.sitioWeb = sitioWeb;
57 | }
58 |
59 | public void setRedesSociales(ArrayList redesSociales) {
60 | this.redesSociales = redesSociales;
61 | }
62 |
63 | public void setTelefono(int telefono) {
64 | this.telefono = telefono;
65 | }
66 |
67 | public void setNumId(String numId) {
68 | this.numId = numId;
69 | }
70 |
71 | public void setNombre(String nombre) {
72 | this.nombre = nombre;
73 | }
74 |
75 | public void setEmail(String email) {
76 | this.email = email;
77 | }
78 |
79 |
80 | public Persona(String numId, String nombre, int telefono, String email) {
81 | //Se crea un constructor para la clase Persona con las variables que se consideran más importantes.
82 | this.numId=numId;
83 | this.nombre=nombre;
84 | this.telefono=telefono;
85 | this.email=email;
86 | }
87 |
88 | public void setOtherParams(String nomPerRes, String direccion, String sitioWeb, ArrayList redesSociales) {
89 | //Se crea un método para la clase Persona con las variables que faltaban en el constructor anterior.
90 | this.setNomPerRes(nomPerRes);
91 | this.setDireccion(direccion);
92 | this.setSitioWeb(sitioWeb);
93 | this.setRedesSociales(redesSociales);
94 |
95 | }
96 |
97 | //Metodo toString
98 | @Override
99 | public String toString(){
100 | String cad="[";
101 | for(int j=0;j redesSociales;
14 |
15 | //Getters and setters
16 | public String getNumId() {
17 | return numId;
18 | }
19 |
20 | public String getNomPerRes() {
21 | return nomPerRes;
22 | }
23 |
24 | public int getTelefono() {
25 | return telefono;
26 | }
27 |
28 | public String getEmail() {
29 | return email;
30 | }
31 |
32 | public String getDireccion() {
33 | return direccion;
34 | }
35 |
36 | public String getSitioWeb() {
37 | return sitioWeb;
38 | }
39 |
40 | public String getNombre(){
41 | return nombre;
42 | }
43 |
44 | public ArrayList getRedesSociales() {
45 | return redesSociales;
46 | }
47 |
48 | public void setNomPerRes(String nomPerRes) {
49 | this.nomPerRes = nomPerRes;
50 | }
51 |
52 | public void setDireccion(String direccion) {
53 | this.direccion = direccion;
54 | }
55 |
56 | public void setSitioWeb(String sitioWeb) {
57 | this.sitioWeb = sitioWeb;
58 | }
59 |
60 | public void setRedesSociales(ArrayList redesSociales) {
61 | this.redesSociales = redesSociales;
62 | }
63 |
64 | public void setTelefono(int telefono) {
65 | this.telefono = telefono;
66 | }
67 |
68 | public void setNumId(String numId) {
69 | this.numId = numId;
70 | }
71 |
72 | public void setNombre(String nombre) {
73 | this.nombre = nombre;
74 | }
75 |
76 | public void setEmail(String email) {
77 | this.email = email;
78 | }
79 |
80 |
81 | public Persona(String numId, String nombre, int telefono, String email) {
82 | //Se crea un constructor para la clase Persona con las variables que se consideran más importantes.
83 | this.numId=numId;
84 | this.nombre=nombre;
85 | this.telefono=telefono;
86 | this.email=email;
87 | }
88 |
89 | public void setOtherParams(String nomPerRes, String direccion, String sitioWeb, ArrayList redesSociales) {
90 | //Se crea un método para la clase Persona con las variables que faltaban en el constructor anterior.
91 | this.setNomPerRes(nomPerRes);
92 | this.setDireccion(direccion);
93 | this.setSitioWeb(sitioWeb);
94 | this.setRedesSociales(redesSociales);
95 |
96 | }
97 |
98 | //Metodo toString
99 | @Override
100 | public String toString(){
101 | String cad="[";
102 | for(int j=0;j tblAuspiEnFeria;
34 |
35 | @FXML
36 | private TableColumn colFeria;
37 |
38 | @FXML
39 | private TableColumn colAuspiciante;
40 |
41 | @FXML
42 | private TableColumn colDescripcion;
43 |
44 | @FXML
45 | private TableColumn colStand;
46 |
47 | private ArrayList auspicianteEnFeria;
48 | private ArrayList ferias;
49 | private Auspiciante auspiciante;
50 | /**
51 | * Initializes the controller class.
52 | */
53 | @Override
54 | public void initialize(URL url, ResourceBundle rb) {
55 | ferias = Sistema.ferias;
56 | colFeria.setCellValueFactory( data -> {
57 | String value = data.getValue().getFeria().getNombre();
58 | return new SimpleStringProperty(value);
59 | });
60 | colAuspiciante.setCellValueFactory( data -> {
61 | String value = data.getValue().getAuspiciante().getNombre();
62 | return new SimpleStringProperty(value);
63 | });
64 | colDescripcion.setCellValueFactory(new PropertyValueFactory<>("descripcion"));
65 | colStand.setCellValueFactory(data -> {
66 | Boolean value = data.getValue().getTieneStand();
67 | String string; if(value){ string = "SI"; } else { string= "NO";}
68 | return new SimpleStringProperty(string);
69 | });
70 | if(ferias.size()!=0 && Sistema.auspiciantes.size()!=0 ){
71 | for (Feria f:ferias){
72 | if(f.getAuspiciantesEnFeria().size()!=0){
73 | tblAuspiEnFeria.getItems().addAll(f.getAuspiciantesEnFeria());
74 | }
75 | }
76 | }
77 |
78 |
79 | // TODO
80 | }
81 |
82 | @FXML
83 | private void menuPrincipal() throws IOException{
84 | App.setRoot("/com/mycompany/proyectop2g/MenuFXML");
85 | }
86 |
87 | @FXML
88 | private void nuevoAuspiciante() throws IOException{
89 | App.setRoot("/com/mycompany/proyectop2g/AgregarAuspi");
90 | }
91 |
92 | @FXML
93 | private void editarAuspiciante() throws IOException{
94 | App.setRoot("/com/mycompany/proyectop2g/EditarAuspi");
95 | }
96 |
97 | @FXML
98 | private void asignarAuspiciante() throws IOException{
99 | App.setRoot("/com/mycompany/proyectop2g/AsignarAuspi");
100 | }
101 |
102 | }
103 |
104 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/admEmprendedor.fxml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
57 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/evento/Sistema.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import java.io.FileInputStream;
3 | import java.io.FileOutputStream;
4 | import java.io.ObjectInputStream;
5 | import java.io.ObjectOutputStream;
6 | import java.io.Serializable;
7 | import java.time.LocalDate;
8 | import modelo.participante.*;
9 | import java.util.ArrayList;
10 |
11 | public class Sistema implements Serializable{
12 | public static ArrayList ferias =new ArrayList<>();
13 | public static ArrayList auspiciantes= new ArrayList<>();
14 | public static ArrayList emprendedores= new ArrayList<>();
15 |
16 | //Registrar feria
17 | public static Feria registrarFeria(String n, LocalDate fi, LocalDate ff, String l, String d, String h,
18 | int can1, int can2, int can3, int can4){
19 | String c= "F"+String.valueOf(ferias.size()+1);
20 | Feria feria= new Feria(c,n,fi,ff,l,d,h);
21 | ferias.add(feria);
22 | feria.AsignarSeccionesStand(can1, can2, can3, can4);
23 | //System.out.println("Feria registrada con exito!");
24 | //System.out.println("El codigo de la feria es "+c);
25 | return feria;
26 | }
27 |
28 | //Buscar feria por codigo
29 | public static Feria encontrarFeria(String c){
30 | if(ferias.size()!=0){
31 | for(Feria f: ferias){
32 | if(c.equals(f.getCodigo())) return f;
33 | }
34 | }
35 | return null;
36 | }
37 |
38 | //Buscar persona por numero de identificacion
39 | public static Persona encontrarPersona(String c){
40 | if(emprendedores.size()!=0){
41 | for(Emprendedor e: emprendedores){
42 | if(e.getNumId().equals(c)) return e;
43 | }
44 | }
45 | if(auspiciantes.size()!=0){
46 | for(Auspiciante a: auspiciantes){
47 | if(a.getNumId().equals(c)) return a;
48 | }
49 | }
50 | return null;
51 | }
52 |
53 | //Valida por ruc o ced, para que no se repita sin importar el tipo de persona
54 | public static boolean verificarCedula(String cedu){
55 | boolean validar= false;
56 | for(Auspiciante ausp : auspiciantes){
57 | if (ausp.getNumId().equals(cedu)){
58 | validar = true;
59 | }
60 | }
61 | for(Emprendedor emp : emprendedores){
62 | if (emp.getNumId().equals(cedu)){
63 | validar = true;
64 | }
65 | }
66 | return validar;
67 | }
68 |
69 | //Registra un emprendedor si no se encuentra allí.
70 | public static void registrarEmp(Persona p) {
71 | Emprendedor emp=(Emprendedor)p;
72 | if(Sistema.emprendedores.size()!=0){
73 | for (int e=0; e) objetosDes[0];
109 | emprendedores=(ArrayList) objetosDes[1];
110 | auspiciantes=(ArrayList) objetosDes[2];
111 | }catch(Exception e){
112 | System.out.println("Error al cargar datos: "+e.getMessage());
113 | }
114 | }
115 |
116 |
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/AsignarAuspiController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3 | * Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMLController.java to edit this template
4 | */
5 | package com.mycompany.proyectop2g;
6 |
7 | import java.net.URL;
8 | import java.util.ResourceBundle;
9 | import javafx.fxml.Initializable;
10 | import javafx.fxml.FXML;
11 | import java.io.*;
12 | import javafx.scene.control.Alert;
13 | import javafx.scene.control.TextField;
14 | import javafx.scene.control.Button;
15 | import javafx.scene.layout.VBox;
16 | import javafx.scene.control.CheckBox;
17 | import javafx.scene.control.TextArea;
18 | import modelo.evento.*;
19 | import modelo.participante.*;
20 | /**
21 | * FXML Controller class
22 | *
23 | * @author USER
24 | */
25 | public class AsignarAuspiController implements Initializable {
26 |
27 | /**
28 | * Initializes the controller class.
29 | */
30 |
31 | @FXML
32 | private TextField codigo;
33 | @FXML
34 | private TextField cedula;
35 | @FXML
36 | private Button buscarFeria;
37 | @FXML
38 | private VBox segundaVentana;
39 | @FXML
40 | private Button asignarAuspiciante;
41 | @FXML
42 | private TextArea descripcion;
43 | @FXML
44 | private CheckBox incluyeStand;
45 | private Auspiciante auspiciante;
46 | private Feria feria;
47 | @Override
48 | public void initialize(URL url, ResourceBundle rb) {
49 | buscarFeria.setOnAction(
50 | e -> {
51 | if (codigo.getText()!=null && cedula.getText()!=null){
52 | if(AuspicianteEnFeria.verificarAuspicianteFeria(codigo.getText(), cedula.getText())){
53 | feria = Sistema.encontrarFeria(codigo.getText());
54 | Persona p = Sistema.encontrarPersona(cedula.getText());
55 | auspiciante = (Auspiciante)p;
56 | boolean verif = Feria.verificarAuspiciante(feria.getAuspiciantesEnFeria(), auspiciante);
57 | if(!verif){
58 | segundaVentana.setVisible(true);
59 | } else { alertas_yaexiste(); cedula.setText(null); }
60 | } else { alertas_error(); cedula.setText(null); }
61 | }else { alertas_warning(); }
62 | } );
63 | asignarAuspiciante.setOnAction(
64 | e -> {
65 | if(descripcion.getText()!=null){
66 | AuspicianteEnFeria a = new AuspicianteEnFeria(feria, auspiciante, descripcion.getText(),incluyeStand.isSelected());
67 | feria.getAuspiciantesEnFeria().add(a);
68 | alertas_informacion();
69 | try {
70 | App.setRoot("admAuspiciante");
71 | } catch (IOException ex) {
72 | ex.printStackTrace();
73 | }
74 | }else {
75 | alertas_warning();
76 | }
77 | }
78 | );
79 |
80 | }
81 |
82 | @FXML
83 | private void admAuspiciante() throws IOException{
84 | App.setRoot("/com/mycompany/proyectop2g/admAuspiciante");
85 | }
86 |
87 | private void alertas_warning(){
88 | Alert alert = new Alert(Alert.AlertType.WARNING);
89 | alert.setTitle("Warning Dialog");
90 | alert.setHeaderText("Label Vacio");
91 | alert.setContentText("El label está vacio");
92 | alert.showAndWait();
93 | }
94 |
95 | private void alertas_yaexiste(){
96 | Alert alert = new Alert(Alert.AlertType.WARNING);
97 | alert.setTitle("Warning Dialog");
98 | alert.setHeaderText("Auspiciante encontrado");
99 | alert.setContentText("El auspiciante ya está asignando en la feria. ");
100 | alert.showAndWait();
101 | }
102 |
103 | private void alertas_error(){
104 | Alert alert = new Alert(Alert.AlertType.ERROR);
105 | alert.setTitle("Error Dialog");
106 | alert.setHeaderText("Feria o cedula no encontrada");
107 | alert.setContentText("Sus datos ingresados no fueron encontrados en nuestra base.");
108 | alert.showAndWait();
109 | }
110 |
111 | private void alertas_informacion(){
112 | Alert alert = new Alert(Alert.AlertType.INFORMATION);
113 | alert.setTitle("Information Dialog");
114 | alert.setHeaderText("Datos ingresados");
115 | alert.setContentText("El auspicio de "+ auspiciante.getNombre()+" fue ingresado a la feria "+ feria.getNombre());
116 | alert.showAndWait();
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/datosFeria.fxml:
--------------------------------------------------------------------------------
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 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/admStand.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
28 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
55 |
56 |
57 |
58 |
59 |
63 |
64 |
65 |
66 |
67 |
71 |
72 |
73 |
74 |
75 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/admAuspiciante.fxml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
67 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/ProyectoP2G3/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | com.mycompany
5 | ProyectoP2G3
6 | 1.0-SNAPSHOT
7 |
8 | UTF-8
9 | 11
10 | 11
11 |
12 |
13 |
14 | org.openjfx
15 | javafx-controls
16 | 20
17 |
18 |
19 | org.openjfx
20 | javafx-fxml
21 | 20
22 |
23 |
24 |
25 |
26 |
27 | org.apache.maven.plugins
28 | maven-compiler-plugin
29 | 3.8.0
30 |
31 | 11
32 | true
33 |
34 |
35 |
36 | org.openjfx
37 | javafx-maven-plugin
38 | 0.0.4
39 |
40 | com.mycompany.proyectop2g.App
41 |
42 |
43 |
44 |
45 |
46 | default-cli
47 |
48 |
49 |
50 |
51 | debug
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | ide-debug
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | ide-profile
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | org.apache.maven.plugins
88 | maven-jar-plugin
89 | 3.1.0
90 |
91 |
92 |
93 | true
94 | com.mycompany.proyectop2g.Principal
95 |
96 |
97 |
98 |
99 |
100 | maven-assembly-plugin
101 | 3.1.0
102 |
103 |
104 | jar-with-dependencies
105 |
106 |
107 |
108 | true
109 | com.mycompany.proyectop2g.Principal
110 |
111 |
112 |
113 |
114 |
115 | make-assembly
116 | package
117 |
118 | single
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | ProyectoP2G3
127 |
128 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/AsignarAuspi.fxml:
--------------------------------------------------------------------------------
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 |
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 |
82 |
83 |
84 |
85 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/admFeria.fxml:
--------------------------------------------------------------------------------
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 |
46 |
54 |
62 |
70 |
78 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/AgregarAuspiController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3 | * Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMLController.java to edit this template
4 | */
5 | package com.mycompany.proyectop2g;
6 |
7 | import java.io.*;
8 | import java.net.URL;
9 | import java.util.ResourceBundle;
10 | import javafx.fxml.Initializable;
11 | import javafx.fxml.FXML;
12 | import javafx.scene.control.ComboBox;
13 | import javafx.scene.control.CheckBox;
14 | import javafx.scene.layout.BorderPane;
15 | import javafx.scene.control.Label;
16 | import javafx.scene.control.Button;
17 | import javafx.scene.control.TextField;
18 | import javafx.scene.control.Alert.AlertType;
19 | import javafx.scene.image.ImageView;
20 | import javafx.scene.control.ButtonType;
21 | import java.util.Optional;
22 | import modelo.participante.*;
23 | import java.util.ArrayList;
24 | import javafx.scene.control.Alert;
25 | import modelo.evento.*;
26 | /**
27 | * FXML Controller class
28 | *
29 | * @author USER
30 | */
31 | public class AgregarAuspiController implements Initializable {
32 | @FXML
33 | private ComboBox sectoresCubiertos;
34 | @FXML
35 | private BorderPane segundaVentana;
36 | @FXML
37 | private Label redSocial;
38 | @FXML
39 | private CheckBox twitter;
40 | @FXML
41 | private CheckBox facebook;
42 | @FXML
43 | private CheckBox instagram;
44 | @FXML
45 | private CheckBox youtube;
46 | @FXML
47 | private CheckBox tiktok;
48 | @FXML
49 | private CheckBox pinterest;
50 | @FXML
51 | private CheckBox linkedln;
52 | @FXML
53 | private TextField cuenta;
54 | @FXML
55 | private Button guardar;
56 |
57 | @FXML
58 | private TextField cedula;
59 | @FXML
60 | private TextField nombre;
61 | @FXML
62 | private TextField telefono;
63 | @FXML
64 | private TextField email;
65 | @FXML
66 | private TextField nombreRespo;
67 | @FXML
68 | private TextField direccion;
69 | @FXML
70 | private TextField sitioWeb;
71 | @FXML
72 | private Button CrearAuspiciante;
73 | @FXML
74 | private ImageView cerrarVentana;
75 |
76 | private String usuario="Ingrese el usuario de ";
77 |
78 | ArrayList redesSociales = new ArrayList<>();
79 | /**
80 | * Initializes the controller class.
81 | */
82 | @Override
83 | public void initialize(URL url, ResourceBundle rb) {
84 | sectoresCubiertos.getItems().setAll(SectorCubierto.values());
85 | twitter.setOnAction(e -> handleCheckBoxSelection(twitter, "Twitter"));
86 | facebook.setOnAction(e -> handleCheckBoxSelection(facebook, "Facebook"));
87 | instagram.setOnAction(e -> handleCheckBoxSelection(instagram, "Instagram"));
88 | youtube.setOnAction(e -> handleCheckBoxSelection(youtube, "Youtube"));
89 | tiktok.setOnAction(e -> handleCheckBoxSelection(tiktok, "Tiktok"));
90 | pinterest.setOnAction(e -> handleCheckBoxSelection(pinterest, "Pinterest"));
91 | linkedln.setOnAction(e -> handleCheckBoxSelection(linkedln, "Linkedin"));
92 | cedula.setText(null);
93 | telefono.setText(null);
94 | nombre.setText(null);
95 | nombreRespo.setText(null);
96 | email.setText(null);
97 | direccion.setText(null);
98 | sitioWeb.setText(null);
99 | CrearAuspiciante.setOnAction(e -> {
100 | try {
101 | guardarAuspiciante();
102 | } catch (IOException ex) {
103 | ex.printStackTrace();
104 | }
105 | });
106 | }
107 |
108 | @FXML
109 | private void admAuspiciante() throws IOException{
110 | App.setRoot("/com/mycompany/proyectop2g/admAuspiciante");
111 | }
112 |
113 | @FXML
114 | private void handleCheckBoxSelection(CheckBox checkbox, String c){
115 | if (checkbox.isSelected()) { infoRedSocial(checkbox, c); }
116 | else {
117 | Alert alert = new Alert(AlertType.CONFIRMATION);
118 | alert.setTitle("Confirmation Dialog");
119 | alert.setHeaderText("Eliminar una red Social");
120 | alert.setContentText("¿Estás seguro que quieres eliminar "+c+" ?");
121 | Optional result = alert.showAndWait();
122 | if (result.get() == ButtonType.OK){
123 | redesSociales.removeIf(rs -> rs.getAppSocial().equals(AppSocial.valueOf(c.toUpperCase())));
124 | alert.close();
125 | checkbox.setSelected(false);
126 | } else {
127 | checkbox.setSelected(true);
128 | alert.close();
129 | }
130 | }
131 | }
132 | @FXML
133 | private void infoRedSocial(CheckBox ch, String r){
134 | segundaVentana.setVisible(true);
135 | cuenta.setText(null);
136 | redSocial.setText(null);
137 | redSocial.setText(usuario+r+" :");
138 | guardar.setOnAction(
139 | e -> {
140 | if(cuenta.getText()== null){
141 | Alert alert = new Alert(AlertType.WARNING);
142 | alert.setTitle("Information Dialog");
143 | alert.setHeaderText("Label Vacio");
144 | alert.setContentText("Debes escribir tu cuenta de usuario!");
145 | alert.showAndWait();
146 | } else{
147 | String c = cuenta.getText();
148 | RedSocial rs1 = new RedSocial(AppSocial.valueOf(r.toUpperCase() ), c);
149 | redesSociales.add(rs1);
150 | segundaVentana.setVisible(false);
151 | }
152 | }
153 | );
154 | cerrarVentana.setOnMouseClicked(e -> {segundaVentana.setVisible(false); ch.setSelected(false);});
155 | }
156 |
157 | @FXML
158 | private void guardarAuspiciante() throws IOException{
159 | if (!Sistema.verificarCedula(cedula.getText())){
160 | if(cedula.getText()!= null && telefono.getText()!= null && email.getText()!=null
161 | && nombreRespo.getText()!=null && nombre.getText()!=null && sectoresCubiertos.getValue()!=null && !redesSociales.isEmpty()){
162 | try{
163 | int telef = Integer.parseInt(telefono.getText());
164 | Auspiciante a = new Auspiciante(cedula.getText(),nombre.getText(), nombreRespo.getText(), telef,email.getText(),
165 | direccion.getText(), sitioWeb.getText(), redesSociales, sectoresCubiertos.getValue() );
166 | Sistema.auspiciantes.add(a);
167 | Alert alert = new Alert(AlertType.INFORMATION);
168 | alert.setTitle("Information Dialog");
169 | alert.setHeaderText("Auspiciante");
170 | alert.setContentText("Hola "+nombre.getText()+" su auspicio fue registrada correctamente.");
171 | alert.showAndWait();
172 | admAuspiciante();
173 | }catch(Exception e){
174 | Alert alert = new Alert(AlertType.WARNING);
175 | alert.setTitle("Warning Dialog");
176 | alert.setHeaderText("Error en los datos");
177 | alert.setContentText("Los datos ingresados son invalidos");
178 | alert.showAndWait();
179 | }
180 | }else{
181 | Alert alert = new Alert(AlertType.WARNING);
182 | alert.setTitle("Warning Dialog");
183 | alert.setHeaderText("Label vacio");
184 | alert.setContentText("Complete todos los label requeridos");
185 | alert.showAndWait();
186 | }
187 | }else {
188 | Alert alert = new Alert(AlertType.WARNING);
189 | alert.setTitle("Warning Dialog");
190 | alert.setHeaderText("Label Cedula");
191 | alert.setContentText("Cedula ya existente");
192 | alert.showAndWait();
193 | }
194 | }
195 | }
196 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/AgregarEmpController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3 | * Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMLController.java to edit this template
4 | */
5 | package com.mycompany.proyectop2g;
6 |
7 | import java.io.*;
8 | import java.net.URL;
9 | import java.util.ResourceBundle;
10 | import javafx.fxml.Initializable;
11 | import javafx.fxml.FXML;
12 | import javafx.scene.control.CheckBox;
13 | import javafx.scene.layout.BorderPane;
14 | import javafx.scene.control.Label;
15 | import javafx.scene.control.Button;
16 | import javafx.scene.control.TextField;
17 | import javafx.scene.control.Alert.AlertType;
18 | import javafx.scene.control.ButtonType;
19 | import java.util.Optional;
20 | import modelo.participante.*;
21 | import java.util.ArrayList;
22 | import javafx.scene.control.Alert;
23 | import javafx.scene.image.ImageView;
24 | import modelo.evento.*;
25 | /**
26 | * FXML Controller class
27 | *
28 | * @author USER
29 | */
30 | public class AgregarEmpController implements Initializable {
31 |
32 |
33 | @FXML
34 | private Button CrearEmprendedor;
35 | @FXML
36 | private TextField cedula;
37 | @FXML
38 | private TextField nombreRespo;
39 | @FXML
40 | private TextField telefono;
41 | @FXML
42 | private TextField nombre;
43 | @FXML
44 | private TextField direccion;
45 | @FXML
46 | private TextField sitioWeb;
47 | @FXML
48 | private TextField descripcion;
49 | @FXML
50 | private CheckBox twitter;
51 | @FXML
52 | private CheckBox instagram;
53 | @FXML
54 | private CheckBox facebook;
55 | @FXML
56 | private CheckBox tiktok;
57 | @FXML
58 | private TextField email;
59 | @FXML
60 | private CheckBox youtube;
61 | @FXML
62 | private CheckBox linkedln;
63 | @FXML
64 | private CheckBox pinterest;
65 | @FXML
66 | private BorderPane segundaVentana;
67 | @FXML
68 | private Label redSocial;
69 | @FXML
70 | private TextField cuenta;
71 | @FXML
72 | private Button guardar;
73 | @FXML
74 | private ImageView cerrarVentana;
75 |
76 | private String usuario="Ingrese el usuario de ";
77 | ArrayList redesSociales = new ArrayList<>();
78 | @FXML
79 | private ImageView regresar;
80 |
81 |
82 | /**
83 | * Initializes the controller class.
84 | */
85 | @Override
86 | public void initialize(URL url, ResourceBundle rb) {
87 | twitter.setOnAction(e -> handleCheckBoxSelection(twitter, "Twitter"));
88 | facebook.setOnAction(e -> handleCheckBoxSelection(facebook, "Facebook"));
89 | instagram.setOnAction(e -> handleCheckBoxSelection(instagram, "Instagram"));
90 | youtube.setOnAction(e -> handleCheckBoxSelection(youtube, "Youtube"));
91 | tiktok.setOnAction(e -> handleCheckBoxSelection(tiktok, "Tiktok"));
92 | pinterest.setOnAction(e -> handleCheckBoxSelection(pinterest, "Pinterest"));
93 | linkedln.setOnAction(e -> handleCheckBoxSelection(linkedln, "Linkedin"));
94 | cedula.setText(null);
95 | telefono.setText(null);
96 | nombre.setText(null);
97 | nombreRespo.setText(null);
98 | email.setText(null);
99 | direccion.setText(null);
100 | sitioWeb.setText(null);
101 | descripcion.setText(null);
102 | CrearEmprendedor.setOnAction(e -> {
103 | try {
104 | guardarEmprendedor();
105 | } catch (IOException ex) {
106 | ex.printStackTrace();
107 | }
108 | });
109 | }
110 | @FXML
111 | private void admEmprendedor() throws IOException{
112 | App.setRoot("/com/mycompany/proyectop2g/admEmprendedor");
113 | }
114 |
115 | private void handleCheckBoxSelection(CheckBox checkbox, String c){
116 | if (checkbox.isSelected()) { infoRedSocial(checkbox,c); }
117 | else {
118 | Alert alert = new Alert(AlertType.CONFIRMATION);
119 | alert.setTitle("Confirmation Dialog");
120 | alert.setHeaderText("Eliminar una red Social");
121 | alert.setContentText("¿Estás seguro que quieres eliminar "+c+" ?");
122 | Optional result = alert.showAndWait();
123 | if (result.get() == ButtonType.OK){
124 | redesSociales.removeIf(rs -> rs.getAppSocial().equals(AppSocial.valueOf(c.toUpperCase())));
125 | alert.close();
126 | checkbox.setSelected(false);
127 | } else {
128 | checkbox.setSelected(true);
129 | alert.close();
130 | }
131 | }
132 | }
133 | private void infoRedSocial(CheckBox ch, String r){
134 | segundaVentana.setVisible(true);
135 | cuenta.setText(null);
136 | redSocial.setText(null);
137 | redSocial.setText(usuario+r+" :");
138 | guardar.setOnAction(
139 | e -> {
140 | if(cuenta.getText()== null){
141 | Alert alert = new Alert(AlertType.WARNING);
142 | alert.setTitle("Information Dialog");
143 | alert.setHeaderText("Label Vacio");
144 | alert.setContentText("Debes escribir tu cuenta de usuario!");
145 | alert.showAndWait();
146 | } else{
147 | String c = cuenta.getText();
148 | RedSocial rs1 = new RedSocial(AppSocial.valueOf(r.toUpperCase() ), c);
149 | redesSociales.add(rs1);
150 | segundaVentana.setVisible(false);
151 | }
152 | }
153 | );
154 | cerrarVentana.setOnMouseClicked(e -> {segundaVentana.setVisible(false); ch.setSelected(false);});
155 | }
156 |
157 | @FXML
158 | private void guardarEmprendedor() throws IOException{
159 | if (!Sistema.verificarCedula(cedula.getText())){
160 | if(cedula.getText()!= null && telefono.getText()!= null && email.getText()!=null
161 | && nombreRespo.getText()!=null && nombre.getText()!=null && descripcion.getText()!=null && !redesSociales.isEmpty()){
162 | try{
163 | int telef = Integer.parseInt(telefono.getText());
164 | Emprendedor e = new Emprendedor(cedula.getText(),nombre.getText(), telef,email.getText(),nombreRespo.getText(),
165 | direccion.getText(), sitioWeb.getText(), redesSociales, descripcion.getText() );
166 | Sistema.emprendedores.add(e);
167 | Alert alert = new Alert(AlertType.INFORMATION);
168 | alert.setTitle("Information Dialog");
169 | alert.setHeaderText("Emprendedor");
170 | alert.setContentText("Hola "+nombre.getText()+" su emprendimiento fue registrado correctamente.");
171 | alert.showAndWait();
172 | admEmprendedor();
173 | }catch(Exception e){
174 | Alert alert = new Alert(AlertType.WARNING);
175 | alert.setTitle("Warning Dialog");
176 | alert.setHeaderText("Error en los datos");
177 | alert.setContentText("Los datos ingresados son invalidos");
178 | alert.showAndWait();
179 | }
180 | }else{
181 | Alert alert = new Alert(AlertType.WARNING);
182 | alert.setTitle("Warning Dialog");
183 | alert.setHeaderText("Label vacio");
184 | alert.setContentText("Complete todos los label requeridos");
185 | alert.showAndWait();
186 | }
187 | }else {
188 | Alert alert = new Alert(AlertType.WARNING);
189 | alert.setTitle("Warning Dialog");
190 | alert.setHeaderText("Label Cedula");
191 | alert.setContentText("Cedula ya existente");
192 | alert.showAndWait();
193 | }
194 | }
195 |
196 |
197 | }
198 |
--------------------------------------------------------------------------------
/ProyectoP1G3/src/main/java/modelo/evento/Feria.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import modelo.participante.*;
3 | import java.util.ArrayList;
4 |
5 | public class Feria {
6 | private String codigo;
7 | private String nombre;
8 | private String fechaI;
9 | private String fechaF;
10 | private String lugar;
11 | private String descripcion;
12 | private String horario;
13 | private ArrayList auspiciantesEnFeria;
14 | private SeccionStand[] seccionesStand;
15 |
16 |
17 | //Constructor
18 | public Feria(String c, String n, String fi, String ff, String l, String d, String h){
19 | codigo=c;
20 | nombre=n;
21 | fechaI=fi;
22 | fechaF=ff;
23 | lugar=l;
24 | descripcion=d;
25 | horario=h;
26 | auspiciantesEnFeria=new ArrayList<>();
27 | seccionesStand= new SeccionStand[4];
28 | }
29 |
30 | //Getters y setters
31 | public String getCodigo(){return codigo;}
32 |
33 | public String getNombre(){return nombre;}
34 |
35 | public String getFechaI(){return fechaI;}
36 |
37 | public String getFechaF(){return fechaF;}
38 |
39 | public String getLugar(){return lugar;}
40 |
41 | public String getDescripcion(){return descripcion;}
42 |
43 | public String getHorario(){return horario;}
44 |
45 | public ArrayList getAuspiciantesEnFeria(){
46 | return auspiciantesEnFeria;
47 | }
48 |
49 | public SeccionStand[] getSeccionesStand(){
50 | return seccionesStand;
51 | }
52 |
53 | public void setNombre(String n){nombre=n;}
54 |
55 | public void setFechaI(String fi){fechaI=fi;}
56 |
57 | public void setFechaF(String ff){fechaF=ff;}
58 |
59 | public void setLugar(String l){lugar=l;}
60 |
61 | public void setDescripcion(String d){descripcion=d;}
62 |
63 | public void setHorario(String h){horario=h;}
64 |
65 | public void setSeccionesStand(int can1, int can2, int can3, int can4){
66 | AsignarSeccionesStand(can1,can2,can3,can4);
67 | }
68 |
69 | //Metodo toString
70 | @Override
71 | public String toString(){
72 | String aus="["; //String para presentar los auspiciantes
73 | for(int j=0;j tblFerias;
35 | @FXML
36 | private TableColumn colCodigo;
37 | @FXML
38 | private TableColumn colNombre;
39 | @FXML
40 | private TableColumn colFechaInicio;
41 | @FXML
42 | private TableColumn colLugar;
43 | @FXML
44 | private TableColumn colNAuspiciantes;
45 | @FXML
46 | private TableColumn colNEmprendedores;
47 |
48 | /**
49 | * Initializes the controller class.
50 | */
51 |
52 | //Inicializa la tabla con los datos de las ferias existentes
53 | @Override
54 | public void initialize(URL url, ResourceBundle rb) {
55 | colCodigo.setCellValueFactory(new PropertyValueFactory<>("codigo"));
56 | colNombre.setCellValueFactory(new PropertyValueFactory<>("nombre"));
57 | colFechaInicio.setCellValueFactory(new PropertyValueFactory<>("fechaI"));
58 | colLugar.setCellValueFactory(new PropertyValueFactory<>("lugar"));
59 | colNAuspiciantes.setCellValueFactory(data ->
60 | Bindings.createObjectBinding(() -> data.getValue().getAuspiciantesEnFeria().size())
61 | );
62 | colNEmprendedores.setCellValueFactory(data ->
63 | Bindings.createObjectBinding(() -> data.getValue().getNumeroEmprendedores())
64 | );
65 | if(Sistema.ferias.size()!=0) tblFerias.getItems().addAll(Sistema.ferias);
66 | }
67 |
68 | @FXML
69 | private void regresarFeria(MouseEvent event)throws IOException {
70 | App.setRoot("/com/mycompany/proyectop2g/MenuFXML");
71 | }
72 |
73 | @FXML
74 | private void agregarFeria(ActionEvent event) throws IOException{
75 |
76 | FXMLLoader loader= new FXMLLoader(getClass().getResource("/com/mycompany/proyectop2g/datosFeria.fxml"));
77 | Parent root= loader.load();
78 | DatosFeriaController controlador= loader.getController();
79 | controlador.cambiarTitulo("Nueva Feria");
80 | Scene scene= new Scene(root);
81 | Stage stage= new Stage();
82 | stage.initModality(Modality.APPLICATION_MODAL);
83 | stage.setScene(scene);
84 | stage.initStyle(StageStyle.UNDECORATED);
85 | stage.show();
86 |
87 | }
88 |
89 | @FXML
90 | private void mostrarDetallesFeria(ActionEvent event) {
91 | Feria feriaSeleccionada= tblFerias.getSelectionModel().getSelectedItem();
92 | if (feriaSeleccionada != null){
93 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
94 | alerta.setTitle("Feria "+feriaSeleccionada.getCodigo());
95 | alerta.setHeaderText("Detalles sobre la Feria "+feriaSeleccionada.getCodigo());
96 | alerta.setContentText(feriaSeleccionada.toString());
97 | alerta.showAndWait();
98 | }else{
99 | Alert alerta= new Alert(Alert.AlertType.WARNING);
100 | alerta.setTitle("Aviso");
101 | alerta.setHeaderText("Feria no seleccionada");
102 | alerta.setContentText("Si desea ver los detalles de una feria, debe seleccionar la feria primero");
103 | alerta.showAndWait();
104 | }
105 |
106 | }
107 |
108 | @FXML
109 | private void mostrarDetallesEmprendedor(ActionEvent event) {
110 | Feria feriaSeleccionada= tblFerias.getSelectionModel().getSelectedItem();
111 | if(feriaSeleccionada!=null){
112 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
113 | alerta.setTitle("Feria "+feriaSeleccionada.getCodigo());
114 | alerta.setHeaderText("Detalles sobre los emprendedores de la Feria "+feriaSeleccionada.getCodigo());
115 | if(feriaSeleccionada.consultarEmprendedores().length()<5){
116 | alerta.setContentText("No hay emprendedores registrados en la feria");
117 | }else{
118 | TextArea textArea = new TextArea(feriaSeleccionada.consultarEmprendedores());
119 | textArea.setEditable(false);
120 | textArea.setWrapText(true);
121 | ScrollPane scrollPane = new ScrollPane(textArea);
122 | scrollPane.setFitToWidth(true);
123 | alerta.getDialogPane().setContent(scrollPane);
124 | }
125 | alerta.showAndWait();
126 | }else{
127 | Alert alerta= new Alert(Alert.AlertType.WARNING);
128 | alerta.setTitle("Aviso");
129 | alerta.setHeaderText("Feria no seleccionada");
130 | alerta.setContentText("Si desea ver los detalles de los emprendedores de una feria, debe seleccionar la feria primero");
131 | alerta.showAndWait();
132 | }
133 | }
134 |
135 | @FXML
136 | private void mostrarDetallesAuspiciante(ActionEvent event) {
137 | Feria feriaSeleccionada= tblFerias.getSelectionModel().getSelectedItem();
138 | if(feriaSeleccionada!=null){
139 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
140 | alerta.setTitle("Feria "+feriaSeleccionada.getCodigo());
141 | alerta.setHeaderText("Detalles sobre los auspiciantes de la Feria "+feriaSeleccionada.getCodigo());
142 | if(feriaSeleccionada.consultarAuspiciantesEnFeria().length()<5){
143 | alerta.setContentText("No hay auspiciantes registrados en la feria");
144 | }else{
145 | TextArea textArea = new TextArea(feriaSeleccionada.consultarAuspiciantesEnFeria());
146 | textArea.setEditable(false);
147 | textArea.setWrapText(true);
148 | ScrollPane scrollPane = new ScrollPane(textArea);
149 | scrollPane.setFitToWidth(true);
150 | alerta.getDialogPane().setContent(scrollPane);
151 | }
152 | alerta.showAndWait();
153 | }else{
154 | Alert alerta= new Alert(Alert.AlertType.WARNING);
155 | alerta.setTitle("Aviso");
156 | alerta.setHeaderText("Feria no seleccionada");
157 | alerta.setContentText("Si desea ver los detalles de los auspiciantes de una feria, debe seleccionar la feria primero");
158 | alerta.showAndWait();
159 | }
160 | }
161 |
162 | @FXML
163 | private void editarFeria(ActionEvent event) throws Exception{
164 | Feria feriaSeleccionada= tblFerias.getSelectionModel().getSelectedItem();
165 | if(feriaSeleccionada!=null){
166 | FXMLLoader loader= new FXMLLoader(getClass().getResource("/com/mycompany/proyectop2g/datosFeria.fxml"));
167 | Parent root= loader.load();
168 | DatosFeriaController controlador= loader.getController();
169 | boolean aceptar=controlador.initAtributos(feriaSeleccionada); //Recibe un boleano que verifica que se pueda editar la feria
170 | if(aceptar==true){
171 | controlador.cambiarTitulo("Editar Feria");
172 | Scene scene= new Scene(root);
173 | Stage stage= new Stage();
174 | stage.initModality(Modality.APPLICATION_MODAL);
175 | stage.setScene(scene);
176 | stage.showAndWait();
177 | }else{
178 | Alert alerta= new Alert(Alert.AlertType.ERROR);
179 | alerta.setTitle("Aviso");
180 | alerta.setHeaderText("La feria esta en progreso o ha finalizado");
181 | alerta.setContentText("No se pueden editar ferias en progresos o finalizados");
182 | alerta.showAndWait();
183 | }
184 |
185 | }else{
186 | Alert alerta= new Alert(Alert.AlertType.WARNING);
187 | alerta.setTitle("Aviso");
188 | alerta.setHeaderText("Feria no seleccionada");
189 | alerta.setContentText("Si desea editar los campos de una feria, debe seleccionar la feria primero");
190 | alerta.showAndWait();
191 | }
192 | }
193 |
194 |
195 | @FXML
196 | private void administrarStands(ActionEvent event) throws IOException {
197 | Feria feriaSeleccionada= tblFerias.getSelectionModel().getSelectedItem();
198 | if(feriaSeleccionada!=null){
199 | FXMLLoader loader= new FXMLLoader(getClass().getResource("/com/mycompany/proyectop2g/admStand.fxml"));
200 | Parent root= loader.load();
201 | AdmStandController controlador= loader.getController();
202 | controlador.crearStands(feriaSeleccionada);
203 | Scene scene= new Scene(root);
204 | Stage stage= new Stage();
205 | stage.initModality(Modality.APPLICATION_MODAL);
206 | stage.setScene(scene);
207 | stage.initStyle(StageStyle.UNDECORATED);
208 | stage.showAndWait();
209 | }else{
210 | Alert alerta= new Alert(Alert.AlertType.WARNING);
211 | alerta.setTitle("Aviso");
212 | alerta.setHeaderText("Feria no seleccionada");
213 | alerta.setContentText("Si desea administrar los stands de una feria, debe seleccionar la feria primero");
214 | alerta.showAndWait();
215 | }
216 |
217 | }
218 |
219 |
220 | }
221 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/DatosFeriaController.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.proyectop2g;
2 |
3 | import java.io.IOException;
4 | import java.net.URL;
5 | import java.time.LocalDate;
6 | import java.util.ResourceBundle;
7 | import javafx.event.ActionEvent;
8 | import javafx.fxml.FXML;
9 | import javafx.fxml.FXMLLoader;
10 | import javafx.fxml.Initializable;
11 | import javafx.scene.Parent;
12 | import javafx.scene.Scene;
13 | import javafx.scene.control.Alert;
14 |
15 | import javafx.scene.control.Button;
16 | import javafx.scene.control.ButtonType;
17 | import javafx.scene.control.DatePicker;
18 | import javafx.scene.control.Label;
19 | import javafx.scene.control.TextField;
20 | import javafx.scene.input.MouseEvent;
21 | import javafx.stage.Stage;
22 | import modelo.evento.*;
23 |
24 | public class DatosFeriaController implements Initializable {
25 |
26 |
27 | @FXML
28 | private TextField txtNombre;
29 | @FXML
30 | private TextField txtDescripcion;
31 | @FXML
32 | private TextField txtLugar;
33 | @FXML
34 | private DatePicker dateFechaInicio;
35 | @FXML
36 | private DatePicker dateFechaFin;
37 | @FXML
38 | private TextField txtHorario;
39 | @FXML
40 | private TextField txtNStand1;
41 | @FXML
42 | private TextField txtNStand2;
43 | @FXML
44 | private TextField txtNStand3;
45 | @FXML
46 | private TextField txtNStand4;
47 |
48 | private Feria feria;
49 |
50 | @FXML
51 | private Label lblTituloFeria;
52 |
53 | /**
54 | * Initializes the controller class.
55 | */
56 | @Override
57 | public void initialize(URL url, ResourceBundle rb) {
58 | //TODO
59 | }
60 |
61 | //En caso de que se edite una feria se llenan los cuadros de textos y hace la validacion
62 | public boolean initAtributos(Feria fe) throws IOException{
63 | feria=fe;
64 | txtNombre.setText(feria.getNombre());
65 | txtDescripcion.setText(feria.getDescripcion());
66 | txtLugar.setText(feria.getLugar());
67 | dateFechaInicio.setValue(feria.getFechaI());
68 | dateFechaFin.setValue(feria.getFechaF());
69 | txtHorario.setText(feria.getHorario());
70 | txtNStand1.setText(String.valueOf(feria.getSeccionesStand()[0].getCanStand()));
71 | txtNStand2.setText(String.valueOf(feria.getSeccionesStand()[1].getCanStand()));
72 | txtNStand3.setText(String.valueOf(feria.getSeccionesStand()[2].getCanStand()));
73 | txtNStand4.setText(String.valueOf(feria.getSeccionesStand()[3].getCanStand()));
74 | if(LocalDate.now().isAfter(feria.getFechaI())){ //Valida si se puede editar la feria
75 | feria=null;
76 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
77 | return false;
78 | }
79 | return true;
80 | }
81 |
82 | //Guarda una nueva feria o la edicion de una feria existente
83 | @FXML
84 | private void guardarFeria(ActionEvent event) throws IOException {
85 | if(feria==null){ //Nueva feria
86 | try{
87 | String nombre= txtNombre.getText();
88 | String descripcion= txtDescripcion.getText();
89 | String lugar= txtLugar.getText();
90 | LocalDate fechaInicio= dateFechaInicio.getValue();
91 | LocalDate fechaFin= dateFechaFin.getValue();
92 | String horario= txtHorario.getText();
93 | int nStand1= Integer.parseInt(txtNStand1.getText());
94 | int nStand2= Integer.parseInt(txtNStand2.getText());
95 | int nStand3= Integer.parseInt(txtNStand3.getText());
96 | int nStand4= Integer.parseInt(txtNStand4.getText());
97 | Sistema.registrarFeria(nombre,fechaInicio,fechaFin,lugar,descripcion,horario,nStand1,nStand2,nStand3,nStand4);
98 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
99 | alerta.setTitle("Aviso");
100 | alerta.setHeaderText("Acerca de la feria");
101 | alerta.setContentText("La feria ha sido registrada exitosamente");
102 | alerta.showAndWait();
103 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
104 | Stage stage= (Stage) txtNombre.getScene().getWindow();
105 | stage.close();
106 | }catch(Exception e){
107 | Alert alerta= new Alert(Alert.AlertType.ERROR);
108 | alerta.setTitle("Aviso");
109 | alerta.setHeaderText("Error en los datos ingresados");
110 | alerta.setContentText("Los datos ingresados son inválidos. Por favor, revise que todo este correcto");
111 | alerta.showAndWait();
112 | }
113 | }else{ //Edicion de feria
114 | try{
115 | String nombre= txtNombre.getText();
116 | String descripcion= txtDescripcion.getText();
117 | String lugar= txtLugar.getText();
118 | LocalDate fechaInicio= dateFechaInicio.getValue();
119 | LocalDate fechaFin= dateFechaFin.getValue();
120 | String horario= txtHorario.getText();
121 | int nStand1= Integer.parseInt(txtNStand1.getText());
122 | int nStand2= Integer.parseInt(txtNStand2.getText());
123 | int nStand3= Integer.parseInt(txtNStand3.getText());
124 | int nStand4= Integer.parseInt(txtNStand4.getText());
125 |
126 | if(nStand1!=feria.getSeccionesStand()[0].getCanStand() || nStand2!=feria.getSeccionesStand()[1].getCanStand()||
127 | nStand3!=feria.getSeccionesStand()[2].getCanStand() || nStand4!=feria.getSeccionesStand()[3].getCanStand()){
128 | Alert alerta= new Alert(Alert.AlertType.CONFIRMATION.WARNING);
129 | alerta.setTitle("Aviso");
130 | alerta.setHeaderText("Va a cambiar el numero de stand de una o mas secciones");
131 | alerta.setContentText("Se perderan las asignaciones de los stands en dichas secciones. ¿Desea continuar?");
132 | ButtonType botonSi = new ButtonType("Sí");
133 | ButtonType botonNo = new ButtonType("No");
134 | alerta.getButtonTypes().setAll(botonSi, botonNo);
135 | alerta.showAndWait().ifPresent(response -> {
136 | if (response == botonSi) {
137 | if(nStand1!=feria.getSeccionesStand()[0].getCanStand()){
138 | feria.editarSeccion1(nStand1);
139 | }
140 | if(nStand2!=feria.getSeccionesStand()[1].getCanStand()){
141 | feria.editarSeccion2(nStand2);
142 | }
143 | if(nStand3!=feria.getSeccionesStand()[2].getCanStand()){
144 | feria.editarSeccion3(nStand3);
145 | }
146 | if(nStand4!=feria.getSeccionesStand()[3].getCanStand()){
147 | feria.editarSeccion4(nStand4);
148 | }
149 | feria.setNombre(nombre);
150 | feria.setDescripcion(descripcion);
151 | feria.setLugar(lugar);
152 | feria.setFechaI(fechaInicio);
153 | feria.setFechaF(fechaFin);
154 | feria.setHorario(horario);
155 | Alert alerta2= new Alert(Alert.AlertType.INFORMATION);
156 | alerta2.setTitle("Aviso");
157 | alerta2.setHeaderText("Acerca de la feria");
158 | alerta2.setContentText("La feria ha sido actualizada exitosamente");
159 | alerta2.showAndWait();
160 | try{
161 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
162 | Stage stage= (Stage) txtNombre.getScene().getWindow();
163 | stage.close();
164 | }catch(IOException ex) {
165 | System.out.println("Error al cambiar de ventana:");
166 | }
167 | }else if(response == botonNo) {
168 | txtNStand1.setText(String.valueOf(feria.getSeccionesStand()[0].getCanStand()));
169 | txtNStand2.setText(String.valueOf(feria.getSeccionesStand()[1].getCanStand()));
170 | txtNStand3.setText(String.valueOf(feria.getSeccionesStand()[2].getCanStand()));
171 | txtNStand4.setText(String.valueOf(feria.getSeccionesStand()[3].getCanStand()));
172 | alerta.close();
173 | }
174 | });
175 | }else{
176 | feria.setNombre(nombre);
177 | feria.setDescripcion(descripcion);
178 | feria.setLugar(lugar);
179 | feria.setFechaI(fechaInicio);
180 | feria.setFechaF(fechaFin);
181 | feria.setHorario(horario);
182 | Alert alerta2= new Alert(Alert.AlertType.INFORMATION);
183 | alerta2.setTitle("Aviso");
184 | alerta2.setHeaderText("Acerca de la feria");
185 | alerta2.setContentText("La feria ha sido actualizada exitosamente");
186 | alerta2.showAndWait();
187 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
188 | Stage stage= (Stage) txtNombre.getScene().getWindow();
189 | stage.close();
190 | }
191 |
192 |
193 | }catch(Exception e){
194 | Alert alerta= new Alert(Alert.AlertType.ERROR);
195 | alerta.setTitle("Aviso");
196 | alerta.setHeaderText("Error en los datos ingresados");
197 | alerta.setContentText("Los datos ingresados son inválidos. Por favor, revise que todo este correcto");
198 | alerta.showAndWait();
199 | }
200 | }
201 |
202 |
203 | }
204 |
205 | //Limpia los cuadros de textos
206 | @FXML
207 | private void limpiar(ActionEvent event) {
208 | txtNombre.setText("");
209 | txtDescripcion.setText("");
210 | txtLugar.setText("");
211 | dateFechaInicio.setValue(null);
212 | dateFechaFin.setValue(null);
213 | txtHorario.setText("");
214 | txtNStand1.setText("");
215 | txtNStand2.setText("");
216 | txtNStand3.setText("");
217 | txtNStand4.setText("");
218 | }
219 |
220 | @FXML
221 | private void regresar(MouseEvent event) throws IOException{
222 | feria=null;
223 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
224 | Stage stage= (Stage) txtNombre.getScene().getWindow();
225 | stage.close();
226 | }
227 |
228 | public Feria getFeria(){
229 | return feria;
230 | }
231 |
232 | //Cambia el titulo de la ventana si se trata de una edicion o nueva feria
233 | public void cambiarTitulo(String texto){
234 | lblTituloFeria.setText(texto);
235 | }
236 |
237 |
238 |
239 | }
240 |
--------------------------------------------------------------------------------
/ProyectoP1G3/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/com/mycompany/proyectop2g/AdmStandController.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.proyectop2g;
2 |
3 | import java.io.IOException;
4 | import java.net.URL;
5 | import java.time.LocalDate;
6 | import java.util.ResourceBundle;
7 | import javafx.event.ActionEvent;
8 | import javafx.fxml.FXML;
9 | import javafx.fxml.FXMLLoader;
10 | import javafx.fxml.Initializable;
11 | import javafx.scene.Parent;
12 | import javafx.scene.Scene;
13 | import javafx.scene.control.Alert;
14 | import javafx.scene.control.ButtonType;
15 |
16 | import javafx.scene.control.Label;
17 | import javafx.scene.control.TextField;
18 | import javafx.scene.effect.DropShadow;
19 | import javafx.scene.input.MouseEvent;
20 | import javafx.scene.layout.HBox;
21 | import javafx.stage.Modality;
22 | import javafx.stage.Stage;
23 | import javafx.stage.StageStyle;
24 | import modelo.evento.*;
25 | import modelo.participante.*;
26 | /**
27 | * FXML Controller class
28 | *
29 | * @author Steven
30 | */
31 | public class AdmStandController implements Initializable {
32 |
33 |
34 | @FXML
35 | private Label lblFeriaSeleccionada;
36 | @FXML
37 | private HBox hb1Seccion;
38 | @FXML
39 | private HBox hb2Seccion;
40 | @FXML
41 | private HBox hb3Seccion;
42 | @FXML
43 | private HBox hb4Seccion;
44 |
45 | private Feria feria;
46 | @FXML
47 | private HBox ventanaRegistrarStand;
48 |
49 | @FXML
50 | private TextField txtIDPersona;
51 |
52 | //private Feria feria;
53 | private Stand stand;
54 | private Label lb;
55 | /**
56 | * Initializes the controller class.
57 | */
58 |
59 | //Inicializa la feria seleccionada de la tabla de ferias
60 | public void inicAtributos(Feria fe){
61 | feria=fe;
62 | }
63 |
64 | @Override
65 | public void initialize(URL url, ResourceBundle rb) {
66 |
67 | }
68 |
69 | //Crea los stands segun la feria seleccionada
70 | public void crearStands(Feria fe){
71 | inicAtributos(fe);
72 | lblFeriaSeleccionada.setText("Feria: "+fe.getCodigo());
73 | int cont=0;
74 | for(SeccionStand ss: feria.getSeccionesStand()){
75 | for(Stand s: ss.getSeccion()){
76 | Label lbStand= new Label(s.getCodigoSt());
77 | DropShadow dropShadow = new DropShadow();
78 | dropShadow.setColor(javafx.scene.paint.Color.BLACK);
79 | dropShadow.setOffsetX(3);
80 | dropShadow.setOffsetY(3);
81 | dropShadow.setRadius(5);
82 | lbStand.setEffect(dropShadow);
83 | if(s.getPersona()!=null){
84 | lbStand.setStyle("-fx-background-color: yellow; -fx-padding: 10px; -fx-text-fill: white; -fx-background-radius: 12; -fx-font-weight: bold;");
85 | lbStand.setOnMouseClicked(e -> {
86 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
87 | alerta.setTitle("Informacion del stand");
88 | Persona p= s.getPersona();
89 | String pe="";
90 | if(s.getPersona() instanceof Emprendedor) {
91 | pe="Emprendedor";
92 | alerta.setContentText("Stand: "+s.getCodigoSt()+"\nAsignado el: "+s.getFechaAsig()+"\nTipo: "+pe+"\nNombre: "+
93 | p.getNomPerRes()+"\nTelefono: "+p.getTelefono()+"\nCorreo: "+p.getEmail());
94 | }else if(s.getPersona() instanceof Auspiciante){
95 | pe="Auspiciante";
96 | alerta.setContentText("Stand: "+s.getCodigoSt()+"\nAsignado el: "+s.getFechaAsig()+"\nTipo: "+pe+"\nNombre: "+
97 | p.getNombre()+"\nTelefono: "+p.getTelefono()+"\nCorreo: "+p.getEmail());
98 | }
99 | alerta.setHeaderText("Stand reservado");
100 | alerta.showAndWait();
101 | });
102 | }else{
103 | lbStand.setStyle("-fx-background-color: green; -fx-padding: 10px; -fx-text-fill: white; -fx-background-radius: 12; -fx-font-weight: bold;");
104 | lbStand.setOnMouseClicked(e ->{
105 | Alert alerta= new Alert(Alert.AlertType.CONFIRMATION);
106 | alerta.setTitle("Informacion del stand");
107 | alerta.setHeaderText("El Stand "+s.getCodigoSt()+" se encuentra disponible");
108 | alerta.setContentText("¿Desea reservarlo?");
109 | ButtonType botonSi = new ButtonType("Sí");
110 | ButtonType botonNo = new ButtonType("No");
111 | alerta.getButtonTypes().setAll(botonSi, botonNo);
112 | alerta.showAndWait().ifPresent(response -> {
113 | if (response == botonSi) {
114 | iniAtributos(feria,s,lblFeriaSeleccionada);
115 | ventanaRegistrarStand.setVisible(true);
116 | }else if(response == botonNo) {
117 | alerta.close();
118 | }
119 | });
120 | });
121 | }
122 | if(cont==0) hb1Seccion.getChildren().add(lbStand);
123 | if(cont==1) hb2Seccion.getChildren().add(lbStand);
124 | if(cont==2) hb3Seccion.getChildren().add(lbStand);
125 | if(cont==3) hb4Seccion.getChildren().add(lbStand);
126 | }
127 | cont++;
128 | }
129 | }
130 |
131 | @FXML
132 | private void regresar(MouseEvent event) throws IOException{
133 | feria=null;
134 | stand=null;
135 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
136 | Stage stage= (Stage) lblFeriaSeleccionada.getScene().getWindow();
137 | stage.close();
138 | }
139 |
140 | //Otro inciador de atributos
141 | public void iniAtributos(Feria fe, Stand st, Label lbl){
142 | feria=fe;
143 | stand=st;
144 | lb=lbl;
145 | }
146 |
147 | //Reserva un stand segun el tipo de persona y sus condiciones
148 | @FXML
149 | private void reservar(ActionEvent event) throws IOException{
150 | Persona per= Sistema.encontrarPersona(txtIDPersona.getText());
151 | int cont=0;
152 | if(per!=null && per instanceof Emprendedor){
153 | Emprendedor emp=(Emprendedor)per;
154 | cont= feria.limiteStand(emp.getNumId());
155 | if(cont==0){
156 | stand.setPersona(emp);
157 | stand.setFechaAsig(LocalDate.now());
158 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
159 | alerta.setTitle("Aviso");
160 | alerta.setHeaderText("Stand "+stand.getCodigoSt());
161 | alerta.setContentText("El stand ha sido reservado con exito");
162 | alerta.showAndWait();
163 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
164 |
165 | FXMLLoader loader= new FXMLLoader(getClass().getResource("/com/mycompany/proyectop2g/admStand.fxml"));
166 | Parent root= loader.load();
167 | AdmStandController controlador= loader.getController();
168 | controlador.crearStands(feria);
169 | Scene scene= new Scene(root);
170 | Stage stage1= new Stage();
171 | stage1.initModality(Modality.APPLICATION_MODAL);
172 | stage1.setScene(scene);
173 | stage1.initStyle(StageStyle.UNDECORATED);
174 | feria=null;
175 | stand=null;
176 | ventanaRegistrarStand.setVisible(false);
177 | Stage stage= (Stage) lblFeriaSeleccionada.getScene().getWindow();
178 | stage.close();
179 | stage1.show();
180 | //arriba
181 | }else{
182 | Alert alerta= new Alert(Alert.AlertType.WARNING);
183 | alerta.setTitle("Aviso");
184 | alerta.setHeaderText("El emprendedor ya tiene un stand asignado");
185 | alerta.setContentText("Un emprendedor no puede tener mas de un stand asignado por feria");
186 | alerta.showAndWait();
187 | }
188 | }else if(per!=null && per instanceof Auspiciante){
189 | Auspiciante aus=(Auspiciante)per;
190 | AuspicianteEnFeria anf= feria.encontrarAuspicianteEnFeria(aus);
191 | if(anf!=null){
192 | cont= feria.limiteStand(anf.getAuspiciante().getNumId());
193 | if(cont<2){
194 | if(anf.getTieneStand()==true){
195 | stand.setPersona(aus);
196 | stand.setFechaAsig(LocalDate.now());
197 | Alert alerta= new Alert(Alert.AlertType.INFORMATION);
198 | alerta.setTitle("Aviso");
199 | alerta.setHeaderText("Stand "+stand.getCodigoSt());
200 | alerta.setContentText("El stand ha sido reservado con exito");
201 | alerta.showAndWait();
202 | //Stage stage= (Stage) txtIDPersona.getScene().getWindow();
203 | //stage.close();
204 | //abajo
205 | //Stage stage2= (Stage) lb.getScene().getWindow();
206 | //stage2.close();
207 | App.setRoot("/com/mycompany/proyectop2g/admFeria");
208 |
209 | FXMLLoader loader= new FXMLLoader(getClass().getResource("/com/mycompany/proyectop2g/admStand.fxml"));
210 | Parent root= loader.load();
211 | AdmStandController controlador= loader.getController();
212 | controlador.crearStands(feria);
213 | Scene scene= new Scene(root);
214 | Stage stage1= new Stage();
215 | stage1.initModality(Modality.APPLICATION_MODAL);
216 | stage1.setScene(scene);
217 | stage1.initStyle(StageStyle.UNDECORATED);
218 |
219 | //crearStands(feria);
220 | feria=null;
221 | stand=null;
222 | ventanaRegistrarStand.setVisible(false);
223 | Stage stage= (Stage) lblFeriaSeleccionada.getScene().getWindow();
224 | stage.close();
225 | stage1.show();
226 |
227 | //arriba
228 | }else{
229 | Alert alerta= new Alert(Alert.AlertType.WARNING);
230 | alerta.setTitle("Aviso");
231 | alerta.setHeaderText("El auspiciante no debe tener stand");
232 | alerta.setContentText("El auspiciante que ingreso no va a requerir el uso de un stand");
233 | alerta.showAndWait();
234 | }
235 | }else{
236 | Alert alerta= new Alert(Alert.AlertType.WARNING);
237 | alerta.setTitle("Aviso");
238 | alerta.setHeaderText("El auspiciante ya tiene 2 stands asignados");
239 | alerta.setContentText("Un auspiciante solo puede tener max 2 stands por feria");
240 | alerta.showAndWait();
241 | }
242 | }else{
243 | Alert alerta= new Alert(Alert.AlertType.ERROR);
244 | alerta.setTitle("Aviso");
245 | alerta.setHeaderText("Emprendedor o Auspiciante no encontrado");
246 | alerta.setContentText("Asegurese que la persona se haya registrado y que el numero de identificacion este correctamente escrito");
247 | alerta.showAndWait();
248 | }
249 | }else{
250 | Alert alerta= new Alert(Alert.AlertType.ERROR);
251 | alerta.setTitle("Aviso");
252 | alerta.setHeaderText("Emprendedor o Auspiciante no encontrado");
253 | alerta.setContentText("Asegurese que la persona se haya registrado y que el numero de identificacion este correctamente escrito");
254 | alerta.showAndWait();
255 | }
256 | }
257 |
258 |
259 | @FXML
260 | private void regresar2(MouseEvent event) throws IOException{
261 | feria=null;
262 | stand=null;
263 | Stage stage1= (Stage) txtIDPersona.getScene().getWindow();
264 | stage1.close();
265 | }
266 |
267 |
268 | }
269 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/AgregarAuspi.fxml:
--------------------------------------------------------------------------------
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 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
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 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/resources/com/mycompany/proyectop2g/AgregarEmp.fxml:
--------------------------------------------------------------------------------
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 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
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 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/ProyectoP2G3/src/main/java/modelo/evento/Feria.java:
--------------------------------------------------------------------------------
1 | package modelo.evento;
2 | import java.io.Serializable;
3 | import java.time.LocalDate;
4 | import modelo.participante.*;
5 | import java.util.ArrayList;
6 | import java.util.Objects;
7 |
8 |
9 | public class Feria implements Serializable{
10 | private String codigo;
11 | private String nombre;
12 | private LocalDate fechaI;
13 | private LocalDate fechaF;
14 | private String lugar;
15 | private String descripcion;
16 | private String horario;
17 | private ArrayList auspiciantesEnFeria;
18 | private SeccionStand[] seccionesStand;
19 | private int contadorAus=1;
20 | private int contadorEmp=1;
21 |
22 |
23 | //Constructor
24 | public Feria(String c, String n, LocalDate fi, LocalDate ff, String l, String d, String h){
25 | codigo=c;
26 | nombre=n;
27 | fechaI=fi;
28 | fechaF=ff;
29 | lugar=l;
30 | descripcion=d;
31 | horario=h;
32 | auspiciantesEnFeria=new ArrayList<>();
33 | seccionesStand= new SeccionStand[4];
34 | }
35 |
36 | //Getters y setters
37 | public String getCodigo(){return codigo;}
38 |
39 | public String getNombre(){return nombre;}
40 |
41 | public LocalDate getFechaI(){return fechaI;}
42 |
43 | public LocalDate getFechaF(){return fechaF;}
44 |
45 | public String getLugar(){return lugar;}
46 |
47 | public String getDescripcion(){return descripcion;}
48 |
49 | public String getHorario(){return horario;}
50 |
51 | public ArrayList getAuspiciantesEnFeria(){
52 | return auspiciantesEnFeria;
53 | }
54 |
55 | public SeccionStand[] getSeccionesStand(){
56 | return seccionesStand;
57 | }
58 |
59 | public void setCodigo(String c) {codigo=c;}
60 |
61 | public void setNombre(String n){nombre=n;}
62 |
63 | public void setFechaI(LocalDate fi){fechaI=fi;}
64 |
65 | public void setFechaF(LocalDate ff){fechaF=ff;}
66 |
67 | public void setLugar(String l){lugar=l;}
68 |
69 | public void setDescripcion(String d){descripcion=d;}
70 |
71 | public void setHorario(String h){horario=h;}
72 |
73 | public void setSeccionesStand(int can1, int can2, int can3, int can4){
74 | AsignarSeccionesStand(can1,can2,can3,can4);
75 | }
76 |
77 | //Metodo toString
78 | @Override
79 | public String toString(){
80 | String aus= getStringAuspiciantes();
81 | String emp= getStringEmprendedores();
82 | return "Nombre: "+nombre+"\nDescripcion: "+descripcion+"\nLugar: "+lugar
83 | +"\nFecha de inicio: "+fechaI+"\nFecha de fin: "+fechaF+"\nHorario: "
84 | +horario+"\nAuspiciantes: "+aus+"\nEmprendedores: "+emp+"\nSeccion#1: "+seccionesStand[0].getCanStand()
85 | +" stand(s)"+"\nSeccion#2: "+seccionesStand[1].getCanStand()+" stand(s)"
86 | +"\nSeccion#3: "+seccionesStand[2].getCanStand()+" stand(s)"
87 | +"\nSeccion#4: "+seccionesStand[3].getCanStand()+" stand(s)";
88 | }
89 |
90 | //Mostrar informacion de la feria
91 | public void verInformacionFeria(){
92 | System.out.println(this.toString());;
93 | }
94 |
95 | //Asignar las 4 secciones de stands
96 | public void AsignarSeccionesStand(int can1, int can2, int can3, int can4){
97 | seccionesStand[0]= new SeccionStand(can1);
98 | seccionesStand[1]= new SeccionStand(can2);
99 | seccionesStand[2]= new SeccionStand(can3);
100 | seccionesStand[3]= new SeccionStand(can4);
101 | seccionesStand[0].crearStands(0);
102 | seccionesStand[1].crearStands(1);
103 | seccionesStand[2].crearStands(2);
104 | seccionesStand[3].crearStands(3);
105 | }
106 |
107 | //editar seccion 1
108 | public void editarSeccion1(int can){
109 | seccionesStand[0]= new SeccionStand(can);
110 | seccionesStand[0].crearStands(0);
111 | }
112 | //editar seccion 2
113 | public void editarSeccion2(int can){
114 | seccionesStand[1]= new SeccionStand(can);
115 | seccionesStand[1].crearStands(1);
116 | }
117 | //editar seccion 3
118 | public void editarSeccion3(int can){
119 | seccionesStand[2]= new SeccionStand(can);
120 | seccionesStand[2].crearStands(2);
121 | }
122 | //editar seccion 4
123 | public void editarSeccion4(int can){
124 | seccionesStand[3]= new SeccionStand(can);
125 | seccionesStand[3].crearStands(3);
126 | }
127 |
128 | //Mostrar los stands
129 | public void mostrarStands(){
130 | System.out.println("---Distribucion de stands---");
131 | for(int i=0;i<4;i++){
132 | SeccionStand ss= seccionesStand[i];
133 | System.out.println("Seccion#"+(i+1)+":");
134 | for(int j=0;j stAsignados= new ArrayList<>();
175 | String codigoStand="No tiene stand asignado";
176 | if(aef.getTieneStand()==true && encontrarStandAEF(aef).size()!=0){
177 | tieneStand="SI";
178 | stAsignados=encontrarStandAEF(aef);
179 | if(stAsignados.size()==2){
180 | codigoStand= stAsignados.get(0).getCodigoSt()+", "+stAsignados.get(1).getCodigoSt();
181 | }else if(stAsignados.size()==1){
182 | codigoStand= stAsignados.get(0).getCodigoSt();
183 | }
184 | }else if(aef.getTieneStand()==true && encontrarStandAEF(aef).size()==0){
185 | tieneStand="SI";
186 | codigoStand="Aun no tiene stand(s) asignado(s)";
187 | }else{
188 | tieneStand="NO";
189 | }
190 |
191 | if(tieneStand.equals("SI")){
192 | aus+=contadorAus+". "+"Auspiciante: "+aef.getAuspiciante().getNombre()+
193 | " / Descripcion del auspicio: "+aef.getDescripcion()+" / Tiene stand: "+tieneStand+
194 | " / Stand(s) asignado(s): "+codigoStand+"\n";
195 | contadorAus++;
196 | }else{
197 | aus+=contadorAus+". "+"Auspiciante: "+aef.getAuspiciante().getNombre()+
198 | " / Descripcion del auspicio: "+aef.getDescripcion()+" / Tiene stand: "+tieneStand+"\n";
199 | contadorAus++;
200 | }
201 |
202 | }
203 | contadorAus=1;
204 | return aus;
205 | }
206 |
207 | //Buscar stand por AuspicianteEnFeria
208 | public ArrayList encontrarStandAEF(AuspicianteEnFeria aef){
209 | ArrayList stands= new ArrayList<>();
210 | if(aef.getTieneStand()==true){
211 | for(SeccionStand ss: seccionesStand){
212 | for(Stand s: ss.getSeccion()){
213 | if(s.getPersona() instanceof Auspiciante && s.getPersona().getNumId().equals(aef.getAuspiciante().getNumId())){
214 | stands.add(s);
215 | }
216 | }
217 | }
218 | }
219 | return stands;
220 | }
221 |
222 | //Buscar stand por codigo
223 | public Stand encontrarStand(String cs){
224 | for(SeccionStand ss: seccionesStand){
225 | for(Stand s: ss.getSeccion()){
226 | if(s.getCodigoSt().equals(cs))return s;
227 | if(s.getCodigoSt().equals(cs+"*")) return s;
228 | }
229 | }
230 | return null;
231 | }
232 |
233 | //Verificar que la persona no sobrepase el limite de stands
234 | public int limiteStand(String numId){
235 | int cont=0;
236 | for(SeccionStand ss: seccionesStand){
237 | for(Stand s: ss.getSeccion()){
238 | if(s.getPersona()!=null){
239 | if(s.getPersona().getNumId().equals(numId)) cont++;
240 | }
241 | }
242 | }
243 | return cont;
244 | }
245 |
246 | //Buscar auspicianteEnFeria por auspiciante
247 | public AuspicianteEnFeria encontrarAuspicianteEnFeria(Auspiciante a){
248 | if(auspiciantesEnFeria.size()!=0){
249 | for(AuspicianteEnFeria aef: auspiciantesEnFeria){
250 | if(aef.getAuspiciante().getNumId().equals(a.getNumId())){
251 | return aef;
252 | }
253 | }
254 | }
255 | return null;
256 | }
257 | // Verificar que ya no esté el mismo auspiciante en Feria
258 | public static boolean verificarAuspiciante(ArrayList lista, Auspiciante a){
259 | for (AuspicianteEnFeria l:lista){
260 | if(l.getAuspiciante().equals(a)){
261 | return true;
262 | }
263 | }
264 | return false;
265 | }
266 |
267 | //Reservar stand a emprendedor o auspiciante
268 | public void reservarStand(String cs, String cp, String fa){
269 | Stand s= encontrarStand(cs);
270 | if(s.estaDisponible()){
271 | Persona p= Sistema.encontrarPersona(cp);
272 | int cont=0;
273 | if(p!=null && p instanceof Emprendedor){
274 | Emprendedor e= (Emprendedor)p;
275 | cont= limiteStand(e.getNumId());
276 | if(cont==0){
277 | s.setPersona(e);
278 | s.setFechaAsig(LocalDate.now());
279 | s.setcodigoSt(s.getCodigoSt()+"*");
280 | System.out.println("Stand asignado con exito");
281 | }else System.out.println("Ya tiene un stand asignado, solo puede tener un stand");
282 | }else if(p!=null && p instanceof Auspiciante){
283 | Auspiciante a= (Auspiciante)p;
284 | AuspicianteEnFeria anf= encontrarAuspicianteEnFeria(a);
285 | cont= limiteStand(anf.getAuspiciante().getNumId());
286 | if(cont<2){
287 | if(anf.getTieneStand()==true){
288 | s.setPersona(a);
289 | s.setFechaAsig(LocalDate.now());
290 | s.setcodigoSt(s.getCodigoSt()+"*");
291 | System.out.println("Stand asignado con exito");
292 | }else System.out.println("El auspiciante no debe tener stand, así él/ella lo decidió");
293 | }else System.out.println("El auspiciante ya tiene 2 stands asignado, solo puede tener max 2 stands");
294 | }else System.out.println("Esa persona no ha sido registrado o no existe");
295 | }else System.out.println("El stand se encuentra ocupado");
296 |
297 | }
298 |
299 | //Metodo que devuelve el numero de emprendedores de cada feria
300 | public int getNumeroEmprendedores(){
301 | int contador=0;
302 | for(SeccionStand ss: seccionesStand){
303 | for(Stand s: ss.getSeccion()){
304 | if(s.getPersona()!=null && s.getPersona() instanceof Emprendedor){
305 | contador++;
306 | }
307 | }
308 | }
309 | return contador;
310 | }
311 |
312 | //Metodo para devolver un String con los Auspiciantes
313 | public String getStringAuspiciantes(){
314 | String aus="["; //String para presentar los auspiciantes
315 | for(int j=0;j