finish assignment for vehicles

This commit is contained in:
Chris Cromer 2019-01-20 18:09:16 -03:00
parent e6a7d9e1a7
commit eb58d519fb
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
10 changed files with 667 additions and 220 deletions

View File

@ -68,7 +68,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">Cancel the modification of this tour.</property>
<property name="tooltip_text" translatable="yes">Cancel the assignation of a vehicle.</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_top">5</property>
@ -83,7 +83,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
</child>
<child>
<object class="GtkButton" id="save">
<property name="label" translatable="yes">Assign</property>
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>

View File

@ -225,7 +225,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">:</property>
<property name="label">:</property>
<attributes>
<attribute name="font-desc" value="Monospace Bold 18"/>
</attributes>
@ -379,7 +379,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<object class="GtkSpinButton" id="hour2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
<property name="orientation">vertical</property>
@ -397,7 +396,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">:</property>
<property name="label">:</property>
<attributes>
<attribute name="font-desc" value="Monospace Bold 18"/>
</attributes>
@ -412,7 +411,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<object class="GtkSpinButton" id="minute2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="input_purpose">number</property>
<property name="orientation">vertical</property>
<property name="adjustment">minute_adjustment2</property>
@ -498,7 +496,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<object class="GtkSpinButton" id="day2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">1</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
<property name="adjustment">day_adjustment2</property>

View File

@ -50,20 +50,10 @@ namespace LibSernatur {
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns a list of RequerirAuto
* @throws PostgresError If there is a problem with with escaping strings
*/
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,
R2.id_region, R2.nombre_region,
V.patente, V.ano_vehiculo, V.marca, V.capacidad
FROM requerir_auto R
JOIN tour T ON (R.id_tour = T.id_tour)
JOIN ciudad C ON (T.id_ciudad = C.id_ciudad)
JOIN region R2 ON (C.id_region = R2.id_region)
Join vehiculo V ON (R.patente = V.patente)
");
public static List<RequerirAuto> get_all_requerir_autos (Connection conn) throws PostgresError {
var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_ALL_VEHICLE_REQUIRED));
if (res.get_status () != ExecStatus.TUPLES_OK) {
#if DEBUG
error (conn.db.get_error_message ());
@ -109,6 +99,114 @@ Join vehiculo V ON (R.patente = V.patente)
}
return list;
}
/**
* Get 1 tuple from the database based on tour id
* @param conn The database connection to use
* @return Returns a RequerirAuto
* @throws PostgresError If there is a problem with with escaping strings
*/
public static RequerirAuto? get_requerir_auto_by_tour (Connection conn, Tour tour) throws PostgresError {
var res = conn.db.exec (Query.get_query (conn, Query.Type.SELECT_VEHICLE_REQUIRED_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 null;
#endif
}
RequerirAuto requerir_auto = null;
var wra = new ResultWrapper(res);
int n = res.get_n_tuples ();
for (int i = 0; i < n; i++) {
try {
requerir_auto = new RequerirAuto (wra.get_string_n (i, "chofer"),
tour,
new Vehiculo (wra.get_string_n (i, "patente"),
wra.get_int_n (i, "ano_vehiculo"),
wra.get_string_n (i, "marca"),
wra.get_int_n (i, "capacidad")
)
);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
}
return requerir_auto;
}
/**
* Insert a require auto object in the database
* @param conn The database connection
* @param requerir_auto The require auto to insert
* @throws PostgresError Thrown if there is a problem with escaping strings
* @throws DBError Thrown if an invalid value is passed
*/
public static void insert_require_vehicle (Connection conn, RequerirAuto requerir_auto) throws PostgresError, DBError {
if (requerir_auto.tour.id_tour == 0 || requerir_auto.vehiculo.patente.strip () == "") {
throw new DBError.INVALID_VALUE (_ ("The id of the tour or the license plate for the vehicle is invalid!"));
}
var res = conn.db.exec (Query.get_query (conn, Query.Type.INSERT_VEHICLE_REQUIRED, requerir_auto));
if (res.get_status () != ExecStatus.COMMAND_OK) {
#if DEBUG
error (conn.db.get_error_message ());
#else
warning (conn.db.get_error_message ());
#endif
}
}
/**
* Update a require auto object in the database
* @param conn The database connection
* @param requerir_auto The require vehicle to update
* @throws PostgresError Thrown if there is a problem with escaping strings
* @throws DBError Thrown if an invalid value is passed
*/
public static void update_require_vehicle (Connection conn, RequerirAuto requerir_auto) throws PostgresError, DBError {
if (requerir_auto.tour.id_tour == 0 || requerir_auto.vehiculo.patente.strip () == "") {
throw new DBError.INVALID_VALUE (_ ("The id of the tour or the license plate for the vehicle is invalid!"));
}
var res = conn.db.exec (Query.get_query (conn, Query.Type.UPDATE_VEHICLE_REQUIRED, requerir_auto));
if (res.get_status () != ExecStatus.COMMAND_OK) {
#if DEBUG
error (conn.db.get_error_message ());
#else
warning (conn.db.get_error_message ());
#endif
}
}
/**
* Delete a required vehicle in the database
* @param conn The database connection
* @param tour The assigned tour used to delete
* @throws PostgresError Thrown if there is a problem with escaping strings
* @throws DBError Thrown if an invalid value is passed
*/
public static void delete_require_vehicle (Connection conn, Tour tour) throws PostgresError, DBError {
if (tour.id_tour == 0) {
throw new DBError.INVALID_VALUE (_ ("The id of the tour is invalid!"));
}
var res = conn.db.exec (Query.get_query (conn, Query.Type.DELETE_VEHICLE_REQUIRED, tour));
if (res.get_status () != ExecStatus.COMMAND_OK) {
if (res.get_error_field (FieldCode.SQLSTATE) == "23503") {
throw new DBError.FOREIGN_KEY_CONSTAINT (res.get_error_field (FieldCode.MESSAGE_PRIMARY));
}
#if DEBUG
error (conn.db.get_error_message ());
#else
warning (conn.db.get_error_message ());
#endif
}
}
}
}
}

View File

@ -34,10 +34,15 @@ namespace LibSernatur {
SELECT_ALL_ASSOCIATED,
SELECT_ALL_ASSOCIATED_BY_TOUR,
INSERT_ASSOCIATED,
DELETE_ASSOCIATED
DELETE_ASSOCIATED,
SELECT_ALL_VEHICLE_REQUIRED,
SELECT_VEHICLE_REQUIRED_BY_TOUR,
INSERT_VEHICLE_REQUIRED,
UPDATE_VEHICLE_REQUIRED,
DELETE_VEHICLE_REQUIRED
}
public static string get_query (Connection conn, Type type, T? t) throws PostgresError {
public static string get_query (Connection conn, Type type, T? t = null) throws PostgresError {
switch (type) {
case SELECT_ALL_CITIES:
return "
@ -214,6 +219,58 @@ DELETE FROM associated
WHERE (
id_tour = " + asociado.tour.id_tour.to_string () + " AND
id_lugar = " + asociado.lugar.id_lugar.to_string () + "
)";
case SELECT_ALL_VEHICLE_REQUIRED:
return "
SELECT R.chofer,
T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,
C.id_ciudad, C.nombre_ciudad,
R2.id_region, R2.nombre_region,
V.patente, V.ano_vehiculo, V.marca, V.capacidad
FROM requerir_auto R
JOIN tour T ON (R.id_tour = T.id_tour)
JOIN ciudad C ON (T.id_ciudad = C.id_ciudad)
JOIN region R2 ON (C.id_region = R2.id_region)
JOIN vehiculo V ON (R.patente = V.patente)";
case SELECT_VEHICLE_REQUIRED_BY_TOUR:
Tour tour = (Tour) t;
return "
SELECT R.chofer,
V.patente, V.ano_vehiculo, V.marca, V.capacidad
FROM requerir_auto R
JOIN vehiculo V ON (R.patente = V.patente)
WHERE (
id_tour = " + tour.id_tour.to_string () + "
)";
case INSERT_VEHICLE_REQUIRED:
RequerirAuto requerir_auto = (RequerirAuto) t;
return "
INSERT INTO requerir_auto
(id_tour, patente, chofer)
VALUES
(
" + requerir_auto.tour.id_tour.to_string () + ",
'" + conn.escape (requerir_auto.vehiculo.patente) + "',
'" + conn.escape (requerir_auto.chofer) + "'
)";
case UPDATE_VEHICLE_REQUIRED:
RequerirAuto requerir_auto = (RequerirAuto) t;
return "
UPDATE requerir_auto SET
patente = '" + conn.escape (requerir_auto.vehiculo.patente) + "',
chofer = '" + conn.escape (requerir_auto.chofer) + "'
WHERE id_tour = " + requerir_auto.tour.id_tour.to_string ();
case DELETE_VEHICLE_REQUIRED:
Tour tour = (Tour) t;
return "
DELETE FROM requerir_auto
WHERE (
id_tour = " + tour.id_tour.to_string () + "
)";
default:

View File

@ -11,6 +11,7 @@ src/main_window.vala
src/tour_list.vala
src/tour_editor.vala
src/tour_places.vala
src/tour_assign_vehicle.vala
src/query_window.vala
data/ui/main.window.ui
data/ui/main.splash.ui

169
po/es.po
View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sernatur\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-20 03:02-0300\n"
"PO-Revision-Date: 2019-01-20 03:09-0300\n"
"POT-Creation-Date: 2019-01-20 17:47-0300\n"
"PO-Revision-Date: 2019-01-20 17:51-0300\n"
"Last-Translator: Chris Cromer <chris@cromer.cl>\n"
"Language-Team: none\n"
"Language: es\n"
@ -89,9 +89,10 @@ msgstr "Versión de SERNATUR: "
msgid "Error: Could not connect to the database!"
msgstr "Error: No se puede conectar al base de datos!"
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:218
#: src/tour_editor.vala:235 src/tour_editor.vala:267 src/tour_editor.vala:284
#: src/tour_editor.vala:316 src/tour_editor.vala:333
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:231
#: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
#: src/tour_editor.vala:329 src/tour_editor.vala:346
#: src/tour_assign_vehicle.vala:99
msgid "Error"
msgstr "Error"
@ -112,50 +113,58 @@ msgstr ""
"Error: No se puede borrar el tour \"%s\" porque este tour ya fue realizado o "
"todavía esta asociado con lugares ó vehículos!"
#: src/tour_editor.vala:214
#: src/tour_editor.vala:227
msgid "Error: Tour name cannot be left blank!"
msgstr "Error: El nombre del tour no puede estar en blanco!"
#: src/tour_editor.vala:231
#: src/tour_editor.vala:244
#, c-format
msgid "Error: A tour named \"%s\" already exists!"
msgstr "Error: Un tour con el nombre \"%s\" ya existe!"
#: src/tour_editor.vala:263
#: src/tour_editor.vala:276
msgid "Error: City name cannot be left blank!"
msgstr "Error: El nombre de la ciudad no puede estar en blanco!"
#: src/tour_editor.vala:280
#: src/tour_editor.vala:293
#, c-format
msgid "Error: A city named \"%s\" already exists!"
msgstr "Error: Una ciudad con el nombre \"%s\" ya existe!"
#: src/tour_editor.vala:312
#: src/tour_editor.vala:325
msgid "Error: Region name cannot be left blank!"
msgstr "Error: El nombre de la región no puede estar en blanco!"
#: src/tour_editor.vala:329
#: src/tour_editor.vala:342
#, c-format
msgid "Error: A region named \"%s\" already exists!"
msgstr "Error: Una región con el nombre \"%s\" ya existe!"
#: src/query_window.vala:290 data/ui/main.window.ui:135
#: src/tour_assign_vehicle.vala:95
msgid "Error: The chofer's name cannot be left blank!"
msgstr "Error: El nombre del chofer no puede estar en blanco!"
#: src/tour_assign_vehicle.vala:247
msgid "Unassigned"
msgstr "Sin asignar"
#: src/query_window.vala:290 data/ui/main.window.ui:127
msgid "(Q1) Regions with discounts"
msgstr "(Q1) Regiones sin descuentos"
#: src/query_window.vala:303 data/ui/main.window.ui:143
#: src/query_window.vala:303 data/ui/main.window.ui:135
msgid "(Q2) Tour values"
msgstr "(Q2) Valores tour"
#: src/query_window.vala:316 data/ui/main.window.ui:151
#: src/query_window.vala:316 data/ui/main.window.ui:143
msgid "(Q3) Coordinator total"
msgstr "(Q3) Total de coordinadores"
#: src/query_window.vala:329 data/ui/main.window.ui:159
#: src/query_window.vala:329 data/ui/main.window.ui:151
msgid "(Q4) Tourist total"
msgstr "(Q4) Total de turistas"
#: src/query_window.vala:342 data/ui/main.window.ui:167
#: src/query_window.vala:342 data/ui/main.window.ui:159
msgid "(Q5) Vehicle total"
msgstr "(Q5) Total de vehículos"
@ -183,15 +192,11 @@ msgstr "Enfermedades"
msgid "Participate"
msgstr "Participar"
#: data/ui/main.window.ui:99
msgid "Vehicles"
msgstr "Vehículos"
#: data/ui/main.window.ui:113
#: data/ui/main.window.ui:105
msgid "Quit"
msgstr "Salir"
#: data/ui/main.window.ui:125
#: data/ui/main.window.ui:117
msgid "_Views"
msgstr "_Vistas"
@ -259,7 +264,7 @@ msgstr "Cerrar"
msgid "Close this window."
msgstr "Cerrar esta ventana."
#: data/ui/tour.editor.ui:29
#: data/ui/tour.editor.ui:29 data/ui/tour.assign.vehicle.ui:22
msgid "Tour Editor"
msgstr "Editor de Tour"
@ -271,7 +276,8 @@ msgstr "Crear una nueva región con escribir aquí."
msgid "Create a new city by typing here."
msgstr "Crear una nueva ciudad con escribir aquí."
#: data/ui/tour.editor.ui:286 data/ui/place.editor.ui:250
#: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
#: data/ui/tour.assign.vehicle.ui:67 data/ui/place.editor.ui:250
msgid "Cancel"
msgstr "Cancelar"
@ -287,11 +293,20 @@ msgstr "Lugares"
msgid "Add or edit places."
msgstr "Agregar o editar places."
#: data/ui/tour.editor.ui:324 data/ui/place.editor.ui:269
#: data/ui/tour.editor.ui:324 data/ui/tour.assign.vehicle.ui:47
msgid "Vehicle"
msgstr "Vehículo"
#: data/ui/tour.editor.ui:328
msgid "Assign a vehicle to this tour."
msgstr "Asignar un vehículo a este tour."
#: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
#: data/ui/tour.assign.vehicle.ui:86 data/ui/place.editor.ui:269
msgid "Save"
msgstr "Guardar"
#: data/ui/tour.editor.ui:328
#: data/ui/tour.editor.ui:347
msgid "Save this tour."
msgstr "Guardar este tour."
@ -335,18 +350,110 @@ msgstr "Asociar este tour con un lugar que ya existe."
msgid "Create a new place to associate."
msgstr "Crear un lugar nuevo para asociar con el tour."
#: data/ui/place.editor.ui:27
msgid "Place Editor"
msgstr "Editor de Lugar"
#: data/ui/tour.place.editor.ui:66
msgid "Add Place"
msgstr "Agregar Lugar"
#: data/ui/place.editor.ui:254
#: data/ui/tour.place.editor.ui:97
msgid "Place"
msgstr "Lugar"
#: data/ui/tour.place.editor.ui:113
msgid "Arrival"
msgstr "Llegada"
#: data/ui/tour.place.editor.ui:129
msgid "Departure"
msgstr "Salida"
#: data/ui/tour.place.editor.ui:153 data/ui/place.editor.ui:254
msgid "Cancel the modification of this place."
msgstr "Cancelar la modificación de este lugar."
#: data/ui/place.editor.ui:273
#: data/ui/tour.place.editor.ui:172 data/ui/place.editor.ui:273
msgid "Save this place."
msgstr "Guardar este lugar."
#: data/ui/tour.place.editor.ui:270 data/ui/tour.place.editor.ui:440
msgid "Year"
msgstr "Año"
#: data/ui/tour.place.editor.ui:286 data/ui/tour.place.editor.ui:456
msgid "Month"
msgstr "Mes"
#: data/ui/tour.place.editor.ui:298 data/ui/tour.place.editor.ui:472
msgid "Day"
msgstr "Día"
#: data/ui/tour.place.editor.ui:341 data/ui/tour.place.editor.ui:517
msgid "January"
msgstr "Enero"
#: data/ui/tour.place.editor.ui:342 data/ui/tour.place.editor.ui:518
msgid "February"
msgstr "Febraro"
#: data/ui/tour.place.editor.ui:343 data/ui/tour.place.editor.ui:519
msgid "March"
msgstr "Marzo"
#: data/ui/tour.place.editor.ui:344 data/ui/tour.place.editor.ui:520
msgid "April"
msgstr "Abril"
#: data/ui/tour.place.editor.ui:345 data/ui/tour.place.editor.ui:521
msgid "May"
msgstr "Mayo"
#: data/ui/tour.place.editor.ui:346 data/ui/tour.place.editor.ui:522
msgid "June"
msgstr "Junio"
#: data/ui/tour.place.editor.ui:347 data/ui/tour.place.editor.ui:523
msgid "July"
msgstr "Julio"
#: data/ui/tour.place.editor.ui:348 data/ui/tour.place.editor.ui:524
msgid "August"
msgstr "Agosto"
#: data/ui/tour.place.editor.ui:349 data/ui/tour.place.editor.ui:525
msgid "September"
msgstr "Septiembre"
#: data/ui/tour.place.editor.ui:350 data/ui/tour.place.editor.ui:526
msgid "October"
msgstr "Octubre"
#: data/ui/tour.place.editor.ui:351 data/ui/tour.place.editor.ui:527
msgid "November"
msgstr "Noviembre"
#: data/ui/tour.place.editor.ui:352 data/ui/tour.place.editor.ui:528
msgid "December"
msgstr "Diciembre"
#: data/ui/tour.assign.vehicle.ui:71
msgid "Cancel the assignation of a vehicle."
msgstr "Cancelar la asignación de un vehículo."
#: data/ui/tour.assign.vehicle.ui:90
msgid "Assign this vehicle to the tour."
msgstr "Asignar este vehículo al tour."
#: data/ui/tour.assign.vehicle.ui:119
msgid "Chofer"
msgstr "Conductor"
#: data/ui/tour.assign.vehicle.ui:147
msgid "The licence plate, make, year, and capacity of the vehicle."
msgstr "La patente, marca, año y capacidad del vehículo."
#: data/ui/place.editor.ui:27
msgid "Place Editor"
msgstr "Editor de Lugar"
#: data/ui/query.window.ui:84
msgid "Run"
msgstr "Correr"

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sernatur\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-20 03:02-0300\n"
"PO-Revision-Date: 2019-01-20 03:10-0300\n"
"POT-Creation-Date: 2019-01-20 17:47-0300\n"
"PO-Revision-Date: 2019-01-20 17:54-0300\n"
"Last-Translator: Chris Cromer <chris@cromer.cl>\n"
"Language-Team: none\n"
"Language: es\n"
@ -89,9 +89,10 @@ msgstr "Versión de SERNATUR: "
msgid "Error: Could not connect to the database!"
msgstr "Puta la wea: No se puede conectar al base de datos!"
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:218
#: src/tour_editor.vala:235 src/tour_editor.vala:267 src/tour_editor.vala:284
#: src/tour_editor.vala:316 src/tour_editor.vala:333
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:231
#: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
#: src/tour_editor.vala:329 src/tour_editor.vala:346
#: src/tour_assign_vehicle.vala:99
msgid "Error"
msgstr "Puta la wea"
@ -112,50 +113,58 @@ msgstr ""
"Puta la wea: No se puede borrar la wea \"%s\" porque esta wea ya fue "
"realizada o la wea todavía esta asociado con lugares ó vehículos!"
#: src/tour_editor.vala:214
#: src/tour_editor.vala:227
msgid "Error: Tour name cannot be left blank!"
msgstr "Error: El nombre de la wea no puede estar en blanco!"
#: src/tour_editor.vala:231
#: src/tour_editor.vala:244
#, c-format
msgid "Error: A tour named \"%s\" already exists!"
msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
#: src/tour_editor.vala:263
#: src/tour_editor.vala:276
msgid "Error: City name cannot be left blank!"
msgstr "Error: El nombre de la wea no puede estar en blanco!"
#: src/tour_editor.vala:280
#: src/tour_editor.vala:293
#, c-format
msgid "Error: A city named \"%s\" already exists!"
msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
#: src/tour_editor.vala:312
#: src/tour_editor.vala:325
msgid "Error: Region name cannot be left blank!"
msgstr "Error: El nombre de la wea no puede estar en blanco!"
#: src/tour_editor.vala:329
#: src/tour_editor.vala:342
#, c-format
msgid "Error: A region named \"%s\" already exists!"
msgstr "Error: Una wea con el nombre \"%s\" ya existe!"
#: src/query_window.vala:290 data/ui/main.window.ui:135
#: src/tour_assign_vehicle.vala:95
msgid "Error: The chofer's name cannot be left blank!"
msgstr "Error: El nombre del weon no puede estar en blanco!"
#: src/tour_assign_vehicle.vala:247
msgid "Unassigned"
msgstr "Ninguna wea"
#: src/query_window.vala:290 data/ui/main.window.ui:127
msgid "(Q1) Regions with discounts"
msgstr "(Q1) Regiones sin descuentos"
#: src/query_window.vala:303 data/ui/main.window.ui:143
#: src/query_window.vala:303 data/ui/main.window.ui:135
msgid "(Q2) Tour values"
msgstr "(Q2) Valores tour"
#: src/query_window.vala:316 data/ui/main.window.ui:151
#: src/query_window.vala:316 data/ui/main.window.ui:143
msgid "(Q3) Coordinator total"
msgstr "(Q3) Total de coordinadores"
#: src/query_window.vala:329 data/ui/main.window.ui:159
#: src/query_window.vala:329 data/ui/main.window.ui:151
msgid "(Q4) Tourist total"
msgstr "(Q4) Total de turistas"
#: src/query_window.vala:342 data/ui/main.window.ui:167
#: src/query_window.vala:342 data/ui/main.window.ui:159
msgid "(Q5) Vehicle total"
msgstr "(Q5) Total de vehículos"
@ -183,15 +192,11 @@ msgstr "Enfermedades"
msgid "Participate"
msgstr "Participar"
#: data/ui/main.window.ui:99
msgid "Vehicles"
msgstr "Vehículos"
#: data/ui/main.window.ui:113
#: data/ui/main.window.ui:105
msgid "Quit"
msgstr "Salir de la wea"
#: data/ui/main.window.ui:125
#: data/ui/main.window.ui:117
msgid "_Views"
msgstr "_Vistas"
@ -259,7 +264,7 @@ msgstr "Cerrar la wea"
msgid "Close this window."
msgstr "Cerrar la wea."
#: data/ui/tour.editor.ui:29
#: data/ui/tour.editor.ui:29 data/ui/tour.assign.vehicle.ui:22
msgid "Tour Editor"
msgstr "Editor de la Wea"
@ -271,7 +276,8 @@ msgstr "Crear una nueva wea con escribir aquí."
msgid "Create a new city by typing here."
msgstr "Crear una nueva wea con escribir aquí."
#: data/ui/tour.editor.ui:286 data/ui/place.editor.ui:250
#: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
#: data/ui/tour.assign.vehicle.ui:67 data/ui/place.editor.ui:250
msgid "Cancel"
msgstr "Cancelar la wea"
@ -287,11 +293,20 @@ msgstr "Lugares"
msgid "Add or edit places."
msgstr "Agregar o editar places."
#: data/ui/tour.editor.ui:324 data/ui/place.editor.ui:269
#: data/ui/tour.editor.ui:324 data/ui/tour.assign.vehicle.ui:47
msgid "Vehicle"
msgstr "Vehículo"
#: data/ui/tour.editor.ui:328
msgid "Assign a vehicle to this tour."
msgstr "Asignar un vehículo a esta wea."
#: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
#: data/ui/tour.assign.vehicle.ui:86 data/ui/place.editor.ui:269
msgid "Save"
msgstr "Guardar la wea"
#: data/ui/tour.editor.ui:328
#: data/ui/tour.editor.ui:347
msgid "Save this tour."
msgstr "Guardar esta wea."
@ -335,18 +350,110 @@ msgstr "Asociar esta wea con un lugar que ya existe."
msgid "Create a new place to associate."
msgstr "Crear una wea nueva para asociar con el tour."
#: data/ui/place.editor.ui:27
msgid "Place Editor"
msgstr "Editor de la Wea"
#: data/ui/tour.place.editor.ui:66
msgid "Add Place"
msgstr "Agregar Lugar"
#: data/ui/place.editor.ui:254
#: data/ui/tour.place.editor.ui:97
msgid "Place"
msgstr "Lugar"
#: data/ui/tour.place.editor.ui:113
msgid "Arrival"
msgstr "Llegada"
#: data/ui/tour.place.editor.ui:129
msgid "Departure"
msgstr "Salida"
#: data/ui/tour.place.editor.ui:153 data/ui/place.editor.ui:254
msgid "Cancel the modification of this place."
msgstr "Cancelar la modificación de esta wea."
#: data/ui/place.editor.ui:273
#: data/ui/tour.place.editor.ui:172 data/ui/place.editor.ui:273
msgid "Save this place."
msgstr "Guardar esta wea."
#: data/ui/tour.place.editor.ui:270 data/ui/tour.place.editor.ui:440
msgid "Year"
msgstr "Año"
#: data/ui/tour.place.editor.ui:286 data/ui/tour.place.editor.ui:456
msgid "Month"
msgstr "Mes"
#: data/ui/tour.place.editor.ui:298 data/ui/tour.place.editor.ui:472
msgid "Day"
msgstr "Día"
#: data/ui/tour.place.editor.ui:341 data/ui/tour.place.editor.ui:517
msgid "January"
msgstr "Enero"
#: data/ui/tour.place.editor.ui:342 data/ui/tour.place.editor.ui:518
msgid "February"
msgstr "Febraro"
#: data/ui/tour.place.editor.ui:343 data/ui/tour.place.editor.ui:519
msgid "March"
msgstr "Marzo"
#: data/ui/tour.place.editor.ui:344 data/ui/tour.place.editor.ui:520
msgid "April"
msgstr "Abril"
#: data/ui/tour.place.editor.ui:345 data/ui/tour.place.editor.ui:521
msgid "May"
msgstr "Mayo"
#: data/ui/tour.place.editor.ui:346 data/ui/tour.place.editor.ui:522
msgid "June"
msgstr "Junio"
#: data/ui/tour.place.editor.ui:347 data/ui/tour.place.editor.ui:523
msgid "July"
msgstr "Julio"
#: data/ui/tour.place.editor.ui:348 data/ui/tour.place.editor.ui:524
msgid "August"
msgstr "Agosto"
#: data/ui/tour.place.editor.ui:349 data/ui/tour.place.editor.ui:525
msgid "September"
msgstr "Septiembre"
#: data/ui/tour.place.editor.ui:350 data/ui/tour.place.editor.ui:526
msgid "October"
msgstr "Octubre"
#: data/ui/tour.place.editor.ui:351 data/ui/tour.place.editor.ui:527
msgid "November"
msgstr "Noviembre"
#: data/ui/tour.place.editor.ui:352 data/ui/tour.place.editor.ui:528
msgid "December"
msgstr "Diciembre"
#: data/ui/tour.assign.vehicle.ui:71
msgid "Cancel the assignation of a vehicle."
msgstr "Cancelar la asignación a esta wea."
#: data/ui/tour.assign.vehicle.ui:90
msgid "Assign this vehicle to the tour."
msgstr "Asignar esta wea al tour."
#: data/ui/tour.assign.vehicle.ui:119
msgid "Chofer"
msgstr "Conductor"
#: data/ui/tour.assign.vehicle.ui:147
msgid "The licence plate, make, year, and capacity of the vehicle."
msgstr "La patente, marca, año y capacidad de la wea."
#: data/ui/place.editor.ui:27
msgid "Place Editor"
msgstr "Editor de la Wea"
#: data/ui/query.window.ui:84
msgid "Run"
msgstr "Correr la wea"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sernatur\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-20 03:02-0300\n"
"POT-Creation-Date: 2019-01-20 17:47-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -84,9 +84,10 @@ msgstr ""
msgid "Error: Could not connect to the database!"
msgstr ""
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:218
#: src/tour_editor.vala:235 src/tour_editor.vala:267 src/tour_editor.vala:284
#: src/tour_editor.vala:316 src/tour_editor.vala:333
#: src/main_window.vala:228 src/tour_list.vala:233 src/tour_editor.vala:231
#: src/tour_editor.vala:248 src/tour_editor.vala:280 src/tour_editor.vala:297
#: src/tour_editor.vala:329 src/tour_editor.vala:346
#: src/tour_assign_vehicle.vala:99
msgid "Error"
msgstr ""
@ -105,50 +106,58 @@ msgid ""
"or is still associated with a place or vehicle!"
msgstr ""
#: src/tour_editor.vala:214
#: src/tour_editor.vala:227
msgid "Error: Tour name cannot be left blank!"
msgstr ""
#: src/tour_editor.vala:231
#: src/tour_editor.vala:244
#, c-format
msgid "Error: A tour named \"%s\" already exists!"
msgstr ""
#: src/tour_editor.vala:263
#: src/tour_editor.vala:276
msgid "Error: City name cannot be left blank!"
msgstr ""
#: src/tour_editor.vala:280
#: src/tour_editor.vala:293
#, c-format
msgid "Error: A city named \"%s\" already exists!"
msgstr ""
#: src/tour_editor.vala:312
#: src/tour_editor.vala:325
msgid "Error: Region name cannot be left blank!"
msgstr ""
#: src/tour_editor.vala:329
#: src/tour_editor.vala:342
#, c-format
msgid "Error: A region named \"%s\" already exists!"
msgstr ""
#: src/query_window.vala:290 data/ui/main.window.ui:135
#: src/tour_assign_vehicle.vala:95
msgid "Error: The chofer's name cannot be left blank!"
msgstr ""
#: src/tour_assign_vehicle.vala:247
msgid "Unassigned"
msgstr ""
#: src/query_window.vala:290 data/ui/main.window.ui:127
msgid "(Q1) Regions with discounts"
msgstr ""
#: src/query_window.vala:303 data/ui/main.window.ui:143
#: src/query_window.vala:303 data/ui/main.window.ui:135
msgid "(Q2) Tour values"
msgstr ""
#: src/query_window.vala:316 data/ui/main.window.ui:151
#: src/query_window.vala:316 data/ui/main.window.ui:143
msgid "(Q3) Coordinator total"
msgstr ""
#: src/query_window.vala:329 data/ui/main.window.ui:159
#: src/query_window.vala:329 data/ui/main.window.ui:151
msgid "(Q4) Tourist total"
msgstr ""
#: src/query_window.vala:342 data/ui/main.window.ui:167
#: src/query_window.vala:342 data/ui/main.window.ui:159
msgid "(Q5) Vehicle total"
msgstr ""
@ -176,15 +185,11 @@ msgstr ""
msgid "Participate"
msgstr ""
#: data/ui/main.window.ui:99
msgid "Vehicles"
msgstr ""
#: data/ui/main.window.ui:113
#: data/ui/main.window.ui:105
msgid "Quit"
msgstr ""
#: data/ui/main.window.ui:125
#: data/ui/main.window.ui:117
msgid "_Views"
msgstr ""
@ -252,7 +257,7 @@ msgstr ""
msgid "Close this window."
msgstr ""
#: data/ui/tour.editor.ui:29
#: data/ui/tour.editor.ui:29 data/ui/tour.assign.vehicle.ui:22
msgid "Tour Editor"
msgstr ""
@ -264,7 +269,8 @@ msgstr ""
msgid "Create a new city by typing here."
msgstr ""
#: data/ui/tour.editor.ui:286 data/ui/place.editor.ui:250
#: data/ui/tour.editor.ui:286 data/ui/tour.place.editor.ui:149
#: data/ui/tour.assign.vehicle.ui:67 data/ui/place.editor.ui:250
msgid "Cancel"
msgstr ""
@ -280,11 +286,20 @@ msgstr ""
msgid "Add or edit places."
msgstr ""
#: data/ui/tour.editor.ui:324 data/ui/place.editor.ui:269
msgid "Save"
#: data/ui/tour.editor.ui:324 data/ui/tour.assign.vehicle.ui:47
msgid "Vehicle"
msgstr ""
#: data/ui/tour.editor.ui:328
msgid "Assign a vehicle to this tour."
msgstr ""
#: data/ui/tour.editor.ui:343 data/ui/tour.place.editor.ui:168
#: data/ui/tour.assign.vehicle.ui:86 data/ui/place.editor.ui:269
msgid "Save"
msgstr ""
#: data/ui/tour.editor.ui:347
msgid "Save this tour."
msgstr ""
@ -328,18 +343,110 @@ msgstr ""
msgid "Create a new place to associate."
msgstr ""
#: data/ui/place.editor.ui:27
msgid "Place Editor"
#: data/ui/tour.place.editor.ui:66
msgid "Add Place"
msgstr ""
#: data/ui/place.editor.ui:254
#: data/ui/tour.place.editor.ui:97
msgid "Place"
msgstr ""
#: data/ui/tour.place.editor.ui:113
msgid "Arrival"
msgstr ""
#: data/ui/tour.place.editor.ui:129
msgid "Departure"
msgstr ""
#: data/ui/tour.place.editor.ui:153 data/ui/place.editor.ui:254
msgid "Cancel the modification of this place."
msgstr ""
#: data/ui/place.editor.ui:273
#: data/ui/tour.place.editor.ui:172 data/ui/place.editor.ui:273
msgid "Save this place."
msgstr ""
#: data/ui/tour.place.editor.ui:270 data/ui/tour.place.editor.ui:440
msgid "Year"
msgstr ""
#: data/ui/tour.place.editor.ui:286 data/ui/tour.place.editor.ui:456
msgid "Month"
msgstr ""
#: data/ui/tour.place.editor.ui:298 data/ui/tour.place.editor.ui:472
msgid "Day"
msgstr ""
#: data/ui/tour.place.editor.ui:341 data/ui/tour.place.editor.ui:517
msgid "January"
msgstr ""
#: data/ui/tour.place.editor.ui:342 data/ui/tour.place.editor.ui:518
msgid "February"
msgstr ""
#: data/ui/tour.place.editor.ui:343 data/ui/tour.place.editor.ui:519
msgid "March"
msgstr ""
#: data/ui/tour.place.editor.ui:344 data/ui/tour.place.editor.ui:520
msgid "April"
msgstr ""
#: data/ui/tour.place.editor.ui:345 data/ui/tour.place.editor.ui:521
msgid "May"
msgstr ""
#: data/ui/tour.place.editor.ui:346 data/ui/tour.place.editor.ui:522
msgid "June"
msgstr ""
#: data/ui/tour.place.editor.ui:347 data/ui/tour.place.editor.ui:523
msgid "July"
msgstr ""
#: data/ui/tour.place.editor.ui:348 data/ui/tour.place.editor.ui:524
msgid "August"
msgstr ""
#: data/ui/tour.place.editor.ui:349 data/ui/tour.place.editor.ui:525
msgid "September"
msgstr ""
#: data/ui/tour.place.editor.ui:350 data/ui/tour.place.editor.ui:526
msgid "October"
msgstr ""
#: data/ui/tour.place.editor.ui:351 data/ui/tour.place.editor.ui:527
msgid "November"
msgstr ""
#: data/ui/tour.place.editor.ui:352 data/ui/tour.place.editor.ui:528
msgid "December"
msgstr ""
#: data/ui/tour.assign.vehicle.ui:71
msgid "Cancel the assignation of a vehicle."
msgstr ""
#: data/ui/tour.assign.vehicle.ui:90
msgid "Assign this vehicle to the tour."
msgstr ""
#: data/ui/tour.assign.vehicle.ui:119
msgid "Chofer"
msgstr ""
#: data/ui/tour.assign.vehicle.ui:147
msgid "The licence plate, make, year, and capacity of the vehicle."
msgstr ""
#: data/ui/place.editor.ui:27
msgid "Place Editor"
msgstr ""
#: data/ui/query.window.ui:84
msgid "Run"
msgstr ""

View File

@ -69,6 +69,10 @@ namespace Sernatur {
* A list of the vehicles from the database
*/
private List<Vehiculo> vehicles;
/**
* A vehicle required object from the database
*/
private RequerirAuto require_vehicle;
/**
* The list that stores the vehicles for the combo box
*/
@ -76,19 +80,19 @@ namespace Sernatur {
/**
* This signal is called when a vehicle is assigned
*/
public signal void save_vehicle (Vehiculo vehicle);
public signal void save_vehicle (RequerirAuto? requerir_auto);
/**
* Validate the car data before trying to insert it into the database
* Validate the vehicle data before trying to insert it into the database
* @return Returns true if the data is valid
*/
private bool validate_car_data () {
/*if (tour.nombre_tour.strip () == "") {
private bool validate_vehicle_data () {
if (require_vehicle.chofer.strip () == "") {
var msg = new Gtk.MessageDialog (this,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE,
_ ("Error: Tour name cannot be left blank!"));
_ ("Error: The chofer's name cannot be left blank!"));
msg.response.connect ((response_id) => {
msg.destroy ();
});
@ -96,34 +100,6 @@ namespace Sernatur {
msg.run ();
return false;
}
bool list_success = true;
try {
List<Tour> list = Tour.get_all_tours (conn);
list.foreach ((entry) => {
if (tour.nombre_tour.down () == entry.nombre_tour.down () && tour.id_tour != entry.id_tour) {
var msg = new Gtk.MessageDialog (this,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE,
_ ("Error: A tour named \"%s\" already exists!"), entry.nombre_tour);
msg.response.connect ((response_id) => {
msg.destroy ();
});
msg.set_title (_ ("Error"));
msg.run ();
list_success = false;
}
});
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
return false;
#endif
}
return list_success;*/
return true;
}
@ -140,9 +116,10 @@ namespace Sernatur {
Vehiculo temp_vehicle;
vehicle_list_store.get (iter,
Column.VEHICLE, out temp_vehicle);
chofer.sensitive = true;
}
else {
// Unassigned
chofer.sensitive = false;
}
}
}
@ -154,26 +131,21 @@ namespace Sernatur {
[GtkCallback]
public void on_clicked_button (Gtk.Button button) {
if (button == save) {
/*if (update_tour_instance () && validate_tour_data ()) {
if (tour.id_tour == 0) {
if (update_vehicle_instance ()) {
if (require_vehicle.tour.id_tour != 0) {
try {
Tour.insert_tour (conn, tour);
if (list_asociado != null) {
// Insert all the pending associations
list_asociado.foreach ((entry) => {
try {
Asociado.insert_asociado (conn, entry);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
});
if (require_vehicle.chofer.strip () == "") {
RequerirAuto.delete_require_vehicle (conn, tour);
}
save_tour (); // Signal the parent to update itself
else {
if (RequerirAuto.get_requerir_auto_by_tour (conn, require_vehicle.tour) == null) {
RequerirAuto.insert_require_vehicle (conn, require_vehicle);
}
else {
RequerirAuto.update_require_vehicle (conn, require_vehicle);
}
}
save_vehicle (null); // Signal the parent to update itself
this.close ();
}
catch (Error e) {
@ -185,22 +157,11 @@ namespace Sernatur {
}
}
else {
try {
Tour.update_tour (conn, tour);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
finally {
save_tour (); // Signal the parent to update itself
this.close ();
}
// Send it to the parent, only insert tuple if tour gets created
save_vehicle (require_vehicle); // Signal the parent to update itself
this.close ();
}
}*/
}
}
else if (button == cancel) {
this.close ();
@ -209,44 +170,25 @@ namespace Sernatur {
/**
* Update the the vehicle object with new info from the editor
* @return Returns false if the data is invalid
*/
private bool update_vehicle_instance () {
/*tour.nombre_tour = tour_name.get_text ().strip ();
tour.costo_indiv = (uint) int.parse (indiv_cost.get_text ());
tour.costo_grupal = (uint) int.parse (group_cost.get_text ());
tour.minima_personas = (uint) minimum_people.get_value_as_int ();
if (region.get_active () == -1) {
Region new_region = new Region (0, region.get_active_text ().strip ());
try {
if (validate_region_data (new_region)) {
new_region.id_region = Region.insert_region (conn, new_region);
return update_tour_instance_city (new_region);
}
else {
return false;
}
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
if (vehicle.get_active () > 0) {
require_vehicle.chofer = chofer.get_text ().strip ();
Vehiculo new_vehicle;
Gtk.TreeIter iter;
vehicle.get_active_iter (out iter);
vehicle_list_store.get (iter,
Column.VEHICLE, out new_vehicle);
if (!validate_vehicle_data ()) {
return false;
}
require_vehicle.vehiculo = new_vehicle;
}
else {
Region new_region;
Gtk.TreeIter iter;
region.get_active_iter (out iter);
if (region_list_store.iter_is_valid (iter)) {
region_list_store.get (iter,
RegionColumn.REGION, out new_region);
}
else {
new_region = new Region ();
}
return update_tour_instance_city (new_region);
}*/
require_vehicle.vehiculo = new Vehiculo ();
require_vehicle.chofer = "";
}
return true;
}
@ -268,6 +210,10 @@ namespace Sernatur {
public void initialize () {
try {
vehicles = Vehiculo.get_all_vehiculos (conn);
require_vehicle = RequerirAuto.get_requerir_auto_by_tour (conn, tour);
if (require_vehicle == null) {
require_vehicle = new RequerirAuto ("", tour, new Vehiculo ());
}
}
catch (Error e) {
#if DEBUG
@ -278,7 +224,15 @@ namespace Sernatur {
}
vehicles.sort_with_data ((a, b) => {
return strcmp (a.patente, b.patente);
if (a.capacidad < b.capacidad) {
return -1;
}
else if (a.capacidad == b.capacidad) {
return 0;
}
else {
return 1;
}
});
vehicle_list_store = new Gtk.ListStore (Column.N_COLUMNS,
@ -298,9 +252,11 @@ namespace Sernatur {
vehicle_list_store.set (iter,
Column.VEHICLE_DETAILS, entry.patente + " " + entry.marca + " " + entry.ano_vehiculo.to_string () + " " + entry.capacidad.to_string (),
Column.VEHICLE, entry);
/*if (entry.patente == assigned_vehicle.patente) {
if (require_vehicle.vehiculo.patente.strip () != "" && entry.patente == require_vehicle.vehiculo.patente) {
vehicle.set_active_iter (iter);
}*/
chofer.set_text (require_vehicle.chofer);
chofer.sensitive = true;
}
});
}
}

View File

@ -140,7 +140,7 @@ namespace Sernatur {
/**
* The vehicle to be inserted if the new tour is saved
*/
private Vehiculo vehiculo = null;
private RequerirAuto requerir_auto = null;
/**
* This signal is called when a tour is saved
*/
@ -386,6 +386,18 @@ namespace Sernatur {
}
});
}
if (requerir_auto != null) {
try {
RequerirAuto.insert_require_vehicle (conn, requerir_auto);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
}
save_tour (); // Signal the parent to update itself
this.close ();
}
@ -447,14 +459,18 @@ namespace Sernatur {
/**
* Called when a vehcile is assigned to the tour, and the tour is not in the database yet
* @param tour_assign_vehicle The TourAssignVehicle instance that called this signal
* @param vehicle The vehicle to assign to this tour
* @param requerir_auto The vehicle to assign to this tour
*/
private void on_save_vehicle (TourAssignVehicle tour_assign_vehicle, Vehiculo vehiculo) {
this.vehiculo = vehiculo;
private void on_save_vehicle (TourAssignVehicle tour_assign_vehicle, RequerirAuto? requerir_auto) {
if (requerir_auto != null) {
this.requerir_auto = requerir_auto;
vehicle.sensitive = false;
}
}
/**
* Update the the tour object with new info from the editor
* @return Returns false if the information is not valid
*/
private bool update_tour_instance () {
tour.nombre_tour = tour_name.get_text ().strip ();
@ -499,6 +515,7 @@ namespace Sernatur {
/**
* This method updates the city part of the tour instance
* @param new_region The region to insert into the city object
* @return Returns false if the information is not valid
*/
private bool update_tour_instance_city (Region new_region) {
Ciudad ciudad;