📄 pfm_rptsellsh.pas
字号:
unit pfm_rptsellsh;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
type
Tfm_rptsellsh = class(TForm)
GroupBox1: TGroupBox;
BBtnOK: TBitBtn;
Edit1: TEdit;
Label1: TLabel;
lbltishi: TLabel;
Edit3: TEdit;
ComboBox1: TComboBox;
BBtnAdd: TBitBtn;
LBox1: TListBox;
ComboBox2: TComboBox;
BBtndel: TBitBtn;
procedure BBtnOKClick(Sender: TObject);
procedure BBtnAddClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BBtndelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
lsh:integer;
wherestr:string;
end;
var
fm_rptsellsh: Tfm_rptsellsh;
implementation
{$R *.DFM}
var
lshlist:Tstringlist;
lastrelative:string;
procedure Tfm_rptsellsh.BBtnOKClick(Sender: TObject);
var
i:integer;
begin
for i:=0 to lshlist.count-1 do
begin
if length(lshlist.Strings[i])>0 then
begin
wherestr:=wherestr+lshlist.strings[i];
end;
end;
if length(trim(wherestr))>0 then
begin
wherestr:=' where '+wherestr;
end;
modalresult:=mrOK;
end;
procedure Tfm_rptsellsh.BBtnAddClick(Sender: TObject);
var
addstr1:string;
condstr:string;
begin
try
lsh:=strtoint(edit1.text);
except
on EConvertError do
begin
lbltishi.caption:='流水号请输入整数';
exit;
end;
end;
if length(combobox1.Text)=0 then
begin
lbltishi.Caption:='请选择操作符';
combobox1.SetFocus;
exit;
end;
condstr:=' '+lastrelative+ ' lsh'+combobox1.text+edit1.text;
if combobox2.Text='或者' then
begin
lastrelative:='or';
end
else
begin
lastrelative:='and';
end;
lshlist.Add(condstr);
addstr1:=' ';
insert(edit3.text,addstr1,1);
insert(combobox1.text,addstr1,10);
insert(edit1.text,addstr1,15);
insert(combobox2.text,addstr1,25);
lbox1.Items.Add(trimright(addstr1));
end;
procedure Tfm_rptsellsh.FormCreate(Sender: TObject);
begin
lshlist:=tstringlist.create;
end;
procedure Tfm_rptsellsh.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
lshlist.free;
end;
procedure Tfm_rptsellsh.BBtndelClick(Sender: TObject);
begin
if lbox1.ItemIndex>=0 then
begin
lshlist.Delete(lbox1.itemindex);
lbox1.Items.Delete(lbox1.itemindex);
end;
if lbox1.Items.Count=0 then
begin
lastrelative:='';
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -