Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@17848 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a8984dd075
commit
503e94d37a
@ -1,5 +1,6 @@
|
|||||||
#include <automask.h>
|
#include <automask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
#include <progind.h>
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
|
|
||||||
#include "lv0400.h"
|
#include "lv0400.h"
|
||||||
@ -136,9 +137,12 @@ protected:
|
|||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
virtual int write(const TMask& m);
|
virtual int write(const TMask& m);
|
||||||
virtual int rewrite(const TMask& m);
|
virtual int rewrite(const TMask& m);
|
||||||
|
virtual bool protected_record(TRectype & rec);
|
||||||
virtual bool remove();
|
virtual bool remove();
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
virtual void init_insert_mode(TMask& m);
|
virtual void init_insert_mode(TMask& m);
|
||||||
|
bool elimina_planning(const TDate& data, const long& codcont, const long& codcf) const;
|
||||||
|
bool kill_planning (TISAM_recordset& selrighe) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TContratti_app:: user_create()
|
bool TContratti_app:: user_create()
|
||||||
@ -314,6 +318,46 @@ int TContratti_app::rewrite(const TMask& m)
|
|||||||
if(err==NOERR) save_rows(m);
|
if(err==NOERR) save_rows(m);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TContratti_app::protected_record(TRectype & rec)
|
||||||
|
{
|
||||||
|
TLaundry_contract cont(rec);
|
||||||
|
return !cont.can_be_deleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TContratti_app::elimina_planning(const TDate& data, const long& codcont, const long& codcf) const
|
||||||
|
{
|
||||||
|
//creo il recordset
|
||||||
|
TISAM_recordset selrighe("USE LVRCONSPLAN KEY 3\nSELECT DTCONS>=#DATA\nFROM CODCF=#CODCF CODCONT=#CODCONT \nTO CODCF=#CODCF CODCONT=#CODCONT");
|
||||||
|
|
||||||
|
//setto le variabili
|
||||||
|
selrighe.set_var("#DATA",data);
|
||||||
|
selrighe.set_var("#CODCF",codcf);
|
||||||
|
selrighe.set_var("#CODCONT",codcont);
|
||||||
|
|
||||||
|
//richiamo la funzione che effettivamente fa la cancellazione delle righe interessate
|
||||||
|
kill_planning(selrighe);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TContratti_app::kill_planning (TISAM_recordset& selrighe) const
|
||||||
|
{
|
||||||
|
const TRecnotype righe = selrighe.items();
|
||||||
|
if (righe > 0)
|
||||||
|
{
|
||||||
|
TProgind pi(righe, TR("Eliminazione planning in corso..."), true, true);
|
||||||
|
TLocalisamfile& rplan = selrighe.cursor()->file();
|
||||||
|
for (bool ok = selrighe.move_last(); ok; ok = selrighe.move_prev())
|
||||||
|
{
|
||||||
|
if (!pi.addstatus(1))
|
||||||
|
break;
|
||||||
|
rplan.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool TContratti_app::remove()
|
bool TContratti_app::remove()
|
||||||
{
|
{
|
||||||
bool ok=TRelation_application::remove();
|
bool ok=TRelation_application::remove();
|
||||||
@ -323,11 +367,14 @@ bool TContratti_app::remove()
|
|||||||
build_query(*_msk,query);
|
build_query(*_msk,query);
|
||||||
TISAM_recordset righeset(query);
|
TISAM_recordset righeset(query);
|
||||||
TLocalisamfile& file=righeset.cursor()->file();
|
TLocalisamfile& file=righeset.cursor()->file();
|
||||||
|
|
||||||
for (bool ok=righeset.move_first(); ok; ok=righeset.move_next())
|
for (bool ok=righeset.move_first(); ok; ok=righeset.move_next())
|
||||||
{
|
{
|
||||||
file.remove();
|
file.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TDate oggi(TODAY);
|
||||||
|
elimina_planning(oggi,_msk->get_long(F_CODCONT),_msk->get_long(F_CODCF));
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,6 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
|
||||||
PAGE "" -1 -1 80 20
|
PAGE "" -1 -1 80 20
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 4
|
GROUPBOX DLG_NULL 78 4
|
||||||
@ -489,7 +488,6 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 4
|
GROUPBOX DLG_NULL 78 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "@b Forfait"
|
PROMPT 1 7 "@b Forfait"
|
||||||
@ -516,7 +514,6 @@ END
|
|||||||
LISTBOX S_NOLCIC 1 20
|
LISTBOX S_NOLCIC 1 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 45 8 "In base a "
|
PROMPT 45 8 "In base a "
|
||||||
ITEM "N|Nessuno"
|
|
||||||
ITEM "I|Dot. iniziale"
|
ITEM "I|Dot. iniziale"
|
||||||
ITEM "O|Dot. odierna"
|
ITEM "O|Dot. odierna"
|
||||||
GROUP 1
|
GROUP 1
|
||||||
|
22
lv/lvlib.cpp
22
lv/lvlib.cpp
@ -87,6 +87,25 @@ const TRectype& TLaundry_contract::row(const char* codart) const
|
|||||||
bool TLaundry_contract::ok() const
|
bool TLaundry_contract::ok() const
|
||||||
{ return !empty(); }
|
{ return !empty(); }
|
||||||
|
|
||||||
|
bool TLaundry_contract::can_be_deleted() const
|
||||||
|
{
|
||||||
|
TConfig ini(CONFIG_DITTA,"lv");
|
||||||
|
const TString & codnum=ini.get("NUM_GEN");
|
||||||
|
|
||||||
|
TString query;
|
||||||
|
|
||||||
|
query << "USE DOC KEY 4 SELECT CODNUM=#CODNUM \n"
|
||||||
|
<< "FROM TIPOCOF=C CODCF=#CODCF PROVV=D \n"
|
||||||
|
<< "TO TIPOCOF=C CODCF=#CODCF PROVV=D \n";
|
||||||
|
|
||||||
|
TISAM_recordset rset(query);
|
||||||
|
|
||||||
|
rset.set_var("#CODNUM",TVariant(codnum));
|
||||||
|
rset.set_var("#CODCF",get_long(LVCONDV_CODCF));
|
||||||
|
|
||||||
|
return !rset.move_first();
|
||||||
|
}
|
||||||
|
|
||||||
// Legge un contratto tramite la chiave primaria cliente+codice
|
// Legge un contratto tramite la chiave primaria cliente+codice
|
||||||
bool TLaundry_contract::read(const long codcf, const long codcont)
|
bool TLaundry_contract::read(const long codcf, const long codcont)
|
||||||
{
|
{
|
||||||
@ -111,6 +130,9 @@ bool TLaundry_contract::read(const long codcf, const long indsped, const TDate&
|
|||||||
TLaundry_contract::TLaundry_contract() : TRectype(LF_LVCONDV)
|
TLaundry_contract::TLaundry_contract() : TRectype(LF_LVCONDV)
|
||||||
{ zero(); }
|
{ zero(); }
|
||||||
|
|
||||||
|
TLaundry_contract::TLaundry_contract(const TRectype & rec): TRectype(rec)
|
||||||
|
{
|
||||||
|
}
|
||||||
// Inizializza un contratto in base alla chiave primaria
|
// Inizializza un contratto in base alla chiave primaria
|
||||||
TLaundry_contract::TLaundry_contract(const long codcf, const long codcont)
|
TLaundry_contract::TLaundry_contract(const long codcf, const long codcont)
|
||||||
: TRectype(LF_LVCONDV)
|
: TRectype(LF_LVCONDV)
|
||||||
|
@ -22,8 +22,10 @@ public:
|
|||||||
|
|
||||||
bool read(const long codcf, const long codcont);
|
bool read(const long codcf, const long codcont);
|
||||||
bool read(const long codcf, const long indsped, const TDate& data);
|
bool read(const long codcf, const long indsped, const TDate& data);
|
||||||
|
bool can_be_deleted() const;
|
||||||
|
|
||||||
TLaundry_contract();
|
TLaundry_contract();
|
||||||
|
TLaundry_contract(const TRectype & rec);
|
||||||
TLaundry_contract(const long codcf, const long codcont);
|
TLaundry_contract(const long codcf, const long codcont);
|
||||||
TLaundry_contract(const long codcf, const long indsped, const TDate& data);
|
TLaundry_contract(const long codcf, const long indsped, const TDate& data);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user