Patch level : 4.0
Files correlati : ca2.exe Ricompilazione Demo : [ ] Commento : Scrittura/lettura su .ini delle righe di movimento analitico. Serve per poter usare il postino git-svn-id: svn://10.65.10.50/trunk@14138 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
cb513d7823
commit
013ba73b5c
@ -80,6 +80,9 @@ protected:
|
||||
virtual int rewrite(const TMask& m);
|
||||
virtual int read(TMask& m);
|
||||
|
||||
virtual void ini2sheet(TConfig& ini, TSheet_field& sheet);
|
||||
virtual void sheet2ini(TSheet_field& sheet,TConfig& ini);
|
||||
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
@ -566,8 +569,6 @@ TToken_string& TMovanal_msk::rec2row(const TRectype& rec, int r) const
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TMovanal_msk::row2imp(const TToken_string& row, TImporto& imp) const
|
||||
{
|
||||
real dare; row.get(0, dare);
|
||||
@ -890,6 +891,61 @@ void TMovanal_app::init_modify_mode(TMask& m)
|
||||
((TMovanal_msk&)m).show_locked_buttons();
|
||||
}
|
||||
|
||||
void TMovanal_app::ini2sheet(TConfig& ini, TSheet_field& sheet)
|
||||
{
|
||||
TRectype rec(LF_RMOVANA); // Crea una riga di appoggio
|
||||
TString8 para;
|
||||
|
||||
sheet.destroy();
|
||||
_msk->reset_saldi();
|
||||
|
||||
for (int r = 1; ; r++)
|
||||
{
|
||||
para.cut(0) << LF_RMOVANA << ',' << r;
|
||||
if (!ini.set_paragraph(para))
|
||||
break;
|
||||
|
||||
rec.zero();
|
||||
for (int i = 0; i < rec.items(); i++)
|
||||
{
|
||||
const char* field = rec.fieldname(i);
|
||||
const TString& str = ini.get(field);
|
||||
if (str.full())
|
||||
rec.put(field, str);
|
||||
}
|
||||
_msk->rec2row(rec, r-1);
|
||||
|
||||
TImporto imp; _msk->row2imp(r-1, imp);
|
||||
TImporto& sld = _msk->saldo(rec);
|
||||
sld -= imp;
|
||||
}
|
||||
}
|
||||
|
||||
void TMovanal_app::sheet2ini(TSheet_field& sheet,TConfig& ini)
|
||||
{
|
||||
TRectype rec(LF_RMOVANA); // Crea una riga di appoggio
|
||||
TString8 para;
|
||||
|
||||
FOR_EACH_SHEET_ROW(sheet, i, row)
|
||||
{
|
||||
rec.zero();
|
||||
rec.put(RMOVANA_NUMREG, _msk->get(F_NUMREG));
|
||||
rec.put(RMOVANA_NUMRIG, i+1);
|
||||
_msk->row2rec(i, rec);
|
||||
|
||||
para.cut(0) << LF_RMOVANA << ',' << (i+1);
|
||||
ini.set_paragraph(para);
|
||||
|
||||
for (int i = 0; i < rec.items(); i++)
|
||||
{
|
||||
const char* field = rec.fieldname(i);
|
||||
const TString& str = rec.get(field);
|
||||
if (str.full())
|
||||
ini.set(field, str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TMovanal_app::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_MOVANA);
|
||||
|
Loading…
x
Reference in New Issue
Block a user