unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, XPStyleActnCtrls, ActnList,
ActnMan, DB, ADODB, Buttons;
type
TForm2 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Button2: TButton;
Button3: TButton;
Image1: TImage;
TabSheet4: TTabSheet;
GroupBox3: TGroupBox;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Edit17: TEdit;
Edit18: TEdit;
Edit19: TEdit;
Edit20: TEdit;
Edit21: TEdit;
Edit22: TEdit;
Edit23: TEdit;
Edit24: TEdit;
Edit25: TEdit;
Edit26: TEdit;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
Button1: TButton;
BitBtn1: TBitBtn;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
if edit17.Text=''then
messagebox(form2.Handle,'请输入姓名','警告',mb_ok+mb_iconwarning)
else
if edit18.Text=''then
messagebox(form2.Handle,'请输入性别','警告',mb_ok+mb_iconwarning)
else
if edit19.Text=''then
messagebox(form2.Handle,'请输入职位','警告',mb_ok+mb_iconwarning)
else
if edit20.Text=''then
messagebox(form2.Handle,'请输入生日','警告',mb_ok+mb_iconwarning)
else
if edit21.Text=''then
messagebox(form2.Handle,'请输入办公电话','警告',mb_ok+mb_iconwarning)
else
if edit26.Text=''then
messagebox(form2.Handle,'请输入移动电话','警告',mb_ok+mb_iconwarning)
else
if edit22.Text=''then
messagebox(form2.Handle,'请输入QQ','警告',mb_ok+mb_iconwarning)
else
if edit23.Text=''then
messagebox(form2.Handle,'请输入住址','警告',mb_ok+mb_iconwarning)
else
if edit24.Text=''then
messagebox(form2.Handle,'请输入兴趣爱好','警告',mb_ok+mb_iconwarning)
else
begin
with form1.ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('insert into Link(姓名,性别,职位,生日,办公电话,移动电话,QQ,住址,兴趣爱好,备注)values(');
sql.Add(''''+edit17.Text+''''+','+''''+edit18.Text+''''+','+''''+edit19.Text+'''');
sql.Add(','+''''+edit20.Text+''''+','+''''+edit21.Text+''''+','+''''+edit26.Text+''''+','+''''+edit22.Text+''''+','+''''+edit23.Text+''''+','+''''+edit24.Text+''''+','+''''+edit26.Text+''''+')');
execsql;
end;
messagebox(form2.Handle,'联系人信息添加成功','恭喜',mb_ok);
end;
end;
uses
Forms,
Unit11 in 'Unit11.pas' {Form11},
Unit10 in 'Unit10.pas' {Form10},
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm10, Form10);
Application.CreateForm(TForm11, Form11);
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.