Check-in [adf5a04eb7]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:correccion de hector y mi busqueda de nacionales
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:adf5a04eb701add760d4684a48d75a42f9a1968b
User & Date: malcon 2015-01-27 22:20:35
Context
2015-01-27
23:05
imagen a paquetes Leaf check-in: f6e277cd09 user: malcon tags: trunk
22:20
correccion de hector y mi busqueda de nacionales check-in: adf5a04eb7 user: malcon tags: trunk
2015-01-26
23:05
busqueda nacional check-in: 4ed5716b53 user: malcon tags: trunk
Changes

Changes to WebContent/WEB-INF/website/crucero.jsp.

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
            <div class="wrap">
                <div class="p-h">
                    <span>BUSCA TU</span>
                    <label>DESTINO</label>
                </div>
                <!---strat-date-piker---->
               
                <script>
                    $(function () {
                        $("#datepicker").datepicker();
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>

                <!---/End-date-piker---->
                <div class="p-ww">
                    <form>

                        <span>DONDE</span>
                        <input class="dest" type="text" value="Destino" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}">
                        <span>DESDE</span>
                        <input class="date hasDatepicker" id="datepicker" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">






                        <span>HASTA</span>
                        <input class="date hasDatepicker" id="datepicker2" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <input type="submit" value="Buscar">
                    </form>
                </div>




                <div class="clear"></div>
            </div>
        </div>

    </div>

    <!----//FIN BUSQUEDA DESTINO---->







<
<
<
<
<
<
<
<
>


<
>

<
<
<
>
>
>
>
>
|
<
<
<
|
|

>
>
>
>







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
            <div class="wrap">
                <div class="p-h">
                    <span>BUSCA TU</span>
                    <label>DESTINO</label>
                </div>
                <!---strat-date-piker---->
               








                
                <!---/End-date-piker---->
                <div class="p-ww">

           			<s:form action="buscarPaqueteCrucero" namespace="/paquete">
                        <span>DONDE</span>



                        <s:select list="destinos"  
			   				name="paquete.destino.id"
			   				listKey="id"
			   				listValue="nombre"
			   				/>
                    



                     	 <s:submit value="Buscar"/>
                  </s:form>
                </div>
                
               
				
				
                <div class="clear"></div>
            </div>
        </div>

    </div>

    <!----//FIN BUSQUEDA DESTINO---->

Changes to WebContent/WEB-INF/website/internacional.jsp.

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
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                    <form>
                        <span>DONDE</span>
                        <input class="dest" type="text" value="Destino" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}">
                        <span>DESDE</span>
                        <input class="date hasDatepicker" id="datepicker" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">


                        <span>HASTA</span>
                        <input class="date hasDatepicker" id="datepicker2" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <input type="submit" value="Buscar">
                    </form>
                </div>
                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>







|

|
|
|
<
>
|
<
|
|
|







21
22
23
24
25
26
27
28
29
30
31
32

33
34

35
36
37
38
39
40
41
42
43
44
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                   <s:form action="buscarPaqueteInternacional" namespace="/paquete">
                        <span>DONDE</span>
                        <s:select list="destinos"  
			   				name="paquete.destino.id"
			   				listKey="id"

			   				listValue="nombre"
			   				/>

                    
                     	 <s:submit value="Buscar"/>
                  </s:form>
                </div>
                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>

Changes to WebContent/WEB-INF/website/nacional.jsp.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
21
22
23
24
25
26
27
28
29
30
31
32


33
34
35

36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56




57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119



120
121
122
123
124

125
126
127

<div class="destinations">
    <div class="destination-head">
        <div class="wrap">
            <h3>NACIONAL</h3>
        </div>
        <!---End-destinatiuons---->

        <div class="find-place">
            <div class="wrap">
                <div class="p-h">
                    <span>BUSCA TU</span>
                    <label>DESTINO</label>
                </div>
                <!---strat-date-piker---->
................................................................................
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                    <form >
                        <span>DONDE</span>
                        <input class="dest" type="text" value="Destino" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}">
                        <span>DESDE</span>
                        <input class="date hasDatepicker" id="datepicker" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">



                        <span>HASTA</span>
                        <input class="date hasDatepicker" id="datepicker2" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">


                        <input type="submit" value="Buscar">
                    </form>

                </div>
                <s:debug></s:debug>
                <s:form action="buscarPaqueteNacional" namespace="/paquete">
					<s:select list="destinos" name="paquete.destino.codigo" listKey="codigo" listValue="nombre"  label="Destinos" />
					<s:submit value="Buscar"/>
				</s:form>
                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>
    <div class="destination-places">
        <div class="wrap">
            <div class="destination-places-head">
                <h3>Paquetes Nacionales</h3>
            </div>
            <div class="destination-places-grids">




                <div class="destination-places-grid" onclick="location.href='#';">
                    <div class="dest-place-pic main_box user_style4" data-hipop="two-horizontal">
                      
                        <img src="<s:url value="/images/d7.jpg" namespace="/"/>" title="place-name">
                        <a href="#" class="popup"></a>
                        <a href="#" class="popup2"></a>
                    </div>
                    <div class="dest-place-opt">
                        <ul class="dest-place-opt-fea">
                            <li><a class="hot" href="#"><span></span>Hotel</a></li>
                            <li><a class="plain" href="#"><span></span>Viaje Áreao</a></li>
                            <li><a class="Breakfast" href="#"><span></span>Almuerzo</a></li>
                            <div class="clear"></div>
                        </ul>
                        <ul class="dest-place-opt-cast">
                            <li><a class="d-place" href="#">Venice</a></li>
                            <li><a class="d-price" href="#">Viaje desde 250$</a></li>
                            <div class="clear"></div>
                        </ul>
                    </div>
                </div>
                <div class="destination-places-grid" onclick="location.href='#';">
                    <div class="dest-place-pic main_box user_style4" data-hipop="two-horizontal">
                 
                         <img src="<s:url value="/images/d6.jpg" namespace="/"/>" title="place-name">
                        <a href="#" class="popup"></a>
                        <a href="#" class="popup2"></a>
                    </div>
                    <div class="dest-place-opt">
                        <ul class="dest-place-opt-fea">
                             <li><a class="hot" href="#"><span></span>Hotel</a></li>
                            <li><a class="plain" href="#"><span></span>Viaje Áreao</a></li>
                            <li><a class="Breakfast" href="#"><span></span>Almuerzo</a></li>
                            <div class="clear"></div>
                        </ul>
                        <ul class="dest-place-opt-cast">
                            <li><a class="d-place" href="#">Venice</a></li>
                            <li><a class="d-price" href="#">Viaje desde 250$</a></li>
                            <div class="clear"></div>
                        </ul>
                    </div>
                </div>
                <div class="destination-places-grid last-d-grid" onclick="location.href='#';">
                    <div class="dest-place-pic main_box user_style4" data-hipop="two-horizontal">
                       
                         <img src="<s:url value="/images/d2.jpg" namespace="/"/>" title="place-name">
                        <a href="#" class="popup"></a>
                        <a href="#" class="popup2"></a>
                    </div>
                    <div class="dest-place-opt">
                        <ul class="dest-place-opt-fea">
                             <li><a class="hot" href="#"><span></span>Hotel</a></li>
                            <li><a class="plain" href="#"><span></span>Viaje Áreao</a></li>
                            <li><a class="Breakfast" href="#"><span></span>Almuerzo</a></li>

                            <div class="clear"></div>
                        </ul>
                        <ul class="dest-place-opt-cast">
                            <li><a class="d-place" href="#">Venice</a></li>
                            <li><a class="d-price" href="#">Viaje desde 250$</a></li>
                            <div class="clear"></div>
                        </ul>
                    </div>
                </div>






                <div class="clear"></div>
            </div>

        </div>
    </div>
    </div>







|







 







|
|
|
|
|
>
>
|
<
<
>
|
<
|
>

<
<
<
<
<












>
>
>
>
|
|
|
|
|
|
|
|
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
|
|
|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
>
|
|
<
<
<
<
<
|
|
>
>
>
|
|
<
<

>



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35


36
37

38
39
40





41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66












67









68
69
70








71









72
73
74





75
76
77
78
79
80
81


82
83
84
85
86

<div class="destinations">
    <div class="destination-head">
        <div class="wrap">
            <h3>NACIONAL</h3>
        </div>
        <!---End-destinatiuons---->
 
        <div class="find-place">
            <div class="wrap">
                <div class="p-h">
                    <span>BUSCA TU</span>
                    <label>DESTINO</label>
                </div>
                <!---strat-date-piker---->
................................................................................
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                <s:form action="buscarPaqueteNacional" namespace="/paquete">
							<span>DONDE</span>
			   		<s:select list="destinos"  
			   				name="paquete.destino.id"
			   				listKey="id"
			   				listValue="nombre"
			   				/>
							   					


					<s:submit value="Buscar"/>
					

				</s:form>
				
                </div>





                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>
    <div class="destination-places">
        <div class="wrap">
            <div class="destination-places-head">
                <h3>Paquetes Nacionales</h3>
            </div>
            <div class="destination-places-grids">
            
            	<s:if test="!paquetes.isEmpty">
            			<s:iterator value="paquetes" status="status">	
            
			                <div class="destination-places-grid" onclick="location.href='#';">
			                    <div class="dest-place-pic main_box user_style4" data-hipop="two-horizontal">
			                      
			                        <img src="<s:url value="/images/d7.jpg" namespace="/"/>" title="place-name">
			                        <a href="#" class="popup"></a>
			                        <a href="#" class="popup2"></a>
			                    </div>
			                    <div class="dest-place-opt">
			                        <ul class="dest-place-opt-fea">

			                            <li><a class="plain" href="#"><span></span><s:property value="nombre"/></a></li>












		                            









			                            <div class="clear"></div>
			                        </ul>
			                        <ul class="dest-place-opt-cast">








			                            









			                            <li><button>Reservar</button></li>
			                            <div class="clear"></div>
			                        </ul>





			                    </div>
			                </div>
                		</s:iterator>
				</s:if>
                <div class="clear"></div>
                
                


            </div>
            
        </div>
    </div>
    </div>

Changes to WebContent/WEB-INF/website/plantilla/menu.jsp.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
                
                 
                  
                 
                <li class="right" style=""><a href="<s:url action="contactenos" namespace="/web"/>">Contactenos</a>
                </li>
                <li class="right" style="">
                <a href="<s:url action="crucero" namespace="/web"/>">Crucero</a>
                </li>
                <li class="right" style=""><a href="<s:url action="internacional" namespace="/web"/>">Internacional</a></li>
                <li class="right" style=""><a href="<s:url action="nacional" namespace="/web"/>">Nacional</a>
                         <!--
                        <ul>
                            <li><a href="#">Dropdown item</a></li>
                            <li><a href="#">Dropdown item</a></li>







|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
                
                 
                  
                 
                <li class="right" style=""><a href="<s:url action="contactenos" namespace="/web"/>">Contactenos</a>
                </li>
                <li class="right" style="">
                <a href="<s:url action="crucero" namespace="/web"/>" >Crucero</a>
                </li>
                <li class="right" style=""><a href="<s:url action="internacional" namespace="/web"/>">Internacional</a></li>
                <li class="right" style=""><a href="<s:url action="nacional" namespace="/web"/>">Nacional</a>
                         <!--
                        <ul>
                            <li><a href="#">Dropdown item</a></li>
                            <li><a href="#">Dropdown item</a></li>

Changes to src/action/PaqueteAction.java.

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
package action;




import java.util.List;

import negocio.DestinoService;
import negocio.DestinoServiceDAO;
import negocio.PaqueteService;
import negocio.PaqueteServiceDAO;
import model.Destino;
import model.Paquete;


import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class PaqueteAction extends ActionSupport implements Preparable{

	private static final long serialVersionUID = 1L;
	private Paquete paquete= new Paquete();
	private List<Paquete> paquetes;
	private List<Destino> destinos;
	private PaqueteService paqueteService = new PaqueteServiceDAO();

	






	
	public Paquete getPaquete() {
		return paquete;
	}
	

















	public String buscarNacional() throws Exception {
		int codigo = 1;
		paquetes= paqueteService.buscar(codigo);



















		return SUCCESS;
	}
	
	@Override
	public void prepare() throws Exception {
		// TODO Auto-generated method stub











		DestinoService destinoService=new DestinoServiceDAO();
		destinos=destinoService.getDestinos("NA");
		System.out.println("action cliente" + destinos);


	}


}



>
>








>







|



>

>
>
>
>
>
>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

<
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>
>
>
>
>
>
>
>
>
>
|
|
<
>
>




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
package action;



import java.util.ArrayList;
import java.util.List;

import negocio.DestinoService;
import negocio.DestinoServiceDAO;
import negocio.PaqueteService;
import negocio.PaqueteServiceDAO;
import model.Destino;
import model.Paquete;


import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class PaqueteAction extends ActionSupport implements Preparable{

	private static final long serialVersionUID = 1L;
	private Paquete paquete;
	private List<Paquete> paquetes;
	private List<Destino> destinos;
	private PaqueteService paqueteService = new PaqueteServiceDAO();
	private String tipoDestino;
	
	public String getTipoDestino(){
		return tipoDestino;
	}
	public void setTipoDestino(String tipoDestino) {
	       this.tipoDestino = tipoDestino;
	}
	
	public Paquete getPaquete() {
		return paquete;
	}
	
	public void setPaquete(Paquete paquete) {
		this.paquete = paquete;
	}
	
	public void setPaquetes(List<Paquete> paquetes) {
		this.paquetes = paquetes;
	}

	public List<Paquete> getPaquetes() {
		return paquetes;
	}

	public List<Destino> getDestinos() {
		return destinos;
	}


	public String buscarNacional() throws Exception {


		
		 DestinoService destinoNacionalService=new DestinoServiceDAO();
		 destinos=destinoNacionalService.getDestinos("NA");
		 paquetes =paqueteService.buscar(paquete.getDestino().getId());
		 
		return SUCCESS;
	}
	
	public String buscarInternacional() throws Exception {
		
		 DestinoService destinoNacionalService=new DestinoServiceDAO();
		 destinos=destinoNacionalService.getDestinos("IN");
		return SUCCESS;
	}

	public String buscarCrucero() throws Exception {
	
		 DestinoService destinoNacionalService=new DestinoServiceDAO();
			destinos=destinoNacionalService.getDestinos("CR");
		return SUCCESS;
	}
	
	@Override
	public void prepare() throws Exception {
		// TODO Auto-generated method stub
		paquete = new Paquete();
		paquetes = new ArrayList<>();
	
		destinos = new ArrayList<>();

		
	}
	
	public String execute() throws Exception{
	  System.out.println("id2:" + getTipoDestino() );
	  
	  DestinoService destinoNacionalService=new DestinoServiceDAO();
		destinos=destinoNacionalService.getDestinos(getTipoDestino());

	  
	  return SUCCESS;
	}


}

Changes to src/model/Destino.java.

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
..
33
34
35
36
37
38
39
40
41


package model;

import java.io.Serializable;


public class Destino implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer codigo;
	private String nombre;
	private String descripcion;
	private String tipo_destino;
	
	
	public Integer getCodigo() {
		return codigo;
	}
	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}
	public String getNombre() {
		return nombre;
	}
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
................................................................................
	}
	public String getTipo_destino() {
		return tipo_destino;
	}
	public void setTipo_destino(String tipo_destino) {
		this.tipo_destino = tipo_destino;
	}
	
}





>






|





|
|

|
|







 







|
|
>
>
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
..
34
35
36
37
38
39
40
41
42
43
44
package model;

import java.io.Serializable;
import java.util.List;

public class Destino implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private String nombre;
	private String descripcion;
	private String tipo_destino;
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getNombre() {
		return nombre;
	}
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
................................................................................
	}
	public String getTipo_destino() {
		return tipo_destino;
	}
	public void setTipo_destino(String tipo_destino) {
		this.tipo_destino = tipo_destino;
	}

	
	
}

Changes to src/model/Paquete.java.

10
11
12
13
14
15
16

17















18
19
20
21
22
23
24
	private String descripcion;
	private String itinerario;
	private String tipo_paquete;
	private Float precio;
	private Moneda moneda;
	private Destino destino;
	

		















	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}







>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
	private String descripcion;
	private String itinerario;
	private String tipo_paquete;
	private Float precio;
	private Moneda moneda;
	private Destino destino;
	
	public Paquete() {
	}

	public Paquete(Integer id, String codigo, String nombre,
			String descripcion, String itinerario, String tipo_paquete,
			Float precio, Moneda moneda, Destino destino) {
		super();
		this.id = id;
		this.codigo = codigo;
		this.nombre = nombre;
		this.descripcion = descripcion;
		this.itinerario = itinerario;
		this.tipo_paquete = tipo_paquete;
		this.precio = precio;
		this.moneda = moneda;
		this.destino = destino;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}

Added src/model/Venta.java.









































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package model;

import java.util.Date;

public class Venta {
	
	public int id;
	public Date fe_venta;
	public Date fe_pago;
	public double monto;
	public String estado;
	public int cliente_id;
	public int reserva_id;
	
