📄 inv_qry_currentinv_position_c.pas
字号:
unit Inv_Qry_CurrentInv_Position_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, StdCtrls, CheckLst, Db, AdODB, ExtEdit;
Type
TFrm_Inv_Qry_CurrentInv_Position_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_Position_C: TFrm_Inv_Qry_CurrentInv_Position_C;
implementation
Uses Sys_Global;
{$R *.DFM}
procedure TFrm_Inv_Qry_CurrentInv_Position_C.btn_okClick(Sender: TObject);
var
I:integer;
CheckedString:String;
begin
inherited;
Condition:='';
conditionHint:='货位:';
for i:=0 to ChLstBx_WhSelect.Items.Count-1 do
begin
if ChLstBx_WhSelect.Checked[i] then
begin
CheckedString:=Trim(ChLstBx_WhSelect.Items.Strings[i]);
Condition:=Condition+' (CurrentInv.WHCode+CurrentInv.WhPositionCode='''+
getCode(CheckedString)+''') or ';
ConditionHint:=ConditionHint+getName(CheckedString)+'、';
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_Position_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_Position_C.SetDBConnect(
AdOConnection: TAdOConnection);
begin
inherited;
with AdoQry_Tmp do
begin
Close;
//当前用户可用仓库的所有货位
{SQL.Text:='Select WHCode+WhPositionCode+'' ''+WhPositionName As WHPCodeName'
+' From WhPosition'
+' Where WHCode In (Select WHCode From WHAccessCtrl'
+' Where EmployeeCode='''+UserCode+''')';}
SQL.Text:=' Select WHCode+WhPositionCode+'' ''+WhPositionName As WHPCodeName'
+' From WhPosition';
// +' Where WHCode In (Select WHCode From WHAccessCtrl'
// +' Where EmployeeCode='''+UserCode+''')';
Open;
ChLstBx_WhSelect.clear;
First;
while not Eof do
begin
ChLstBx_WhSelect.Items.Add(fieldbyname('WHPCodeName').AsString);
Next;
end;
end;
end;
procedure TFrm_Inv_Qry_CurrentInv_Position_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 + -