You are not logged in.
Pages: 1
part of Person Class
TSQLPerson = class(TSQLRecord)
private
fFam, fIm, fOt,
fSex: string;
fDr: TDateTime;
...
published
property Fam: string read fFam write fFam;
property Im: string read fIm write fIm;
property Ot: string read fOt write fOt;
property Sex: String read fSex write fSex;
property Dr: TDateTime read fDr write fDr;
...
end;
part of Patients Class
TSQLPatients = class(TSQLPerson)
private
fMO: Integer;
fFizRazv: string;
fMass, fRost: Real;
...
published
property MO: Integer read fMO write fMO;
property FizRazv: string read fFizRazv write fFizRazv;
property Mass: Real read fMass write fMass;
property Rost: Real read fRost write fRost;
...
end;
procedure update Medical organization code (MO)
procedure TfrmMain.SetMO;
var
i: Integer;
patients: TSQLPatients;
ids: TIntegerDynArray;
begin
if TablePatients = nil then Exit;
patients := TSQLPatients.Create;
try
patients.FillPrepare(TablePatients);
if Database.TransactionBegin(TSQLPatients) then
try
Database.BatchStart(TSQLPatients);
while patients.FillOne do begin
patients.MO := MOs.ID;
Database.BatchUpdate(patients);
end;
Database.BatchSend(ids);
Database.Commit;
ShowNotification('МО успешно обновлено');
except
ShowNotification('Ошибка при обновлении');
Database.RollBack;
end;
finally
FreeAndNil(patients);
end;
end;
patients.FillOne fill only TSQLPerson date (Fam, Im, Ot, Sex...) and no one TSQLPatients (MO, FizRazv...)
Offline
ups, you absolutly right
Offline
Pages: 1