	public Venta(int id, Date fe_venta, Date fe_pago, double monto,
			String estado, int cliente_id, int reserva_id) {
		super();
		this.id = id;
		this.fe_venta = fe_venta;
		this.fe_pago = fe_pago;
		this.monto = monto;
		this.estado = estado;
		this.cliente_id = cliente_id;
		this.reserva_id = reserva_id;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getFe_venta() {
		return fe_venta;
	}

	public void setFe_venta(Date fe_venta) {
		this.fe_venta = fe_venta;
	}

	public Date getFe_pago() {
		return fe_pago;
	}

	public void setFe_pago(Date fe_pago) {
		this.fe_pago = fe_pago;
	}

	public double getMonto() {
		return monto;
	}

	public void setMonto(double monto) {
		this.monto = monto;
	}

	public String getEstado() {
		return estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}

	public int getCliente_id() {
		return cliente_id;
	}

	public void setCliente_id(int cliente_id) {
		this.cliente_id = cliente_id;
	}

	public int getReserva_id() {
		return reserva_id;
	}

	public void setReserva_id(int reserva_id) {
		this.reserva_id = reserva_id;
	}
	

}

Changes to src/negocio/DestinoServiceDAO.java.

9
10
11
12
13
14
15


16

17


18


19

20

21
22
23
import model.Destino;

public class DestinoServiceDAO implements DestinoService {

	@Override
	public List<Destino> getDestinos(String tipo) throws Exception {
		// TODO Auto-generated method stub


		SqlSession session=MyBatisUtil.getSqlSessionFactory().openSession();

		DestinoMapper destinoMapper = session.getMapper(DestinoMapper.class);


		List<Destino> destinos = destinoMapper.getDestinos(tipo);


		session.close();

		return destinos;

	}

}







>
>

>

>
>
|
>
>

>

>



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import model.Destino;

public class DestinoServiceDAO implements DestinoService {

	@Override
	public List<Destino> getDestinos(String tipo) throws Exception {
		// TODO Auto-generated method stub
		
		System.out.println("Entro al sevice");
		SqlSession session=MyBatisUtil.getSqlSessionFactory().openSession();
		System.out.println("1");
		DestinoMapper destinoMapper = session.getMapper(DestinoMapper.class);
		System.out.println("2");
		System.out.println(tipo);
		List<Destino> destinos = destinoMapper.obtenerDestinos(tipo);
		System.out.println(destinos.size());
		System.out.println("3");
		session.close();
		System.out.println("Salio del sevice");
		return destinos;

	}

}

Changes to src/negocio/PaqueteService.java.

4
5
6
7
8
9
10
11


import model.Paquete;

public interface PaqueteService {

	public Paquete obtener(Integer codigo) throws Exception;
	public List<Paquete> buscar(Integer destino_id) throws Exception;
}








|
>
4
5
6
7
8
9
10
11
12

import model.Paquete;

public interface PaqueteService {

	public Paquete obtener(Integer codigo) throws Exception;
	public List<Paquete> buscar(Integer destino_id) throws Exception;
	
}

Added src/negocio/VentaService.java.











>
>
>
>
>
1
2
3
4
5
package negocio;

public interface VentaService {

}

Added src/negocio/VentaServiceDAO.java.























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
package negocio;

import java.sql.Date;
import java.util.Calendar;

import model.Venta;

import org.apache.ibatis.session.SqlSession;

import persistencia.mybatis.mapper.VentaMapper;
import util.MyBatisUtil;

public class VentaServiceDAO {

	public void registrar(Venta venta) throws Exception {
		
		SqlSession session=MyBatisUtil.getSqlSessionFactory().openSession();
		VentaMapper mapper=session.getMapper(VentaMapper.class);
		
		venta.setFe_pago(new Date(Calendar.getInstance().getTime().getTime()));
    	mapper.registrar(venta);
    	
        session.commit();
        session.close();
        
	}
}

Changes to src/persistencia/mybatis/config/mybatis-config.xml.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28



29

30
31

32
33
34
35
36
37
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration 
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
	  <properties resource="persistencia/mybatis/config/config.properties"/>
	
	<settings>
		<setting name="defaultStatementTimeout" value="2"/>
	</settings>
	
	<typeAliases>
		<typeAlias type="model.Cliente" alias="cliente"/>
		<typeAlias type="model.Usuario" alias="usuario"/>
		<typeAlias type="model.Reserva" alias="reserva"/>
		<typeAlias type="model.Paquete" alias="paquete"/>
		<typeAlias type="model.Moneda" alias="moneda"/>
		<typeAlias type="model.Destino" alias="destino"/>

	</typeAliases>
	
    <environments default="clase">
    
        <environment id="clase">
            <transactionManager type="JDBC"/>
            <dataSource type="JNDI">
                <property name="data_source" value="java:comp/env/jdbc/daw1"/>



            </dataSource>  

        </environment>
    </environments>

    
    <mappers>
        <package name="persistencia.mybatis.mapper"/>    
    </mappers>
    
</configuration>







<












>


|



|
|
>
>
>
|
>


>






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
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration 
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>

	
	<settings>
		<setting name="defaultStatementTimeout" value="2"/>
	</settings>
	
	<typeAliases>
		<typeAlias type="model.Cliente" alias="cliente"/>
		<typeAlias type="model.Usuario" alias="usuario"/>
		<typeAlias type="model.Reserva" alias="reserva"/>
		<typeAlias type="model.Paquete" alias="paquete"/>
		<typeAlias type="model.Moneda" alias="moneda"/>
		<typeAlias type="model.Destino" alias="destino"/>
		<typeAlias type="model.Venta" alias="venta"/>
	</typeAliases>
	
     <environments default="clase">
    
        <environment id="clase">
            <transactionManager type="JDBC"/>
            <dataSource type="UNPOOLED">
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost/agenciadb"/>
                <property name="username" value="root"/>
                <property name="password" value="mysql"/>
            </dataSource>
            
        </environment>
    </environments>
    
    
    <mappers>
        <package name="persistencia.mybatis.mapper"/>    
    </mappers>
    
</configuration>

Changes to src/persistencia/mybatis/mapper/ClienteMapper.java.

2
3
4
5
6
7
8
9
10
11
12
13

import java.util.List;

import model.Cliente;

public interface ClienteMapper {

		List<Cliente> buscar(Cliente cliente);
		Cliente obtener(Integer codigo);
		void insertar(Cliente cliente);
		void actualizar(Cliente cliente);
}







|
|
|
|

2
3
4
5
6
7
8
9
10
11
12
13

import java.util.List;

import model.Cliente;

public interface ClienteMapper {

		public List<Cliente> buscar(Cliente cliente) throws Exception;
		public Cliente obtener(Integer codigo) throws Exception;
		public void insertar(Cliente cliente) throws Exception;
		public void actualizar(Cliente cliente) throws Exception;
}

Changes to src/persistencia/mybatis/mapper/DestinoMapper.java.

2
3
4
5
6
7
8
9
10
11

import java.util.List;

import model.Destino;

public interface DestinoMapper {

	List<Destino> getDestinos(String tipo) ;

}







|


2
3
4
5
6
7
8
9
10
11

import java.util.List;

import model.Destino;

public interface DestinoMapper {

	public List<Destino> obtenerDestinos(String tipo) throws Exception;

}

Changes to src/persistencia/mybatis/mapper/DestinoMapper.xml.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16


17

18
19
20
21
22
23
24
25
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper 
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

 <mapper namespace="persistencia.mybatis.mapper.DestinoMapper">

    <resultMap type="destino" id="rmDestinoByTipo">
        <id column="id" property="codigo"/>
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="tipo_destino" property="tipo_destino"/>
    </resultMap>
    

 	<select id="getDestinos" resultMap="rmDestinoByTipo" parameterType="string">


 		SELECT id, nombre, descripcion, tipo_destino 

 			FROM destino
 			WHERE 
 			tipo_destino = #{codigo}
 	</select>
 	
 	
 
 </mapper>







|

|
|
|
|
|
|
>
|
>
>
|
>

<
|


<
<

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
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper 
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

 <mapper namespace="persistencia.mybatis.mapper.DestinoMapper">
    
    <resultMap type="destino" id="rmDestinoByTipo">
		<result column="id" jdbcType="INTEGER" property="id" javaType="int"/>
		<result column="nombre" jdbcType="VARCHAR" property="nombre" javaType="string"/>
		<result column="descripcion" jdbcType="VARCHAR" property="descripcion" javaType="string"/>
		<result column="tipo_destino" jdbcType="VARCHAR" property="tipo_destino" javaType="string"/>
	</resultMap>
	
    
 	<select id="obtenerDestinos" resultMap="rmDestinoByTipo" parameterType="String">
 		SELECT id, 
 				nombre, 
 				descripcion, 
 				tipo_destino 
 			FROM destino

 			WHERE tipo_destino=#{tipo}
 	</select>
 	


 </mapper>

Changes to src/persistencia/mybatis/mapper/PaqueteMapper.java.

2
3
4
5
6
7
8
9
10
11


import java.util.List;

import model.Paquete;

public interface PaqueteMapper {

		List<Paquete> buscar(Integer destino_id);
		Paquete obtener(Integer codigo);
}








|
|
|
>
2
3
4
5
6
7
8
9
10
11
12

import java.util.List;

import model.Paquete;

public interface PaqueteMapper {

	public List<Paquete> buscar(Integer destino_id) throws Exception;;
	public Paquete obtener(Integer codigo) throws Exception;
	
}

Changes to src/persistencia/mybatis/mapper/PaqueteMapper.xml.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
     <resultMap type="paquete" id="rmPaqueteBusqueda">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio_base"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>
          <association property="destino" javaType="destino">
            	<result column = "nombre" property="nombre"/>
        </association>
     </resultMap>
     
    <select id="buscar" resultMap="rmPaqueteBusqueda" parameterType="int">
    	SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, pa.abrev, pd.nombre FROM paquete pa
			inner join paquete_has_destino pd on pd.paquete_id = pa.id

			WHERE pd.destino_id = #{id}
    </select>
    
    <resultMap type="paquete" id="rmPaqueteByPK">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio_base"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>
    </resultMap>
    
 	<select id="obtener" resultMap="rmPaqueteByPK" parameterType="integer">
 		SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, m.abrev FROM paquete pa
			inner join moneda m on m.id = pa.moneda_id
 			WHERE pa.id = #{codigo}
 	</select>
 	
 	
 
 
 </mapper>







|



|
|
|




|

>









|












|
<
<

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51


52
 
     <resultMap type="paquete" id="rmPaqueteBusqueda">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>
        <association property="destino" javaType="destino">
            <result column="destino_id" property="id"/>
        </association>   
     </resultMap>
     
    <select id="buscar" resultMap="rmPaqueteBusqueda" parameterType="int">
    	SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, mo.abrev, pd.destino_id FROM paquete pa
			inner join paquete_has_destino pd on pd.paquete_id = pa.id
			inner join moneda mo on mo.id = pa.moneda_id
			WHERE pd.destino_id = #{id}
    </select>
    
    <resultMap type="paquete" id="rmPaqueteByPK">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>
    </resultMap>
    
 	<select id="obtener" resultMap="rmPaqueteByPK" parameterType="integer">
 		SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, m.abrev FROM paquete pa
			inner join moneda m on m.id = pa.moneda_id
 			WHERE pa.id = #{codigo}
 	</select>
 	
 


 </mapper>

Changes to src/persistencia/mybatis/mapper/UsuarioMapper.java.

1
2
3
4
5
6
7
8
9
10
11
package persistencia.mybatis.mapper;


import model.Usuario;

public interface UsuarioMapper {
	
	String getAccess(Usuario usuario);
	void insertar(Usuario usuario);
	Usuario obtener(String email);
}







|
|
|

1
2
3
4
5
6
7
8
9
10
11
package persistencia.mybatis.mapper;


import model.Usuario;

public interface UsuarioMapper {
	
	public String getAccess(Usuario usuario) throws Exception;
	public void insertar(Usuario usuario) throws Exception;
	public Usuario obtener(String email) throws Exception;
}

Added src/persistencia/mybatis/mapper/VentaMapper.java.



















>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
package persistencia.mybatis.mapper;

import model.Venta;

public interface VentaMapper {

	public void registrar(Venta venta) throws Exception;
	
}

Added src/persistencia/mybatis/mapper/VentaMapper.xml.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper 
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

 <mapper namespace="persistencia.mybatis.mapper.VentaMapper">
 	
 	<insert id="registrar" parameterType="venta">
		INSERT INTO venta(fe_venta, monto, fe_pago, estado,cliente_id,reserva_id)
				VALUES (#{fe_venta},#{monto},#{fe_pago},estado,cliente_id,reserva_id);
	</insert>

 </mapper>

Changes to src/struts-paquete.xml.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
        "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
	<package name="struts-paquete" extends="demo" namespace="/paquete">
		
		<action name="buscarPaqueteNacional" class="action.PaqueteAction"
			method="buscarNacional">
			<result type="tiles">d_nacional_web</result>
			<result name="input" type="tiles">d_nacional_web</result>
		</action>
		
		<action name="buscarPaqueteInternacional" class="action.PaqueteAction"
			method="buscarInternacional">
			<result type="tiles">d_internacional_web</result>







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
        "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
	<package name="struts-paquete" extends="demo" namespace="/paquete">
		
		<action name="buscarPaqueteNacional" class="action.PaqueteAction"
			method="buscarNacional" >
			<result type="tiles">d_nacional_web</result>
			<result name="input" type="tiles">d_nacional_web</result>
		</action>
		
		<action name="buscarPaqueteInternacional" class="action.PaqueteAction"
			method="buscarInternacional">
			<result type="tiles">d_internacional_web</result>

Changes to src/struts-web.xml.

7
8
9
10
11
12
13
14

15
16
17
18

19
20
21
22

23
24
25
26
27
28
29
30
<struts>
	<package name="struts-web" extends="demo" namespace="/web">
		
		<action name="loginWeb">
			<result type="tiles">d_login_web</result>
		</action>
		
		<action name="nacional">

			<result type="tiles">d_nacional_web</result>
		</action>
		
		<action name="internacional">

			<result type="tiles">d_internacional_web</result>
		</action>
		
		<action name="crucero">

			<result type="tiles">d_crucero_web</result>
		</action>
		
		<action name="contactenos">
			<result type="tiles">d_contactenos_web</result>
		</action>
	</package>
</struts>







|
>



|
>



|
>








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
<struts>
	<package name="struts-web" extends="demo" namespace="/web">
		
		<action name="loginWeb">
			<result type="tiles">d_login_web</result>
		</action>
		
		<action name="nacional" class="action.PaqueteAction">
		    	<param name="tipoDestino">NA</param>
			<result type="tiles">d_nacional_web</result>
		</action>
		
		<action name="internacional" class="action.PaqueteAction">
		    	<param name="tipoDestino">IN</param>
			<result type="tiles">d_internacional_web</result>
		</action>
		
		<action name="crucero" class="action.PaqueteAction">
		    	<param name="tipoDestino">CR</param>
			<result type="tiles">d_crucero_web</result>
		</action>
		
		<action name="contactenos">
			<result type="tiles">d_contactenos_web</result>
		</action>
	</package>
</struts>

Changes to src/struts.xml.

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
..
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	<include file="struts-paquete.xml"/>
	<include file="struts-web.xml"/>
    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>
		
		<interceptors>
			<interceptor name="cronometro" class="interceptor.CronometroInterceptor"/>
			 <interceptor name="SesionAdmin" class="interceptor.SesionAdminInterceptor" />
			<interceptor-stack name="pitStack">
				<interceptor-ref name="cronometro"/>
				<!-- <interceptor-ref name="SesionAdmin"/> -->

			</interceptor-stack>
			
	
		</interceptors>
		
		
		
		<global-results>		
			<result name="null">/WEB-INF/error/nulo.jsp</result>
			<result name="noDisponible">/WEB-INF/error/noDisponible.jsp</result>
			<result name="login">/WEB-INF/admin/login.jsp</result>
		</global-results>
		
................................................................................
			</exception-mapping>
				
			<exception-mapping result="noDisponible" 
							   exception="java.lang.Exception">
			</exception-mapping>
		</global-exception-mappings>
			
		<action name="inicio">
			<result type="tiles">d_nacional_web</result>
		</action>

	</package>
	
</struts>







<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|






14
15
16
17
18
19
20














21
22
23
24
25
26
27
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	<include file="struts-paquete.xml"/>
	<include file="struts-web.xml"/>
    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>














		
		<global-results>		
			<result name="null">/WEB-INF/error/nulo.jsp</result>
			<result name="noDisponible">/WEB-INF/error/noDisponible.jsp</result>
			<result name="login">/WEB-INF/admin/login.jsp</result>
		</global-results>
		
................................................................................
			</exception-mapping>
				
			<exception-mapping result="noDisponible" 
							   exception="java.lang.Exception">
			</exception-mapping>
		</global-exception-mappings>
			
		<action name="inicio" class="action.PaqueteAction">
			<result type="tiles">d_nacional_web</result>
		</action>

	</package>
	
</struts>