增加InitAdoData,修改InitCDSData 方法,多选框选择问题

This commit is contained in:
sgwp 2024-11-12 11:05:43 +08:00
parent 0f56332ecd
commit fa72f24442

View File

@ -218,6 +218,7 @@ procedure LSCSHData(ADOQueryTmp: TADOQuery; mParent: TdxLayoutControl; FTag: Int
procedure LRTSetsavedata(ADOQueryCmd: TADOQuery; MyTable: string; Myparent: TdxLayoutControl; MyTag: Integer);
function SLGetFilters(layoutControl: TdxLayoutControl; EquTag, LikeTag: Integer): string;
procedure InitAdoData(ADO1: TADOQuery; Tv1: TcxGridDBTableView; SqlStr, FilterStr, MarkStr: string);
// **************** ʦүдµÄ *****************//
type
@ -2178,6 +2179,9 @@ procedure InitCDSData(ADO1: TADOQuery; CDS1: TclientDataSet; Tv1: TcxGridDBTable
var
MarkStrValue: string;
begin
try
Tv1.BeginUpdate() ;
if trim(MarkStr) <> '' then
begin
if not CDS1.IsEmpty then
@ -2188,9 +2192,7 @@ begin
begin
Close;
SQL.Clear;
Filtered := false;
sql.Add(SqlStr);
// ShowMessage(sql.text);
Open;
end;
@ -2204,8 +2206,39 @@ begin
if trim(MarkStr) <> '' then
CDS1.Locate(MarkStr, MarkStrValue, []);
finally
tv1.EndUpdate;
end;
end;
//////////////////////////////////////
procedure InitAdoData(ADO1: TADOQuery; Tv1: TcxGridDBTableView; SqlStr, FilterStr, MarkStr: string);
var
MarkStrValue: string;
begin
try
Tv1.BeginUpdate();
if trim(MarkStr) <> '' then
begin
if not ADO1.IsEmpty then
MarkStrValue := TRIM(ADO1.FieldByName(MarkStr).AsString);
end;
with ADO1 do
begin
Close;
SQL.Clear;
Filtered := false;
sql.Add(SqlStr);
Open;
end;
if trim(FilterStr) <> '' then
SDofilter(ADO1, FilterStr);
Tv1.DataController.Filter.Refresh;
if trim(MarkStr) <> '' then
ADO1.Locate(MarkStr, MarkStrValue, []);
finally
Tv1.EndUpdate();
end;
end;
procedure SInitRadioGroupBySql(ADOQueryTmp: TADOQuery; rg: TRadioGroup; emptyFlag: Boolean; mSql: string);
begin
with ADOQueryTmp do