const GdaDsnInfo *dsn;
+ GString *tmp;
+
guint id_vie;
gchar *nome;
gchar *m1_comu_cod;
}
id_vie++;
+ tmp = g_string_new (nome);
+ solipa_gstring_initial_capital (tmp);
sql = g_strdup_printf ("INSERT INTO vie (id, nome, id_comuni, cap)"
" VALUES (%d, '%s',"
" (SELECT c.id FROM comuni AS c INNER JOIN province AS p ON c.id_province = p.id WHERE p.cod_istat || c.cod_istat = '%s'),"
" '%s')",
id_vie,
- nome,
+ tmp->str,
m1_comu_cod,
m1_via_cap);
+ g_string_free (tmp, TRUE);
if (gdaex_execute (priv->commons->gdaex, sql) == -1)
{
g_free (sql);
{
id_vie = gdaex_data_model_get_value_integer_at (dm_territorio, 0, 0);
+ tmp = g_string_new (nome);
+ solipa_gstring_initial_capital (tmp);
+
/* aggiorno la via */
sql = g_strdup_printf ("UPDATE vie"
" SET nome = '%s',"
" id_comuni = (SELECT c.id FROM comuni AS c INNER JOIN province AS p ON c.id_province = p.id WHERE p.cod_istat || c.cod_istat = '%s'),"
" cap = '%s'"
" WHERE id = %d",
- nome,
+ tmp->str,
m1_comu_cod,
m1_via_cap,
id_vie);
+ g_string_free (tmp, TRUE);
if (gdaex_execute (priv->commons->gdaex, sql) == -1)
{
g_free (sql);
/*
- * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static gboolean
territorio_provincia_conferma_chiusura (TerritorioProvincia *territorio_provincia)
{
- GtkWidget *dialog;
-
gboolean ret;
TerritorioProvinciaPrivate *priv = TERRITORIO_PROVINCIA_GET_PRIVATE (territorio_provincia);