Delphi学生宿舍管理系统的设计与实现 第10页

Delphi学生宿舍管理系统的设计与实现 第10页
 begin
   if edit1.Text='' then
  begin
  messagebeep(0);
   showmessage('你还没输入用户名,请先输入登录名!');
   edit1.SetFocus;
   exit;
   end;
  if edit2.Text='' then
  begin
  messagebeep(0);
  showmessage('对不起登录系统不能用空密码,请输入密码');
  edit2.SetFocus;
  exit;
  end;
 if table1.Locate('yonghuming',edit1.Text,[locaseinsensitive]) then
   begin
    if edit2.Text=dbedit1.Text then
      begin
       table1.Close;
       fmdenglu.Hide;
       PfmMain:=TPfmMain.Create(self);
       try
       PfmMain.ShowModal;
       finally
       PfmMain.Free;
       end;
       exit;
       end
       else
       begin
       messagebeep(0);
       showmessage('密码错误!请重新输入!');
       edit2.Text:='';
       edit2.SetFocus;
       exit;
       end;
     end
    else
    begin
    messagebeep(0);
    showmessage('对不起!不存在此用户,请重新输入!');
    edit1.SetFocus;
    end;
  end;
end;

procedure Tfmdenglu.SpeedButton3Click(Sender: TObject);
begin
fmyonghu:=Tfmyonghu.Create(self);
try
fmyonghu.ShowModal;
finally
fmyonghu.Free;
end;
end;

procedure Tfmdenglu.FormClose(Sender: TObject; var Action: TCloseAction);
begin
table1.Close;
application.Terminate;
end;

end.

住宿录入界面代码:
unit Pzhusuluru;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, ExtCtrls, DBCtrls, Buttons, StdCtrls, ComCtrls;
type
  Tfmluru = class(TForm)
    StatusBar1: TStatusBar;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edit2: TEdit;
    Edit3: TEdit;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Edit4: TEdit;
    GroupBox4: TGroupBox;
    SpeedButton2: TSpeedButton;
    SpeedButton1: TSpeedButton;
    DBNavigator1: TDBNavigator;
    GroupBox3: TGroupBox;
    DBGrid1: TDBGrid;
    Label7: TLabel;
    SpeedButton3: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
    procedure qingkong;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmluru: Tfmluru;
implementation
uses Pmain;
{$R *.dfm}
procedure Tfmluru.qingkong;
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
combobox1.Text:='';
combobox2.Text:='';
edit4.Text:='';
edit1.SetFocus;
end;

procedure Tfmluru.SpeedButton1Click(Sender: TObject);
begin
if edit1.Text='' then
  begin
  showmessage('你还没输入姓名,请确认!');
  edit1.SetFocus;
  exit;
  end;
if edit2.Text='' then
  begin

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有