Commit 8209f16a authored by Sandro Camata Santana's avatar Sandro Camata Santana

Ajustes

parent 29d6d4f7
This diff is collapsed.
......@@ -2224,17 +2224,39 @@ begin
end;
procedure TExplorerV2.memOQLQuery2DragDrop(Sender, Source: TObject; X,Y: Integer);
function FromClause(piNode: TTreeNode; var poPath: string): string;
function IsRoot(piNode: TTreeNode): Boolean;
begin
if piNode.Level = 1
if (piNode.Level > 1) then
begin
if ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6))
then Result := IsRoot(piNode.Parent)
else Result := False;
end
else Result := True;
end;
function FromClause(piNode: TTreeNode; piCast:String; var poPath: string): string;
begin
if IsRoot(piNode) //((piNode.Level = 1) or ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6)))
then begin
poPath := acClassTicket(piNode.Data).PersistentObjectClassName;
result := poPath;
end
else begin
result := FromClause(piNode.Parent, poPath);
poPath := poPath + '.' + copy(piNode.Text, 1, pred(pos(':', piNode.Text)));
result := result + ', ' + #13#10 + ' ' + poPath;
if ((TObject(piNode.Data) is acClassTicket) and (piNode.ImageIndex = 6)) then
begin
if piCast <> ''
then result := FromClause(piNode.Parent, piCast, poPath)
else result := FromClause(piNode.Parent, acClassTicket(piNode.Data).PersistentObjectClassName, poPath);
end
else
begin
result := FromClause(piNode.Parent, '', poPath);
poPath := poPath + '.' + copy(piNode.Text, 1, pred(pos(':', piNode.Text)));
if piCast <> ''
then result := result + ', ' + #13#10 + ' ' + '('+ piCast +')' + poPath
else result := result + ', ' + #13#10 + ' ' + poPath;
end;
end;
end;
var lCaption: string;
......@@ -2260,7 +2282,7 @@ begin
if GetKeyState(VK_CONTROL) < 0
then begin
lCaption := (TObject(lNode.Parent.data) as acClassTicket).PersistentObjectClassName;
lFrom := FromClause(lNode.Parent, lPath);
lFrom := FromClause(lNode.Parent, '', lPath);
lSelect := copy(lPath, 1, pred(pos('.', lPath)));
if lSelect = '' then lSelect := lPath;
SynEditOQL.SelText := #13#10 +
......@@ -2347,16 +2369,22 @@ begin
end;
end;
end;
fLastExecErrorFlag := False;
sbStatusBar.Panels[0].Text := '';
sbStatusBar.Panels[1].Text := '';
sbStatusBar.Panels[2].Text := '';
if actResultsPanel.Checked then actResultsPanel.Execute;
except
on e: Exception do
begin
if not actResultsPanel.Checked then actResultsPanel.Execute;
fLastExecErrorFlag := True;
memErrorText.Text := e.Message;
pcResults.ActivePageIndex := 1;
pcEditor.ActivePageIndex := 0;
sbStatusBar.Panels[0].Text := 'OQL translation to SQL failed.';
sbStatusBar.Panels[1].Text := '';
sbStatusBar.Panels[2].Text := '';
if not actResultsPanel.Checked then actResultsPanel.Execute;
end;
end;
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment