* Proper fix for ID field not always being named properly in ExtJS delete operation.

git-svn-id: trunk@17913 -
This commit is contained in:
michael 2011-07-02 13:03:51 +00:00
parent 8dfac9c481
commit 543b6bec44

View File

@ -349,6 +349,16 @@ end;
procedure TCustomSQLDBWebDataProvider.ApplySQLParams(AQuery : TSQLQuery; DoNewID : Boolean = False);
function TryAdaptor (const aName: string; P: TParam) : boolean;
var S : string;
begin
result := Adaptor.TryFieldValue(aName,S);
if not result then
result := Adaptor.TryParamValue(aName,S);
if result then
SetTypedParam(P,S);
end;
var
I: Integer;
P : TParam;
@ -366,16 +376,20 @@ begin
FOnGetParamValue(Self,P,B);
if not B then
begin
If (P.Name=IDFieldName) and DoNewID then
If (P.Name=IDFieldName) then
begin
GetNewID;
SetTypedParam(P,FLastNewID)
if DoNewID then
begin
GetNewID;
SetTypedParam(P,FLastNewID)
end
else
begin
if not TryAdaptor (P.Name, P) then
TryAdaptor('ID', P);
end;
end
else If Adaptor.TryFieldValue(P.Name,S) then
SetTypedParam(P,S)
else If Adaptor.TryParamValue(P.Name,S) then
SetTypedParam(P,S)
else
else if not TryAdaptor (P.Name, P) then
P.Clear;
end;
end;