📄 untsystemset.pas
字号:
ipubtemp.ty_query(sql,datas);
if not varisnull(datas) then
begin
cdsdata.Data:=datas;
datas:=null;
cdsdata.Open;
if not cdsdata.IsEmpty then
begin
while not cdsdata.Eof do
begin
if trim(bm)='' then
begin
node:=treebase.Items.add(tnode,trim(cdsdata.fieldbyname('no').AsString)+'_'+trim(cdsdata.fieldbyname('name').AsString));
end else
begin
if (tnode.Count<cdsdata.RecordCount) and (tnode.Parent=nil) then
begin
i:=tnode.Count+1;
while i<=cdsdata.RecordCount do
begin
cdsdata.RecNo:=i;
node:=treebase.Items.AddChild(tnode,trim(cdsdata.fieldbyname('no').AsString)+'_'+trim(cdsdata.fieldbyname('name').AsString));
inc(i);
end;
end;
end;
cdsdata.Next;
end;
end else
begin
f:=2;
end;
end;
except
f:=3;
end;
cdsdata.Close;
cdsdata.Data:=null;
result:=f;
end;
procedure TfmSystemset.SetGridMenu(menuname:tmainmenu;index:integer);
var
i,Icount,j,t:integer;
begin
for i:=1 to gridb.RowCount-1 do
begin
gridb.Rows[i].Clear;
end;
gridb.RowCount:=2;
icount:=menuname.Items.Items[index].Count;
gridb.RowCount:=iCount+1;
j:=1;
t:=frm_main.ListView5.Items.Count+frm_main.ListView4.Items.Count+frm_main.lviewbatch.Items.Count+frm_main.listview3.Items.Count+frm_main.ListView1.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count;
if index>0 then
begin
for i:=1 to index do
begin
t:=t+mainmenu1.Items[i-1].Count;
end;
end;
for i:=0 to iCount-1 do
begin
gridb.Cells[0,j]:=inttostr(j);
if trim(menuname.Items.Items[index].Items[i].Caption)<>'-' then
begin
//gridb.RowCount:=gridb.RowCount+1;
gridb.Cells[0,j]:=inttostr(j);
gridb.Cells[1,j]:=trim(menuname.Items.Items[index].Items[i].Caption);
end else
begin
gridb.Cells[1,j]:=trim('分隔符');
end;
inc(j);
end;
if trim(qz)<>'' then
getqx(t,menuname.Items.Items[index].Count,gridb);
end;
procedure TfmSystemset.SetMenuName(memuname:tmainmenu);
var
i:integer;
begin
rdg2.Items.Clear;
for i:=0 to memuname.Items.Count-1 do
begin
rdg2.Items.Add(memuname.Items.Items[i].Caption);
end;
rdg2.ItemIndex:=0;
end;
procedure TfmSystemset.setqx;
var
i:integer;
begin
for i:=0 to 250 do
begin
if i=0 then
begin
qz:=qz+'CG';
end;
if i=(frm_main.ListView1.Items.Count) then
begin
qz:=qz+'ST';
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count) then
begin
qz:=qz+'PS';
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count) then
begin
qz:=qz+'BASE';
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count) then
begin
qz:=qz+'Sys';
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count) then
begin
qz:=qz+'Mon';
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count++frm_main.ListView6.Items.Count) then
begin
qz:=qz+'Cw';
end;
//////////////////////////////门店
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count) then
begin
qz:=qz+'Msys'; //0
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count) then
begin
qz:=qz+'MLs'; //1
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count) then
begin
qz:=qz+'MYw'; //2
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count) then
begin
qz:=qz+'MKc'; //3
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count) then
begin
qz:=qz+'MPs'; //4
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count) then
begin
qz:=qz+'MCw'; //5
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count+mainmenu1.Items.Items[5].count) then
begin
qz:=qz+'MKh'; //6
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count+mainmenu1.Items.Items[5].count+mainmenu1.Items.Items[6].count) then
begin
qz:=qz+'MGl'; //7
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count+mainmenu1.Items.Items[5].count+mainmenu1.Items.Items[6].count+mainmenu1.Items.Items[7].count) then
begin
qz:=qz+'MJc'; //8
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count+mainmenu1.Items.Items[5].count+mainmenu1.Items.Items[6].count+mainmenu1.Items.Items[7].count+mainmenu1.Items.Items[8].count) then
begin
qz:=qz+'MHlep'; //10
end;
if i=(frm_main.ListView1.Items.Count+frm_main.ListView3.Items.Count+frm_main.Lviewbatch.Items.Count+frm_main.ListView4.Items.Count+frm_main.ListView5.Items.Count+frm_main.ListView6.Items.Count+frm_main.ListView7.Items.Count+mainmenu1.Items.Items[0].count+mainmenu1.Items.Items[1].count+mainmenu1.Items.Items[2].count+mainmenu1.Items.Items[3].count+mainmenu1.Items.Items[4].count+mainmenu1.Items.Items[5].count+mainmenu1.Items.Items[6].count+mainmenu1.Items.Items[7].count+mainmenu1.Items.Items[8].count+mainmenu1.Items.Items[9].count) then
begin
qz:=qz+'MTs';
end;
///////////////////////////////////////////////
qz:=qz+inttostr(qx[i]);
end;
//showmessage(qz);
end;
procedure TfmSystemset.getqx(Bindex:integer;Eindex:integer;grid:tstringgrid);
var
s:string;
i,j:integer;
begin
if pos('CG',qz)<>0 then
begin
s:=copy(qz,pos('CG',qz)+2,(frm_main.ListView1.Items.Count));
end;
if pos('ST',qz)<>0 then
begin
s:=s+copy(qz,pos('ST',qz)+2,(frm_main.ListView3.Items.Count));
end;
if pos('PS',qz)<>0 then
begin
s:=s+copy(qz,pos('PS',qz)+2,(frm_main.Lviewbatch.Items.Count));
end;
if pos('BASE',qz)<>0 then
begin
s:=s+copy(qz,pos('BASE',qz)+4,(frm_main.ListView4.Items.Count));
end;
if pos('Sys',qz)<>0 then
begin
s:=s+copy(qz,pos('Sys',qz)+3,(frm_main.ListView5.Items.Count));
end;
if pos('Mon',qz)<>0 then
begin
s:=s+copy(qz,pos('Mon',qz)+3,(frm_main.ListView6.Items.Count));
end;
if pos('Cw',qz)<>0 then
begin
s:=s+copy(qz,pos('Cw',qz)+2,(frm_main.ListView7.Items.Count));
end;
///////////////门店
if pos('Msys',qz)<>0 then
begin
s:=s+copy(qz,pos('Msys',qz)+4,(mainmenu1.Items.Items[0].count));
end;
if pos('MLs',qz)<>0 then
begin
s:=s+copy(qz,pos('MLs',qz)+3,(mainmenu1.Items.Items[1].count));
end;
if pos('MYw',qz)<>0 then
begin
s:=s+copy(qz,pos('MYw',qz)+3,(mainmenu1.Items.Items[2].count));
end;
if pos('MKc',qz)<>0 then
begin
s:=s+copy(qz,pos('MKc',qz)+3,(mainmenu1.Items.Items[3].count));
end;
if pos('MPs',qz)<>0 then
begin
s:=s+copy(qz,pos('MPs',qz)+3,(mainmenu1.Items.Items[4].count));
end;
if pos('MCw',qz)<>0 then
begin
s:=s+copy(qz,pos('MCw',qz)+3,(mainmenu1.Items.Items[5].count));
end;
if pos('MKh',qz)<>0 then
begin
s:=s+copy(qz,pos('MKh',qz)+3,(mainmenu1.Items.Items[6].count));
end;
if pos('MGl',qz)<>0 then
begin
s:=s+copy(qz,pos('MGl',qz)+3,(mainmenu1.Items.Items[7].count));
end;
if pos('MJc',qz)<>0 then
begin
s:=s+copy(qz,pos('MJc',qz)+3,(mainmenu1.Items.Items[8].count));
end;
if pos('MHlep',qz)<>0 then
begin
s:=s+copy(qz,pos('MHlep',qz)+5,(mainmenu1.Items.Items[9].count));
end;
if pos('MTs',qz)<>0 then
begin
s:=s+copy(qz,pos('MTs',qz)+3,(mainmenu1.Items.Items[10].count));
end;
////////////////////////
// if Bindex=0 then i:=1 else i:=Bindex;
for i:=1 to eindex do
begin
try
if (i+bindex)<= length(s) then
begin
qx[i+bindex-1]:=strtoint(copy(s,(i+bindex),1));
if qx[i+bindex-1]=1 then
begin
grid.Cells[2,i]:='√';
end else
begin
grid.Cells[2,i]:='';
end;
end else
begin
qx[i+bindex-1]:=0;
end;
except
end;
//inc(i);
end;
end;
procedure tfmsystemset.Getfields(grid:tstringgrid;index:integer);
var
i:integer;
begin
for i:=1 to grid.RowCount -1 do
begin
grid.Rows[i].Clear;
end;
grid.RowCount:=2;
case index of
0: begin
grid.RowCount:=frm_main.ListView1.Items.Count+1;
for i:=1 to grid.RowCount-1 do
begin
grid.Cells[0,i]:=inttostr(i);
grid.Cells[1,i]:=trim(frm_main.ListView1.Items.Item[i-1].Caption);
end;
if trim(qz)<>'' then
getqx(0,frm_main.ListView1.Items.Count,gridbase);
end;
1: begin
grid.RowCount:=frm_main.ListView3.Items.Count+1;
for i:=1 to grid.RowCount-1 do
begin
grid.Cells[0,i]:=inttostr(i);
grid.Cells[1,i]:=trim(frm_main.ListView3.Items.Item[i-1].Caption);
end;
if trim(qz)<>'' then
getqx(frm_main.ListView1.Items.Count,frm_main.ListView3.Items.Count,gridbase);
end;
2: begin
grid.RowCount:=frm_main.lviewbatch.Items.Count+1;
for i:=1 to grid.RowCount-1 do
begin
grid.Cells[0,i]:=inttostr(i);
grid.Cells[1,i]:=trim(frm_main.lviewbatch.Items.Item[i-1].Caption);
end;
if trim(qz)<>'' then
getqx(frm_main.ListView3.Items.Count+frm_main.ListView1.Items.Count,frm_main.Lviewbatch.Items.Count,gridbase);
end;
3: begin
grid.RowCount:=frm_main.ListView4.Items.Count+1;
for i:=1 to grid.RowCount-1 do
begin
grid.Cells[0,i]:=inttostr(i);
grid.Cells[1,i]:=trim(frm_main.ListView4.Items.Item[i-1].Caption);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -