📄 realtyb111.pas
字号:
unit RealtyB111;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dbcgrids, Grids, DBGrids, DB, ADODB, StdCtrls, Buttons, ExtCtrls,
StrUtils, ExtDlgs, ComCtrls, math;
type
Tf_RealtyB111 = class(TForm)
Button5: TButton;
Button6: TButton;
Label8: TLabel;
Edit2: TEdit;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Label1: TLabel;
Label3: TLabel;
Edit3: TEdit;
Edit5: TEdit;
Edit4: TEdit;
Label10: TLabel;
Label5: TLabel;
Label2: TLabel;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Button6Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
bOK,bOK2:bool;
bMod:bool;
sNum:string;
end;
var
f_RealtyB111: Tf_RealtyB111;
implementation
uses data, main,RealtyB11;
{$R *.dfm}
//初始化
procedure Tf_RealtyB111.FormCreate(Sender: TObject);
Var
query:TADOQuery;
begin
query:=TADOQuery.Create(nil);
query.Connection:=DataModuleADO.ADOConnection1;
query.SQL.Add('select distinct 名称 from 辅助资料 where 类别='''+'开户银行'+'''');
query.Open;
while not query.Eof do
begin
ComboBox1.Items.Add(query.fieldbyname('名称').Value);
query.next;
end;
ComBoBox2.Items.Add('个人');
ComBoBox2.Items.Add('公家');
if f_RealtyB11.bMod=false then
begin
edit2.Text:=f_RealtyB11.listview1.Selected.Caption;
combobox1.ItemIndex:=combobox1.Items.IndexOf(f_RealtyB11.listview1.Selected.SubItems[0]);
edit3.text:=f_RealtyB11.listview1.Selected.SubItems[1];
combobox2.ItemIndex:=combobox2.Items.IndexOf(f_RealtyB11.listview1.Selected.SubItems[2]);
edit4.text:=f_RealtyB11.listview1.Selected.SubItems[3];
if f_RealtyB11.listview1.Selected.SubItems[4]='Y' then checkbox1.Checked:=true
else checkbox1.Checked:=false;
edit5.text:=f_RealtyB11.listview1.Selected.SubItems[5];
end;
query.close;
query.free;
end;
//Tab
procedure Tf_RealtyB111.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_RealtyB111.Button5Click(Sender: TObject);
Var
s:string;
begin
if checkbox1.Checked then s:='Y'
else s:='N';
if edit2.Text='' then
begin
showmessage('开户名称不能为空!');
edit2.SetFocus;
exit;
end;
if combobox1.Text='' then
begin
showmessage('开户银行不能为空!');
combobox1.SetFocus;
exit;
end;
if edit3.Text='' then edit3.Text:='-';
if edit4.Text='' then edit4.Text:='-';
if edit5.Text='' then edit5.Text:='-';
if f_RealtyB11.bMod then
begin
with f_RealtyB11.ListView1.Items.Add do
begin
Caption:=edit2.Text;
subitems.Add(comboBox1.Text);
subitems.Add(edit3.Text);
subitems.Add(comboBox2.Text);
subitems.Add(edit4.Text);
subitems.Add(s);
subitems.Add(edit5.Text);
end;
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
combobox1.ItemIndex:=combobox1.Items.IndexOf('');
combobox2.ItemIndex:=combobox2.Items.IndexOf('');
edit2.SetFocus;
end;
if f_RealtyB11.bMod=false then
begin
with f_RealtyB11.ListView1.Selected do
begin
Caption:=edit2.Text;
subitems[0]:=comboBox1.Text;
subitems[1]:=edit3.Text;
subitems[2]:=comboBox2.Text;
subitems[3]:=edit4.Text;
subitems[4]:=s;
subitems[5]:=edit5.Text;
end;
close;
end;
end;
//退出
procedure Tf_RealtyB111.Button6Click(Sender: TObject);
begin
Close;
end;
procedure Tf_RealtyB111.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -