Patch level : 2.2
Files correlati : ca0 Ricompilazione Demo : [ ] Commento : Corretta numerazione automatica standard dei TMultiple_rectype git-svn-id: svn://10.65.10.50/trunk@12972 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
19236f1843
commit
d4f9142d40
@ -1,3 +1,5 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <multirec.h>
|
#include <multirec.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
|
|
||||||
@ -7,15 +9,17 @@ bool TMultiple_rectype::key_complete() const
|
|||||||
const KeyDes& kd = recd.Ky[0];
|
const KeyDes& kd = recd.Ky[0];
|
||||||
const int nf = kd.FieldSeq[kd.NkFields - 1] % MaxFields; //posizione ultimo campo chiave principale
|
const int nf = kd.FieldSeq[kd.NkFields - 1] % MaxFields; //posizione ultimo campo chiave principale
|
||||||
const RecFieldDes& rf = recd.Fd[nf];
|
const RecFieldDes& rf = recd.Fd[nf];
|
||||||
const int type = rf.TypeF;
|
|
||||||
|
|
||||||
if (type == _intfld || type == _longfld ||
|
const TString& val = get(rf.Name);
|
||||||
type == _intzerofld || type == _longzerofld)
|
bool ok = !val.blank();
|
||||||
|
if (ok)
|
||||||
{
|
{
|
||||||
const long num = get_long(rf.Name);
|
const int type = rf.TypeF; // Controllo meglio i campi numerici
|
||||||
return num > 0;
|
if (type == _intfld || type == _longfld || type == _intzerofld || type == _longzerofld)
|
||||||
|
ok = atol(val) > 0;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
//assegna il prossimo numero all'ultimo campo della chiave principale della testata
|
//assegna il prossimo numero all'ultimo campo della chiave principale della testata
|
||||||
@ -26,6 +30,10 @@ bool TMultiple_rectype::renum()
|
|||||||
const int nf = kd.FieldSeq[kd.NkFields - 1] % MaxFields; //posizione ultimo campo chiave principale
|
const int nf = kd.FieldSeq[kd.NkFields - 1] % MaxFields; //posizione ultimo campo chiave principale
|
||||||
const RecFieldDes& rf = recd.Fd[nf];
|
const RecFieldDes& rf = recd.Fd[nf];
|
||||||
|
|
||||||
|
const int type = rf.TypeF; // Controllo che il campo sia numerico
|
||||||
|
if (type != _intfld && type != _longfld && type != _intzerofld && type != _longzerofld)
|
||||||
|
return false;
|
||||||
|
|
||||||
TRectype::zero(rf.Name); //azzera il contenuto del campo chiave numerico
|
TRectype::zero(rf.Name); //azzera il contenuto del campo chiave numerico
|
||||||
long next_num = 1;
|
long next_num = 1;
|
||||||
|
|
||||||
@ -51,7 +59,7 @@ bool TMultiple_rectype::renum()
|
|||||||
|
|
||||||
put(rf.Name, next_num);
|
put(rf.Name, next_num);
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMultiple_rectype::set_body_key(TRectype & rowrec)
|
void TMultiple_rectype::set_body_key(TRectype & rowrec)
|
||||||
|
@ -66,10 +66,10 @@ TString& TTable_application::get_mask_name(TString& t) const
|
|||||||
|
|
||||||
t = tab.module();
|
t = tab.module();
|
||||||
t << "tb" << m;
|
t << "tb" << m;
|
||||||
t.upper();
|
t.lower();
|
||||||
|
|
||||||
TFilename n(t); n.ext("msk");
|
TFilename n(t); n.ext("msk");
|
||||||
if (!n.exist())
|
if (!n.custom_path())
|
||||||
t.overwrite("ba");
|
t.overwrite("ba");
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user