📄 inv_qry_currentinv_warehouse_c.pas
字号:
unit Inv_Qry_CurrentInv_Warehouse_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, StdCtrls, CheckLst, Db, AdODB;
Type
TFrm_Inv_Qry_CurrentInv_Warehouse_C = Class(TFrm_Base_Condition)
Label1: TLabel;
ChLstBx_WhSelect: TCheckListBox;
ChBx_SelectAll: TCheckBox;
procedure btn_okClick(Sender: TObject);
procedure ChLstBx_WhSelectClickCheck(Sender: TObject);
procedure ChBx_SelectAllClick(Sender: TObject);
private
{ Private declarations }
public
procedure SetDBConnect(AdOConnection:TAdOConnection); Override;
{ Public declarations }
end;
var
Frm_Inv_Qry_CurrentInv_Warehouse_C: TFrm_Inv_Qry_CurrentInv_Warehouse_C;
implementation
Uses Sys_Global;
{$R *.DFM}
procedure TFrm_Inv_Qry_CurrentInv_Warehouse_C.btn_okClick(Sender: TObject);
var I: integer;
begin
inherited;
Condition:='';
conditionHint:='仓库:';
for i:=0 to ChLstBx_WhSelect.Items.Count-1 do
begin
if ChLstBx_WhSelect.Checked[i] then
begin
Condition:=Condition+'CurrentInv.WHCode='''+GetCode(ChLstBx_WhSelect.Items.Strings[i])+''' or ';
ConditionHint:=ConditionHint+GetName(ChLstBx_WhSelect.Items.Strings[i])+'、';
end;
end;
if condition<>'' then
begin
condition:=copy(condition,0,length(condition)-4);
conditionHint:=copy(conditionHint,0,length(conditionHint)-2);
end
else
Btn_Cancel.Click;
end;
procedure TFrm_Inv_Qry_CurrentInv_Warehouse_C.ChLstBx_WhSelectClickCheck(Sender: TObject);
var I: integer;
begin
inherited;
btn_ok.Enabled:=False;
for i:=0 to ChLstBx_WhSelect.Items.Count-1 do
begin
if ChLstBx_WhSelect.Checked[i] then
btn_ok.Enabled:=True;
end;
end;
procedure TFrm_Inv_Qry_CurrentInv_Warehouse_C.SetDBConnect(
AdOConnection: TAdOConnection);
begin
inherited;
with AdoQry_Tmp do
begin
Close;
{SQL.Text:='Select Warehouse.WHCode+'' ''+Warehouse.WHName As CodeName'
+' From Warehouse,WHAccessCtrl'
+' Where Warehouse.WHCode=WHAccessCtrl.WHCode'
+' And WHAccessCtrl.EmployeeCode='''+UserCode+''''
+' Order By Warehouse.WHCode';}
SQL.Text:=' Select Warehouse.WHCode+'' ''+Warehouse.WHName As CodeName'
+' From Warehouse Order By Warehouse.WHCode' ;
Open;
ChLstBx_WhSelect.clear;
First;
while not Eof do
begin
ChLstBx_WhSelect.Items.Add(fieldbyname('CodeName').AsString);
Next;
end;
end;
end;
procedure TFrm_Inv_Qry_CurrentInv_Warehouse_C.ChBx_SelectAllClick(
Sender: TObject);
var i : integer;
begin
inherited;
if ChBx_SelectAll.Checked then
begin
for i:=0 to ChLstBx_WhSelect.Items.Count-1 do
begin
ChLstBx_WhSelect.Checked[i]:=True;
end;
btn_ok.Enabled:=True;
end
else
begin
for i:=0 to ChLstBx_WhSelect.Items.Count-1 do
begin
ChLstBx_WhSelect.Checked[i]:=False;
end;
btn_ok.Enabled:=False;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -