?? realtyb111a.pas
字號(hào):
unit RealtyB111A;
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_RealtyB111A = 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 ComboBox1Select(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
bOK,bOK2:bool;
bMod:bool;
sNum:string;
end;
var
f_RealtyB111A: Tf_RealtyB111A;
implementation
uses data, main,RealtyB22A,Car4s931;
{$R *.dfm}
//初始化
procedure Tf_RealtyB111A.FormCreate(Sender: TObject);
Var
query:TADOQuery;
begin
query:=TADOQuery.Create(nil);
query.Connection:=DataModuleADO.ADOConnection1;
ComboBox1.Items.Add('新增開(kāi)戶銀行');
query.SQL.Add('select distinct 名稱 from 輔助資料 where 類別='''+'開(kāi)戶銀行'+'''');
query.Open;
while not query.Eof do
begin
ComboBox1.Items.Add(query.fieldbyname('名稱').Value);
query.next;
end;
ComBoBox2.Items.Add('個(gè)人');
ComBoBox2.Items.Add('公家');
if f_RealtyB22A.bMod then
begin
edit2.Text:=f_RealtyB22A.ListView1.Selected.Caption;
combobox1.ItemIndex:=combobox1.Items.IndexOf(f_RealtyB22A.ListView1.Selected.SubItems[0]);
edit3.Text:=f_RealtyB22A.ListView1.Selected.SubItems[1];
combobox2.ItemIndex:=combobox2.Items.IndexOf(f_RealtyB22A.ListView1.Selected.SubItems[2]);
edit4.Text:=f_RealtyB22A.ListView1.Selected.SubItems[3];
if f_RealtyB22A.ListView1.Selected.SubItems[4]<>'N' then checkbox1.Checked:=true
else checkbox1.Checked:=false;
edit5.Text:=f_RealtyB22A.ListView1.Selected.SubItems[5];
end;
end;
//Tab
procedure Tf_RealtyB111A.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_RealtyB111A.Button5Click(Sender: TObject);
Var
s:string;
begin
if edit2.Text='' then
begin
showmessage('開(kāi)戶名稱不能為空!');
edit2.SetFocus;
exit;
end;
if edit3.Text='' then edit3.Text:='-';
if edit4.Text='' then edit4.Text:='-';
if edit5.Text='' then edit5.Text:='-';
if f_RealtyB22A.bMod then
begin
if checkbox1.Checked then s:='Y'
else s:='N';
with f_RealtyB22A.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
else
begin
if checkbox1.Checked then s:='Y'
else s:='N';
with f_RealtyB22A.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;
end;
//退出
procedure Tf_RealtyB111A.Button6Click(Sender: TObject);
begin
Close;
end;
procedure Tf_RealtyB111A.ComboBox1Select(Sender: TObject);
begin
if ComboBox1.Text='新增開(kāi)戶銀行' then
begin
mainform.t1:='開(kāi)戶銀行';
f_Car4s931:=Tf_Car4s931.Create(self);
f_Car4s931.showmodal;
if f_Car4s931.bOK=true then
begin
ComboBox1.Items.Add(mainform.t1);
ComboBox1.ItemIndex:=ComboBox1.Items.IndexOf(mainform.t1);
end
else ComboBox1.ItemIndex:=ComboBox1.Items.IndexOf('');
end;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -