📄 realtyf42ad.pas
字号:
unit RealtyF42AD;
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_RealtyF42AD = class(TForm)
L1: TLabel;
L2: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
edit4: TEdit;
Edit3: TEdit;
Label4: TLabel;
edit5: TEdit;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Edit9: TEdit;
Label9: TLabel;
Edit10: TEdit;
edit2: TDateTimePicker;
edit7: TDateTimePicker;
edit8: TComboBox;
edit6: TComboBox;
button1: TButton;
Button2: TButton;
Button3: TButton;
CheckBox1: TCheckBox;
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 Button3Click(Sender: TObject);
procedure button1Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure edit6Select(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
bOK:bool;
T:string;
end;
var
f_RealtyF42AD: Tf_RealtyF42AD;
sNum:string;
implementation
uses data, main,RealtyF42A,Car4s931,RealtyL23,realtyI11C;
{$R *.dfm}
procedure Tf_RealtyF42AD.FormCreate(Sender: TObject);
var
i:integer;
query:TADOQuery;
s:string;
begin
Query:=TADOQuery.Create(nil);
Query.Connection:=DataModuleADO.ADOConnection1;
edit8.Items.Add('满意');
edit8.Items.Add('不满意');
edit8.Items.Add('非常满意');
edit8.Items.Add('非常不满意');
edit6.Items.Add('新增回访方式');
query.SQL.Add('select * from 辅助资料 where 类别 ='''+'回访方式'+'''');
query.Open;
while not query.Eof do
begin
edit6.Items.Add(query.fieldbyname('名称').Value);
query.Next;
end;
if f_RealtyF42A.bnew=true then
begin
edit2.date:=date;
edit7.date:=date;
end;
if f_RealtyF42A.bnew=false then
begin
edit1.Text:=f_RealtyF42A.ListView1.Selected.Caption;
edit2.date:=strtodate(f_RealtyF42A.ListView1.Selected.SubItems[0]);
edit3.Text:=f_RealtyF42A.ListView1.Selected.SubItems[1];
if f_RealtyF42A.ListView1.Selected.SubItems[3]='Y' then checkbox1.Checked:=true
else checkbox1.Checked:=false;
edit4.Text:=f_RealtyF42A.ListView1.Selected.SubItems[3];
edit5.Text:=f_RealtyF42A.ListView1.Selected.SubItems[4];
edit6.ItemIndex:=edit6.Items.IndexOf(f_RealtyF42A.ListView1.Selected.SubItems[5]);
edit7.date:=strtodate(f_RealtyF42A.ListView1.Selected.SubItems[6]);
edit8.ItemIndex:=edit8.Items.IndexOf(f_RealtyF42A.ListView1.Selected.SubItems[7]);
edit9.Text:=f_RealtyF42A.ListView1.Selected.SubItems[8];
edit10.Text:=f_RealtyF42A.ListView1.Selected.SubItems[9];
end;
end;
//Tab
procedure Tf_RealtyF42AD.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_RealtyF42AD.Button2Click(Sender: TObject);
begin
f_RealtyL23:=Tf_RealtyL23.Create(self);
f_RealtyL23.Button2.Visible:=true;
f_RealtyL23.ShowModal;
if f_RealtyL23.bOk=true then
begin
edit3.Text:=f_RealtyL23.sName;
end;
end;
procedure Tf_RealtyF42AD.ToolButton10Click(Sender: TObject);
begin
close;
end;
//新增
procedure Tf_RealtyF42AD.Button3Click(Sender: TObject);
begin
f_RealtyL23:=Tf_RealtyL23.Create(self);
f_RealtyL23.Button2.Visible:=true;
f_RealtyL23.ShowModal;
if f_RealtyL23.bOk=true then
begin
edit5.Text:=f_RealtyL23.sName;
end;
end;
procedure Tf_RealtyF42AD.button1Click(Sender: TObject);
begin
f_realtyI11C:=Tf_realtyI11C.Create(self);
f_RealtyI11C.button1.Visible:=true;
f_realtyI11C.ShowModal;
if f_realtyI11C.bOk=true then
begin
edit1.Text:=f_realtyI11C.ListView1.Selected.SubItems[0];
end;
end;
procedure Tf_RealtyF42AD.Button7Click(Sender: TObject);
var
s1:string;
begin
s1:='N';
if checkbox1.Checked=true then s1:='Y';
if edit1.Text='' then
begin
showmessage('请选择处理单位');
edit1.SetFocus;
exit;
end;
if edit3.Text='' then
begin
showmessage('请选择处理人');
edit3.SetFocus;
exit;
end;
if edit5.Text='' then
begin
showmessage('请选择回访人');
edit5.SetFocus;
exit;
end;
if edit6.Text='' then
begin
showmessage('请选择回访方式');
edit6.SetFocus;
exit;
end;
if edit8.Text='' then
begin
showmessage('请选择满意程度');
edit8.SetFocus;
exit;
end;
if edit10.Text='' then edit10.Text:='-';
if edit9.Text='' then edit9.Text:='-';
if edit4.Text='' then edit4.Text:='-';
if f_RealtyF42A.bnew=true then
begin
with f_RealtyF42A.ListView1.Items.Add do
begin
caption:=edit1.Text;
subitems.Add(datetostr(Edit2.date));
subitems.Add(edit3.Text);
subitems.Add(S1);
subitems.Add(edit4.Text);
subitems.Add(edit5.Text);
subitems.Add(edit6.Text);
subitems.Add(datetostr(Edit7.date));
subitems.Add(edit8.Text);
subitems.Add(edit9.Text);
subitems.Add(edit10.Text);
end;
if f_RealtyF42A.listview1.Items.Count>0 then f_RealtyF42A.listview1.Items.Item[0].Selected:=true;
edit1.Text:='';
edit2.date:=date;
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.ItemIndex:=edit6.items.IndexOf('');
edit7.date:=date;
edit8.ItemIndex:=edit8.Items.IndexOf('');
edit9.Text:='';
edit10.Text:='';
checkbox1.Checked:=false;
end;
if f_RealtyF42A.bnew=false then
begin
with f_RealtyF42A.ListView1.Selected do
begin
caption:=edit1.Text;
subitems[0]:=datetostr(Edit2.date);
subitems[1]:=edit3.Text;
subitems[2]:=S1;
subitems[3]:=edit4.Text;
subitems[4]:=Edit5.Text;
subitems[5]:=edit6.Text;
subitems[6]:=datetostr(edit7.date);
subitems[7]:=Edit8.Text;
subitems[8]:=edit9.Text;
subitems[9]:=edit10.Text;
end;
close;
end;
end;
procedure Tf_RealtyF42AD.Button5Click(Sender: TObject);
begin
close;
end;
procedure Tf_RealtyF42AD.edit6Select(Sender: TObject);
begin
if edit6.Text='新增回访方式' then
begin
mainform.t1:='回访方式';
f_Car4s931:=Tf_Car4s931.Create(self);
f_Car4s931.showmodal;
if f_Car4s931.bOK=true then
begin
edit6.Items.Add(mainform.t1);
edit6.ItemIndex:=edit6.Items.IndexOf(mainform.t1);
end
else edit6.ItemIndex:=edit6.Items.IndexOf('');
end;
end;
procedure Tf_RealtyF42AD.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -