From 242d192aa22a9f3c5d3a642a66894944cb6d9bbb Mon Sep 17 00:00:00 2001 From: Tolla Date: Thu, 19 Jul 2018 09:33:30 +0200 Subject: [PATCH] Patch level : 12.0 604 Files correlati : fp Commento : Aggiunto controllo bottoni --- src/fp/fp0100.cpp | 74 +++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/fp/fp0100.cpp b/src/fp/fp0100.cpp index 9f210f9a2..7ceb34419 100644 --- a/src/fp/fp0100.cpp +++ b/src/fp/fp0100.cpp @@ -114,51 +114,63 @@ bool TParametri_mask::on_field_event(TOperable_field& o, TField_event e, long jo break; case F_SETPATCH: { - TMask & m = get_tmp_msk("Livello patch"); - m.add_string(101, 0, "Versione ", 1, 1, 5, ""); - m.field(101).check_type(CHECK_REQUIRED); - if (m.run() == K_ENTER) + if (e == fe_button) { - TLocalisamfile tabmod(LF_TABMOD); - tabmod.put("MOD", "FP"); - tabmod.put("COD", "SQL"); - tabmod.put("CODTAB", "VERSION"); - tabmod.put("S0", m.get(101)); - if (tabmod.write_rewrite() == NOERR) - message_box("Versione impostata!"); - else - error_box("Errore durante la scrittura del DB Campo"); + TMask & m = get_tmp_msk("Livello patch"); + m.add_string(101, 0, "Versione ", 1, 1, 5, ""); + m.field(101).check_type(CHECK_REQUIRED); + if (m.run() == K_ENTER) + { + TLocalisamfile tabmod(LF_TABMOD); + tabmod.put("MOD", "FP"); + tabmod.put("COD", "SQL"); + tabmod.put("CODTAB", "VERSION"); + tabmod.put("S0", m.get(101)); + if (tabmod.write_rewrite() == NOERR) + message_box("Versione impostata!"); + else + error_box("Errore durante la scrittura del DB Campo"); + } } break; } case F_ENPTYTABLE: - if (yesno_box("Sei sicuro di voler svuotare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + if (e == fe_button) { - db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'TRUNCATE TABLE ? '"); - db().sq_commit(); - message_box("Procedura terminata"); + if (yesno_box("Sei sicuro di voler svuotare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + { + db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'TRUNCATE TABLE ? '"); + db().sq_commit(); + message_box("Procedura terminata"); + } } break; case F_DROPTABLE: - if (yesno_box("Sei sicuro di voler cancellare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + if (e == fe_button) { - db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'"); - db().sq_commit(); - message_box("Procedura terminata"); + if (yesno_box("Sei sicuro di voler cancellare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + { + db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'"); + db().sq_commit(); + message_box("Procedura terminata"); + } } break; case F_REBORNDB: - if (yesno_box("Sei sicuro di voler ricreare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + if (e == fe_button) { - db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'"); - TLocalisamfile tabmod(LF_TABMOD); - tabmod.put("MOD", "FP"); - tabmod.put("COD", "SQL"); - tabmod.put("CODTAB", "VERSION"); - tabmod.remove(); - check_tables(); - db().sq_commit(); - message_box("Procedura terminata"); + if (yesno_box("Sei sicuro di voler ricreare tutte le tabelle del database? Questa procedura NON É REVERSIBILE")) + { + db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'"); + TLocalisamfile tabmod(LF_TABMOD); + tabmod.put("MOD", "FP"); + tabmod.put("COD", "SQL"); + tabmod.put("CODTAB", "VERSION"); + tabmod.remove(); + check_tables(); + db().sq_commit(); + message_box("Procedura terminata"); + } } break; default: