📄 realtyg41ab.pas
字号:
unit RealtyG41AB;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dbcgrids, Grids, DBGrids, DB, ADODB, StdCtrls, Buttons, ExtCtrls,
StrUtils, ExtDlgs, ComCtrls, math, Menus, ImgList, ToolWin;
type
Tf_RealtyG41AB = class(TForm)
L1: TLabel;
L2: TLabel;
Label1: TLabel;
Label2: TLabel;
edit3: TEdit;
edit2: TDateTimePicker;
edit1: TComboBox;
Label3: TLabel;
edit4: TDateTimePicker;
Label4: TLabel;
Edit5: TEdit;
Label5: TLabel;
Edit6: TEdit;
Button7: TButton;
Button5: TButton;
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ToolButton10Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure edit1Select(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
bOK:bool;
T:string;
end;
var
f_RealtyG41AB: Tf_RealtyG41AB;
sNum:string;
implementation
uses data, main,RealtyG41A,Car4s931;
{$R *.dfm}
procedure Tf_RealtyG41AB.FormCreate(Sender: TObject);
var
query:TADOQuery;
begin
query:=TADOQuery.Create(nil);
query.Connection:=datamoduleado.ADOConnection1;
edit1.Items.add('新增器材');
query.sql.add('select * from 辅助资料 where 类别='''+'器材'+'''');
query.open;
while not query.eof do
begin
edit1.items.add(query.fieldbyname('名称').value);
query.next;
end;
if f_RealtyG41A.bnew=true then
begin
edit2.date:=date;
edit4.date:=date;
end;
if f_RealtyG41A.bnew=false then
begin
edit1.itemIndex:=edit1.items.indexof(f_RealtyG41A.ListView1.Selected.Caption);
edit2.date:=strtodate(f_RealtyG41A.ListView1.Selected.SubItems[0]);
edit3.Text:=f_RealtyG41A.ListView1.Selected.SubItems[1];
edit4.date:=strtodate(f_RealtyG41A.ListView1.Selected.SubItems[2]);
edit5.Text:=f_RealtyG41A.ListView1.Selected.SubItems[3];
edit6.text:=f_RealtyG41A.ListView1.Selected.SubItems[4];
end;
end;
//Tab
procedure Tf_RealtyG41AB.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
Begin
key:=0;
perform(WM_NEXTDLGCTL,0,0);
end
else if key=VK_ESCAPE then close;
end;
procedure Tf_RealtyG41AB.Button2Click(Sender: TObject);
begin
close;
end;
procedure Tf_RealtyG41AB.ToolButton10Click(Sender: TObject);
begin
close;
end;
procedure Tf_RealtyG41AB.Button7Click(Sender: TObject);
var
s1:string;
begin
edit3.Text:=mainform.StdInt(edit3.Text);
edit5.Text:=mainform.StdInt(edit5.Text);
if edit6.text='' then edit6.text:='-';
if f_RealtyG41A.bnew=true then
begin
with f_RealtyG41A.ListView1.Items.Add do
begin
caption:=edit1.Text;
subitems.Add(datetostr(edit2.date));
subitems.Add(Edit3.text);
subitems.Add(datetostr(edit4.date));
subitems.Add(Edit5.text);
subitems.Add(Edit6.text);
end;
if f_RealtyG41A.listview1.Items.Count>0 then f_RealtyG41A.listview1.Items.Item[0].Selected:=true;
edit1.itemIndex:=edit1.items.indexof('');
edit2.date:=date;
edit3.Text:='0';
edit4.date:=date;
edit5.Text:='0';
edit6.Text:='';
end;
if f_RealtyG41A.bnew=false then
begin
with f_RealtyG41A.ListView1.Selected do
begin
caption:=edit1.Text;
subitems[0]:=datetostr(Edit2.date);
subitems[1]:=edit3.text;
subitems[2]:=datetostr(Edit4.date);
subitems[3]:=edit5.text;
subitems[4]:=edit6.text;
end;
close;
end;
end;
procedure Tf_RealtyG41AB.Button5Click(Sender: TObject);
begin
close;
end;
procedure Tf_RealtyG41AB.edit1Select(Sender: TObject);
begin
if edit1.Text='新增器材' then
begin
mainform.t1:='器材';
f_Car4s931:=Tf_Car4s931.Create(self);
f_Car4s931.showmodal;
if f_Car4s931.bOK=true then
begin
edit1.Items.Add(mainform.t1);
edit1.ItemIndex:=edit1.Items.IndexOf(mainform.t1);
end
else edit1.ItemIndex:=edit1.Items.IndexOf('');
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -