a lot of work
This commit is contained in:
parent
404b68b791
commit
3aaf811190
@ -20,7 +20,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title">SERNATUR</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="icon_name">sernatur</property>
|
||||
<signal name="configure-event" handler="on_configure_event" swapped="no"/>
|
||||
<signal name="destroy" handler="on_destroy" swapped="no"/>
|
||||
<signal name="window-state-event" handler="on_window_state_event" swapped="no"/>
|
||||
|
@ -24,7 +24,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="default_width">800</property>
|
||||
<property name="default_height">600</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="icon_name">sernatur</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
|
@ -30,7 +30,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="icon_name">sernatur</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
@ -301,6 +300,25 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="places">
|
||||
<property name="label" translatable="yes">Places</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Add or edit places.</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="save">
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
@ -317,7 +335,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -16,5 +16,6 @@
|
||||
<gresource prefix="/cl/cromer/ubb/sernatur">
|
||||
<file preprocess="xml-stripblanks">tour.list.ui</file>
|
||||
<file preprocess="xml-stripblanks">tour.editor.ui</file>
|
||||
<file preprocess="xml-stripblanks">tour.places.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
@ -25,7 +25,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="default_height">480</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="icon_name">sernatur</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
@ -59,6 +58,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="enable_tree_lines">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="selection">
|
||||
<property name="mode">multiple</property>
|
||||
<signal name="changed" handler="on_changed_selection" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
@ -198,10 +198,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<object class="GtkButton" id="delete_tour">
|
||||
<property name="label" translatable="yes">Delete</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Delete selected tour.</property>
|
||||
<property name="halign">baseline</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
@ -215,6 +215,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Close this window.</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
262
data/ui/tour.places.ui
Normal file
262
data/ui/tour.places.ui
Normal file
@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1
|
||||
|
||||
Copyright 2018-2019 Chris Cromer
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-->
|
||||
<interface domain="sernatur">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkListStore" id="liststore1"/>
|
||||
<template class="SernaturTourPlaces" parent="GtkApplicationWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="type">popup</property>
|
||||
<property name="title" translatable="yes">Places</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="default_height">480</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
<property name="show_menubar">False</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="place_tree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="hscroll_policy">natural</property>
|
||||
<property name="vscroll_policy">natural</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="fixed_height_mode">True</property>
|
||||
<property name="enable_grid_lines">both</property>
|
||||
<property name="enable_tree_lines">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="selection">
|
||||
<property name="mode">multiple</property>
|
||||
<signal name="changed" handler="on_changed_selection" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="place_name">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Place Name</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="ticket_price">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Ticket Price</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="difficulty">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Difficulty</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="arrival_date">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Arrival Date</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">3</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="arrival_time">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Arrival Time</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">4</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="departure_date">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Departure Date</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">5</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="departure_time">
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="title" translatable="yes">Departure Time</property>
|
||||
<property name="clickable">True</property>
|
||||
<signal name="clicked" handler="on_clicked_column" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="markup">6</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column_spacing">25</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="edit_place">
|
||||
<property name="label" translatable="yes">Edit</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Edit associated place.</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="add_place">
|
||||
<property name="label" translatable="yes">Add</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Associate this tour with an existing place.</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="delete_place">
|
||||
<property name="label" translatable="yes">Delete</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Delete associated place.</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="close_place">
|
||||
<property name="label" translatable="yes">Close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Close this window.</property>
|
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="new_place">
|
||||
<property name="label" translatable="yes">New</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Create a new place to associate.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
29
lib/db.vala
29
lib/db.vala
@ -29,7 +29,11 @@ namespace LibSernatur {
|
||||
/**
|
||||
* Connection error
|
||||
*/
|
||||
CONNECT
|
||||
CONNECT,
|
||||
/**
|
||||
* Escape error
|
||||
*/
|
||||
ESCAPE
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,7 +53,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* Class to handle database connections
|
||||
*/
|
||||
public class Connection : GLib.Object {
|
||||
public class Connection : Object {
|
||||
/**
|
||||
* The database connection
|
||||
*/
|
||||
@ -71,7 +75,26 @@ namespace LibSernatur {
|
||||
if (db.get_status () != Postgres.ConnectionStatus.OK) {
|
||||
throw new PostgresError.CONNECT (db.get_error_message ());
|
||||
}
|
||||
GLib.print (dgettext (null, "Postgresql server version:") + " %d\n", db.get_server_version ());
|
||||
GLib.print (_ ("Postgresql server version:") + " %d\n", db.get_server_version ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape a string to be safe to use in Postgresql queries
|
||||
* @param str The string to escape
|
||||
* @return Returns the escaped string
|
||||
* @throws PostgresError Thrown if there was some problem escaping the string
|
||||
*/
|
||||
public string escape (string str) throws PostgresError {
|
||||
string* to = malloc ((sizeof (string) * str.length * 2) + 1); // to has to be double the size of str + 1
|
||||
int error_code;
|
||||
db.escape_string_conn (to, str, str.length, out error_code);
|
||||
if (error_code != 0) {
|
||||
throw new PostgresError.ESCAPE (db.get_error_message ());
|
||||
}
|
||||
|
||||
string result = to;
|
||||
free (to);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Arrienda class based on the database table
|
||||
*/
|
||||
public class Arrienda : GLib.Object {
|
||||
public class Arrienda : Object {
|
||||
/**
|
||||
* The price
|
||||
*/
|
||||
@ -54,11 +54,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Arrienda
|
||||
*/
|
||||
public static List<Arrienda> get_all_arriendas (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Arrienda> get_all_arriendas (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT A.precio, A.fecha_devolucion,
|
||||
V.patente, V.ano_vehiculo, V.marca, V.capacidad,
|
||||
E.rut_empresa, E.nombre_empresa, E.contacto, E.telefono
|
||||
@ -68,9 +68,9 @@ JOIN empresa E ON (A.rut_empresa = E.rut_empresa)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Arrienda> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Asociado class based on the database table
|
||||
*/
|
||||
public class Asociado : GLib.Object {
|
||||
public class Asociado : Object {
|
||||
public string fecha_llegada { get; set; default = ""; }
|
||||
public string hora_llegada { get; set; default = ""; }
|
||||
public string fecha_salida { get; set; default = ""; }
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Asociado
|
||||
*/
|
||||
public static List<Asociado> get_all_asociados (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Asociado> get_all_asociados (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT A.fecha_llegada, A.hora_llegada, A.fecha_salida, A.hora_salida,
|
||||
T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
@ -70,9 +70,9 @@ JOIN region R2 ON (C2.id_region = R2.id_region)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Asociado> ();
|
||||
#endif
|
||||
}
|
||||
@ -99,7 +99,72 @@ JOIN region R2 ON (C2.id_region = R2.id_region)
|
||||
)
|
||||
),
|
||||
new Lugar (wra.get_int_n (i, "id_lugar"),
|
||||
wra.get_string_n (i, "nombre_lugar"),
|
||||
wra.get_int_n (i, "valor_entrada"),
|
||||
wra.get_int_n (i, "nivel"),
|
||||
new Ciudad (wra.get_int_n (i, "id_ciudad_lugar"),
|
||||
wra.get_string_n (i, "nombre_ciudad_lugar"),
|
||||
new Region (wra.get_int_n (i, "id_region_lugar"),
|
||||
wra.get_string_n (i, "nombre_region_lugar")
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
list.append (asociado);
|
||||
}
|
||||
catch (Error e) {
|
||||
#if DEBUG
|
||||
error (e.message);
|
||||
#else
|
||||
warning (e.message);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Asociado based off a tour id
|
||||
*/
|
||||
public static List<Asociado> get_all_asociados_by_tour (Connection conn, Tour tour) throws PostgresError, DBError {
|
||||
if (tour.id_tour == 0) {
|
||||
throw new DBError.INVALID_VALUE (dgettext (null, "The id of the tour is invalid!"));
|
||||
}
|
||||
var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_ASSOCIATED_BY_TOUR, tour));
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Asociado> ();
|
||||
#endif
|
||||
}
|
||||
|
||||
var wra = new ResultWrapper (res);
|
||||
List<Asociado> list = new List<Asociado> ();
|
||||
int n = res.get_n_tuples ();
|
||||
for (int i = 0; i < n; i++) {
|
||||
try {
|
||||
var asociado = new Asociado (wra.get_string_n (i, "fecha_llegada"),
|
||||
wra.get_string_n (i, "hora_llegada"),
|
||||
wra.get_string_n (i, "fecha_salida"),
|
||||
wra.get_string_n (i, "hora_salida"),
|
||||
new Tour (wra.get_int_n (i, "id_tour"),
|
||||
wra.get_string_n (i, "nombre_tour"),
|
||||
wra.get_int_n (i, "costo_indiv"),
|
||||
wra.get_int_n (i, "costo_grupal"),
|
||||
wra.get_int_n (i, "minima_personas"),
|
||||
new Ciudad (wra.get_int_n (i, "id_ciudad"),
|
||||
wra.get_string_n (i, "nombre_ciudad"),
|
||||
new Region (wra.get_int_n (i, "id_region"),
|
||||
wra.get_string_n (i, "nombre_region")
|
||||
)
|
||||
)
|
||||
),
|
||||
new Lugar (wra.get_int_n (i, "id_lugar"),
|
||||
wra.get_string_n (i, "nombre_lugar"),
|
||||
wra.get_int_n (i, "valor_entrada"),
|
||||
wra.get_int_n (i, "nivel"),
|
||||
new Ciudad (wra.get_int_n (i, "id_ciudad_lugar"),
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Categoria class based on the database table
|
||||
*/
|
||||
public class Categoria : GLib.Object {
|
||||
public class Categoria : Object {
|
||||
/**
|
||||
* The id of the category
|
||||
*/
|
||||
@ -42,18 +42,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Categoria
|
||||
*/
|
||||
public static List<Categoria> get_all_categorias (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Categoria> get_all_categorias (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT id_categoria, descripcion_categoria FROM categoria
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Categoria> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Ciudad class based on the database table
|
||||
*/
|
||||
public class Ciudad : GLib.Object {
|
||||
public class Ciudad : Object {
|
||||
/**
|
||||
* The id of the city
|
||||
*/
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Ciudad
|
||||
*/
|
||||
public static List<Ciudad> get_all_ciudades (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Ciudad> get_all_ciudades (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region
|
||||
FROM ciudad C
|
||||
@ -60,9 +60,9 @@ JOIN region R ON (C.id_region = R.id_region)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Ciudad> ();
|
||||
#endif
|
||||
}
|
||||
@ -93,12 +93,12 @@ JOIN region R ON (C.id_region = R.id_region)
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database that are within a certain region
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @param region_id The id of the region to filter that results
|
||||
* @return Returns a list of Ciudad
|
||||
*/
|
||||
public static List<Ciudad> get_all_ciudades_in_region(Database conn, uint region_id) {
|
||||
var res = conn.exec ("
|
||||
public static List<Ciudad> get_all_ciudades_in_region(Connection conn, uint region_id) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region
|
||||
FROM ciudad C
|
||||
@ -107,9 +107,9 @@ WHERE (R.id_region = " + region_id.to_string () + ")
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Ciudad> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The ContactoEmergencia class based on the database table
|
||||
*/
|
||||
public class ContactoEmergencia : GLib.Object {
|
||||
public class ContactoEmergencia : Object {
|
||||
/**
|
||||
* The id of the contact
|
||||
*/
|
||||
@ -48,16 +48,16 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of ContactoEmergencia
|
||||
*/
|
||||
public static List<ContactoEmergencia> get_all_contactos (Database conn) {
|
||||
var res = conn.exec ("SELECT id_contacto, telefono_emergencia, nombre_emergencia FROM contacto_emergencia");
|
||||
public static List<ContactoEmergencia> get_all_contactos (Connection conn) {
|
||||
var res = conn.db.exec ("SELECT id_contacto, telefono_emergencia, nombre_emergencia FROM contacto_emergencia");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<ContactoEmergencia> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Descuento class based on the database table
|
||||
*/
|
||||
public class Descuento : GLib.Object {
|
||||
public class Descuento : Object {
|
||||
/**
|
||||
* The id of the discount
|
||||
*/
|
||||
@ -48,18 +48,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Descuento
|
||||
*/
|
||||
public static List<Descuento> get_all_descuentos (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Descuento> get_all_descuentos (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT id_descuento, descripcion_descuento, porcentaje FROM descuento
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Descuento> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Empresa class based on the database table
|
||||
*/
|
||||
public class Empresa : GLib.Object {
|
||||
public class Empresa : Object {
|
||||
/**
|
||||
* The RUT of the company
|
||||
*/
|
||||
@ -54,18 +54,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Empresa
|
||||
*/
|
||||
public static List<Empresa> get_all_empresas (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Empresa> get_all_empresas (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT rut_empresa, nombre_empresa, contacto, telefono FROM empresa
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Empresa> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Enfermedad class based on the database table
|
||||
*/
|
||||
public class Enfermedad : GLib.Object {
|
||||
public class Enfermedad : Object {
|
||||
/**
|
||||
* The id of the illness
|
||||
*/
|
||||
@ -42,18 +42,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Enfermedad
|
||||
*/
|
||||
public static List<Enfermedad> get_all_enfermedades (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Enfermedad> get_all_enfermedades (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT id_enfermedad, descripcion_enfermedad FROM enfermedad
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Enfermedad> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Esepcialidad class based on the database table
|
||||
*/
|
||||
public class Especialidad : GLib.Object {
|
||||
public class Especialidad : Object {
|
||||
/**
|
||||
* The id of the specialty
|
||||
*/
|
||||
@ -42,18 +42,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Especialidad
|
||||
*/
|
||||
public static List<Especialidad> get_all_especialidades (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Especialidad> get_all_especialidades (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT id_especialidad, descripcion_especialidad FROM especialidad
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Especialidad> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Guia class based on the database table
|
||||
*/
|
||||
public class Guia : GLib.Object {
|
||||
public class Guia : Object {
|
||||
/**
|
||||
* The RUT of the guide
|
||||
*/
|
||||
@ -60,11 +60,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Guia
|
||||
*/
|
||||
public static List<Guia> get_all_guias (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Guia> get_all_guias (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT G.rut_guia, G.nombre_guia, G.calle, G.numero,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region
|
||||
@ -74,9 +74,9 @@ JOIN region R ON (C.id_region = R.id_region)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Guia> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Lugar class based on the database table
|
||||
*/
|
||||
public class Lugar : GLib.Object {
|
||||
public class Lugar : Object {
|
||||
/**
|
||||
* The id of the place
|
||||
*/
|
||||
@ -60,11 +60,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Lugar
|
||||
*/
|
||||
public static List<Lugar> get_all_lugares (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Lugar> get_all_lugares (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT L.id_lugar, L.nombre_lugar, L.valor_entrada, L.nivel,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region
|
||||
@ -74,9 +74,9 @@ JOIN region R ON (C.id_region = R.id_region)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Lugar> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Participa class based on the database table
|
||||
*/
|
||||
public class Participa : GLib.Object {
|
||||
public class Participa : Object {
|
||||
/**
|
||||
* The tour
|
||||
*/
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Participa
|
||||
*/
|
||||
public static List<Participa> get_all_participas (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Participa> get_all_participas (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region,
|
||||
@ -71,9 +71,9 @@ JOIN categoria C3 ON (P.id_categoria = C3.id_categoria)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Participa> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Posee class based on the database table
|
||||
*/
|
||||
public class Posee : GLib.Object {
|
||||
public class Posee : Object {
|
||||
/**
|
||||
* The specialty level
|
||||
*/
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Posee
|
||||
*/
|
||||
public static List<Posee> get_all_posees (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Posee> get_all_posees (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT P.nivel_especialidad,
|
||||
G.rut_guia, G.nombre_guia, G.calle, G.numero,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
@ -66,9 +66,9 @@ JOIN especialidad E ON (P.id_especialidad = E.id_especialidad)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Posee> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Realiza class based on the database table
|
||||
*/
|
||||
public class Realiza : GLib.Object {
|
||||
public class Realiza : Object {
|
||||
/**
|
||||
* The tour
|
||||
*/
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Realiza
|
||||
*/
|
||||
public static List<Realiza> get_all_realizas (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Realiza> get_all_realizas (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
R.id_region, R.nombre_region,
|
||||
@ -69,9 +69,9 @@ JOIN descuento D ON (RE.id_descuento = D.id_descuento)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Realiza> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The Region class based on the database table
|
||||
*/
|
||||
public class Region : GLib.Object {
|
||||
public class Region : Object {
|
||||
/**
|
||||
* The id of the region
|
||||
*/
|
||||
@ -42,18 +42,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of Region
|
||||
*/
|
||||
public static List<Region> get_all_regiones (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<Region> get_all_regiones (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT id_region, nombre_region FROM region
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<Region> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The RegionesSinDescuento class based on the database table
|
||||
*/
|
||||
public class RegionesSinDescuento : GLib.Object {
|
||||
public class RegionesSinDescuento : Object {
|
||||
/**
|
||||
* The name of the region
|
||||
*/
|
||||
@ -41,18 +41,18 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of RegionesSinDescuento
|
||||
*/
|
||||
public static List<RegionesSinDescuento> get_all_regions_without_discount (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<RegionesSinDescuento> get_all_regions_without_discount (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT nombreRegion, cantidad FROM REGIONES_SINDESCUENTO
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<RegionesSinDescuento> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The RequerirAuto class based on the database table
|
||||
*/
|
||||
public class RequerirAuto : GLib.Object {
|
||||
public class RequerirAuto : Object {
|
||||
/**
|
||||
* The chofer
|
||||
*/
|
||||
@ -48,11 +48,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of RequerirAuto
|
||||
*/
|
||||
public static List<RequerirAuto> get_all_requerir_autos (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<RequerirAuto> get_all_requerir_autos (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT R.chofer,
|
||||
T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
|
||||
C.id_ciudad, C.nombre_ciudad,
|
||||
@ -66,9 +66,9 @@ Join vehiculo V ON (R.patente = V.patente)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||
error (conn.get_error_message ());
|
||||
error (conn.db.get_error_message ());
|
||||
#else
|
||||
warning (conn.get_error_message ());
|
||||
warning (conn.db.get_error_message ());
|
||||
return new List<RequerirAuto> ();
|
||||
#endif
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace LibSernatur {
|
||||
/**
|
||||
* The TieneEnfermedad class based on the database table
|
||||
*/
|
||||
public class TieneEnfermedad : GLib.Object {
|
||||
public class TieneEnfermedad : Object {
|
||||
/**
|
||||
* The tourist
|
||||
*/
|
||||
@ -42,11 +42,11 @@ namespace LibSernatur {
|
||||
|
||||
/**
|
||||
* Get all tuples and fields from database
|
||||
* @param conn The database connection to use
|
||||
* @param conn.db.The database conn.db.ction to use
|
||||
* @return Returns a list of TieneEnfermedad
|
||||
*/
|
||||
public static List<TieneEnfermedad> get_all_tiene_enfermedades (Database conn) {
|
||||
var res = conn.exec ("
|
||||
public static List<TieneEnfermedad> get_all_tiene_enfermedades (Connection conn) {
|
||||
var res = conn.db.exec ("
|
||||
SELECT T.rut_turista, T.nombre_turista, T.fecha_nacimento,
|
||||
C.id_contacto, C.telefono_emergencia, C.nombre_emergencia,
|
||||
E.id_enfermedad, E.descripcion_enfermedad
|
||||
@ -57,9 +57,9 @@ JOIN enfermedad E ON (TE.id_enfermedad = E.id_enfermedad)
|
||||
");
|
||||
if (res.get_status () != ExecStatus.TUPLES_OK) {
|
||||
#if DEBUG
|
||||