Patch level : 12.0 604

Files correlati     : fp
Commento            : Aggiunto controllo bottoni
This commit is contained in:
Tolla 2018-07-19 09:33:30 +02:00
parent 278e579e67
commit 242d192aa2

View File

@ -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: