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; break;
case F_SETPATCH: case F_SETPATCH:
{ {
TMask & m = get_tmp_msk("Livello patch"); if (e == fe_button)
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); TMask & m = get_tmp_msk("Livello patch");
tabmod.put("MOD", "FP"); m.add_string(101, 0, "Versione ", 1, 1, 5, "");
tabmod.put("COD", "SQL"); m.field(101).check_type(CHECK_REQUIRED);
tabmod.put("CODTAB", "VERSION"); if (m.run() == K_ENTER)
tabmod.put("S0", m.get(101)); {
if (tabmod.write_rewrite() == NOERR) TLocalisamfile tabmod(LF_TABMOD);
message_box("Versione impostata!"); tabmod.put("MOD", "FP");
else tabmod.put("COD", "SQL");
error_box("Errore durante la scrittura del DB Campo"); 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; break;
} }
case F_ENPTYTABLE: 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 ? '"); if (yesno_box("Sei sicuro di voler svuotare tutte le tabelle del database? Questa procedura NON É REVERSIBILE"))
db().sq_commit(); {
message_box("Procedura terminata"); db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'TRUNCATE TABLE ? '");
db().sq_commit();
message_box("Procedura terminata");
}
} }
break; break;
case F_DROPTABLE: 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 ?'"); if (yesno_box("Sei sicuro di voler cancellare tutte le tabelle del database? Questa procedura NON É REVERSIBILE"))
db().sq_commit(); {
message_box("Procedura terminata"); db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'");
db().sq_commit();
message_box("Procedura terminata");
}
} }
break; break;
case F_REBORNDB: 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 ?'"); if (yesno_box("Sei sicuro di voler ricreare tutte le tabelle del database? Questa procedura NON É REVERSIBILE"))
TLocalisamfile tabmod(LF_TABMOD); {
tabmod.put("MOD", "FP"); db().sq_set_exec("EXEC sp_MSforeachtable @command1 = 'DROP TABLE ?'");
tabmod.put("COD", "SQL"); TLocalisamfile tabmod(LF_TABMOD);
tabmod.put("CODTAB", "VERSION"); tabmod.put("MOD", "FP");
tabmod.remove(); tabmod.put("COD", "SQL");
check_tables(); tabmod.put("CODTAB", "VERSION");
db().sq_commit(); tabmod.remove();
message_box("Procedura terminata"); check_tables();
db().sq_commit();
message_box("Procedura terminata");
}
} }
break; break;
default: default: