From be2238a4ef7de56534454cfa94f36d66da98b662 Mon Sep 17 00:00:00 2001 From: luca83 Date: Thu, 30 Oct 2008 17:18:57 +0000 Subject: [PATCH] Patch level :10.0 Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunta la funzione di cancellazione dei giri git-svn-id: svn://10.65.10.50/trunk@17516 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- lv/lv2200.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ lv/lv2200a.uml | 42 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/lv/lv2200.cpp b/lv/lv2200.cpp index 166cf2817..4bb659620 100755 --- a/lv/lv2200.cpp +++ b/lv/lv2200.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -23,6 +24,7 @@ class TGestione_planning_mask : public TAutomask private: void fill_sheet(); + void erase_sheet(); bool changed(TToken_string& oldrow, TToken_string& newrow, short id); int codice_riga(const TDate& data); void aggiorna_plan(); @@ -93,6 +95,51 @@ void TGestione_planning_mask::fill_sheet() sheet.force_update(); } +//questa funzione si occupa di cancellare tutti i dati visuliazzati nello sheet +void TGestione_planning_mask::erase_sheet() +{ + if (field(F_DADATA).empty() || field(F_ADATA).empty()) + return; + + TString query = "USE LVRCONSPLAN KEY 2"; + const long coditi = get_long(F_CODITI); + const long codcli = get_long(F_CODCF); + if (coditi || codcli) + { + query << " SELECT "; + if (codcli > 0) + query << "(CODCF=" << codcli << ')'; + if (coditi > 0) + { + if (codcli > 0) + query << "&&"; + query << "(CODITI=" << coditi << ')'; + } + } + query << "\n"; + query << "FROM DTCONS=" << get(F_DADATA) << "\n"; + query << "TO DTCONS=" << get(F_ADATA) << "\n"; + + TISAM_recordset plan(query); + + if (yesno_box(FR("Si desidera eliminare %ld righe?"),plan.items())) + { + TProgind pi(plan.items(), TR("Cancellazione giri in corso..."), false, true); + + TLocalisamfile& rplan = plan.cursor()->file(); + + for (bool ok = plan.move_first(); ok; ok = plan.move_next()) + { + if (!pi.addstatus(1)) + break; + rplan.remove(); + } + TSheet_field& sheet = sfield(F_PLAN); + sheet.destroy(); + sheet.force_update(); + } +} + //funzione che confronta due due campi di una TToken_string e restitusce true se sono diversi bool TGestione_planning_mask::changed(TToken_string& oldrow, TToken_string& newrow, short id) { @@ -322,6 +369,13 @@ bool TGestione_planning_mask::on_field_event(TOperable_field& o, TField_event e, { switch (o.dlg()) { + case DLG_DELREC: + if (e == fe_button) + { + erase_sheet(); + return false; + } + break; //se questi campi vengono riempiti, allora riempi lo sheet opportunamante case F_DADATA: case F_ADATA: diff --git a/lv/lv2200a.uml b/lv/lv2200a.uml index 3a62eda05..487554519 100755 --- a/lv/lv2200a.uml +++ b/lv/lv2200a.uml @@ -1,7 +1,47 @@ #include "lv2200a.h" TOOLBAR "" 0 0 0 2 -#include +BUTTON DLG_PRINT 2 2 +BEGIN + PROMPT 1 1 "Stampa" + PICTURE BMP_PRINT +END + +BUTTON DLG_SETPRINT 2 2 +BEGIN + PROMPT 2 1 "Imposta" + PICTURE BMP_SETPRINT +END + +BUTTON DLG_DELREC 2 2 +BEGIN + PROMPT 3 1 "Elimina" + PICTURE BMP_DELREC +END + +BUTTON DLG_INFO 2 2 +BEGIN + PROMPT 4 1 "Info" + MESSAGE EXIT,K_F2 + PICTURE BMP_INFO +END + +BUTTON DLG_HELP 2 2 +BEGIN + PROMPT 5 1 "Help" + MESSAGE EXIT,K_F1 + PICTURE BMP_HELP +END + +BUTTON DLG_QUIT 2 2 +BEGIN + PROMPT 6 1 "Fine" + MESSAGE EXIT,K_QUIT + PICTURE BMP_QUIT +END + + + ENDPAGE PAGE "Visualizzazione e modifica giri" -1 -1 76 20