Курсовая работа: Разработка базы данных и прикладного программного обеспечения для автобусного парка
with fmMain.DBGridStopPoints.DataSource.DataSet do
begin
ADOQueryRoutes.SQL.Text := 'SELECT * FROM routes WHERE id = ' +
'ANY (SELECT routeid FROM stations WHERE id = ' +
Fields[3].AsString + ')';
ADOQueryRoutes.Active := true;
ADOQueryRoutes.Requery;
ledName.Text := Fields[1].AsString;
lcmbbxRoute.KeyValue := dtsrcRoutes.DataSet.Fields[0].AsInteger;
lcmbbxStation.KeyValue := Fields[3].AsInteger;
if Fields[2].AsString = 'forward' then cmbbxDirection.ItemIndex := 0 else
cmbbxDirection.ItemIndex := 1;
end;
end
else
begin
Caption := 'Add stop point';
ledName.Clear;
lcmbbxStation.KeyValue := 1;
ADOQueryRoutes.SQL.Text := 'SELECT * FROM routes WHERE id = ' +
'ANY (SELECT routeid FROM stations WHERE id = 1)';
ADOQueryRoutes.Active := true;
ADOQueryRoutes.Requery;
end;
end;
procedure TfmStopPoints.lcmbbxStationCloseUp(Sender: TObject);
begin
ADOQueryRoutes.SQL.Text := 'SELECT * FROM routes WHERE id = ' +
'ANY (SELECT routeid FROM stations WHERE stations.id = ' +