jh_find_unit.pas
来自「网上搜索来的进销存源码」· PAS 代码 · 共 488 行 · 第 1/2 页
PAS
488 行
0:
begin
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 单据编码=:yhbh and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('yhbh').Value := edit3.Text;
end
else
begin
adoq1.SQL.Add('select * from jhthd where 单据编码=:yhbh order by 编号');
adoq1.Parameters.ParamByName('yhbh').Value := edit3.Text;
end;
end;
1:
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 单据编码 like :yhbh2 and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('yhbh2').Value := edit3.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhthd where 单据编码 like :yhbh2 order by 编号');
adoq1.Parameters.ParamByName('yhbh2').Value := edit3.Text + '%';
end;
end;
end;
1:
begin
case combobox6.ItemIndex of
0:
begin
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 供货商名称=:bh and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('bh').Value := edit3.Text;
end
else
begin
adoq1.SQL.Add('select * from jhthd where 供货商名称=:bh order by 编号');
adoq1.Parameters.ParamByName('bh').Value := edit3.Text;
end;
end;
1:
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 供货商名称 like :bh2 and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('bh2').Value := edit3.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhthd where 供货商名称 like :bh2 order by 编号');
adoq1.Parameters.ParamByName('bh2').Value := edit3.Text + '%';
end;
end;
end;
2:
begin
case combobox6.itemIndex of
0:
begin
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 经手人=:mc and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit3.Text;
end
else
begin
adoq1.SQL.Add('select * from jhd where 经手人=:mc order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit3.Text;
end;
end;
1:
if checkbox3.Checked then
begin
adoq1.SQL.Add('select * from jhthd where 经手人 like :mc and 录单日期 between #' + edit8.text + '# and #' + edit9.text + '# order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit3.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhthd where 经手人 like :mc order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit3.Text + '%';
end;
end;
end;
//end
else
begin
adoq1.SQL.Clear;
adoq1.SQL.Add('select * from jhthd order by 编号 ');
end;
end;
adoq1.Active := true;
datas2.DataSet := nil;
datas2.DataSet := adoq1;
dbgrid2.DataSource := datas2;
end;
end;
procedure Tjh_find_form.FormCreate(Sender: TObject);
begin
self.Top := 74;
self.Left := 11;
self.Height := 491;
self.Width := 767;
self.PageControl1.ActivePageIndex := 0;
end;
procedure Tjh_find_form.SpeedButton6Click(Sender: TObject);
begin
close;
end;
procedure Tjh_find_form.SpeedButton8Click(Sender: TObject);
begin
close;
end;
procedure Tjh_find_form.SpeedButton21Click(Sender: TObject);
begin
with database do
begin
adoq1.Connection := adoc;
adoq1.SQL.Clear;
edit4.Text := formatdatetime('MM-dd-yy', datetimepicker3.date);
edit5.Text := formatdatetime('MM-dd-yy', datetimepicker4.date);
case combobox4.ItemIndex of
0:
begin
case combobox5.ItemIndex of
0:
begin
if checkbox2.Checked then
begin
//edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
//edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 单据编码=:yhbh and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('yhbh').Value := edit1.Text;
end
else
begin
adoq1.SQL.Add('select * from jhd where 单据编码=:yhbh order by 编号');
adoq1.Parameters.ParamByName('yhbh').Value := edit1.Text;
end;
end;
1:
if checkbox2.Checked then
begin
//edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
//edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 单据编码 like :yhbh2 and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('yhbh2').Value := edit1.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhd where 单据编码 like :yhbh2 order by 编号');
adoq1.Parameters.ParamByName('yhbh2').Value := edit1.Text + '%';
end;
end;
end;
1:
begin
case combobox5.ItemIndex of
0:
begin
if checkbox2.Checked then
begin
//edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
//edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 供货商名称=:bh and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('bh').Value := edit1.Text;
end
else
begin
adoq1.SQL.Add('select * from jhd where 供货商名称=:bh order by 编号');
adoq1.Parameters.ParamByName('bh').Value := edit1.Text;
end;
end;
1:
if checkbox2.Checked then
begin
// edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
// edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 供货商名称 like :bh2 and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('bh2').Value := edit1.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhd where 供货商名称 like :bh2 order by 编号');
adoq1.Parameters.ParamByName('bh2').Value := edit1.Text + '%';
end;
end;
end;
2:
begin
case combobox5.ItemIndex of
0:
begin
if checkbox2.Checked then
begin
//edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
//edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 经手人=:mc and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit1.Text;
end
else
begin
adoq1.SQL.Add('select * from jhd where 经手人=:mc order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit1.Text;
end;
end;
1:
if checkbox2.Checked then
begin
//edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
//edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
adoq1.SQL.Add('select * from jhd where 经手人 like :mc and 录单日期 between #' + edit4.text + '# and #' + edit5.text + '# order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit1.Text + '%';
end
else
begin
adoq1.SQL.Add('select * from jhd where 经手人 like :mc order by 编号');
adoq1.Parameters.ParamByName('mc').Value := edit1.Text + '%';
end;
end;
end;
//end
else
begin
adoq1.SQL.Clear;
adoq1.SQL.Add('select * from jhd order by 编号 ');
end;
end;
adoq1.Active := true;
datas2.DataSet := nil;
datas2.DataSet := adoq1;
dbgrid3.DataSource := datas2;
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?