jgmsxz.pas
来自「日昌餐饮管理系统是用Delphi7+SQL写的管理系统」· PAS 代码 · 共 83 行
PAS
83 行
unit jgmsxz;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, CheckLst, DB, DBTables, Grids, DBGrids;
type
TjgmsForm = class(TForm)
CheckListBox1: TCheckListBox;
Label1: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Query1: TQuery;
Label2: TLabel;
Edit1: TEdit;
updatememo: TQuery;
procedure FormActivate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure CheckListBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
jgmsForm: TjgmsForm;
implementation
uses qtmain;
{$R *.dfm}
procedure TjgmsForm.FormActivate(Sender: TObject);
begin
label1.Caption:='请为 '+qtform.lsQmc.AsString+' 选择加工描述';
query1.Open;
CheckListBox1.Items.Clear;
while not query1.Eof do
begin
CheckListBox1.Items.Add(query1.FieldByName('tcmc').AsString+'——'+query1.FieldByName('tcbh').AsString);
query1.Next;
end;
query1.Close;
end;
procedure TjgmsForm.BitBtn1Click(Sender: TObject);
begin
if edit1.Text<>'' then
begin
updatememo.Close;
updatememo.SQL.Clear;
updatememo.SQL.Add('update dcd set memo='+''''+edit1.Text+''''+' where id=:djh ');
updatememo.ParamByName('djh').AsInteger:=qtform.lsQid.AsInteger;
// updatememo.ParamByName('bh').AsString:=qtform.lsQbh.AsString;
updatememo.ExecSQL;
updatememo.Close;
end;
close;
end;
procedure TjgmsForm.CheckListBox1Click(Sender: TObject);
var i,j:integer;
stt:string;
begin
edit1.Text:='';
for i:=0 to checklistbox1.Items.Count -1 do
begin
if checklistbox1.Checked[i] then
begin
j:=pos('——',checklistbox1.Items.Strings[i]);
stt:=copy(checklistbox1.Items.Strings[i],j+4,10);
stt:=trim(copy(checklistbox1.Items.Strings[i],1,j-1));
edit1.Text:=edit1.Text+stt+';';
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?