Delphi+Access学生信息管理系统10Word文档格式.docx
《Delphi+Access学生信息管理系统10Word文档格式.docx》由会员分享,可在线阅读,更多相关《Delphi+Access学生信息管理系统10Word文档格式.docx(19页珍藏版)》请在冰豆网上搜索。
ComboBox1:
TComboBox;
Edit1:
TEdit;
Label1:
TLabel;
Timer1:
TTimer;
lblMsg:
Label2:
shpBall2:
TShape;
shpBall1:
procedureFormShow(Sender:
TObject);
procedureButton1Click(Sender:
procedureButton2Click(Sender:
procedureTimer1Timer(Sender:
private
{Privatedeclarations}
public
{Publicdeclarations}
end;
var
FormLogin:
TFormLogin;
nowUser:
String;
nowPower:
integer;
implementation
{$R*.dfm}
usesUnitDataModule,UnitConsole;
varisStop:
boolean;
procedureTFormLogin.FormShow(Sender:
begin
dataModule1.adoTable1.Open;
whiledataModule1.adoTable1.EOF<
>
truedo
begin
comboBox1.Items.Append(dataModule1.adoTable1.FieldValues['
user'
]);
dataModule1.adotable1.Next;
dataModule1.adoTable1.Close;
isStop:
=false;
lblMsg.Visible:
end;
procedureTFormLogin.Button1Click(Sender:
varuser1,pwd1:
string;
user1:
=comboBox1.Text;
pwd1:
=edit1.Text;
dataModule1.adoTable1.First;
whilenotdataModule1.adoTable1.EOFdo
if(user1=DataModule1.adoTable1.FieldValues['
])and(pwd1=DataModule1.adoTable1.FieldValues['
pwd'
])then
nowUser:
=user1;
dataModule1.ADOQuery1.Close;
dataModule1.ADOQuery1.SQL.Clear;
dataModule1.ADOQuery1.SQL.Add('
selectpowerfromAccountwhereuser='
'
+nowUser+'
);
dataModule1.ADOQuery1.Open;
nowPower:
=dataModule1.ADOQuery1.Fields[0].AsInteger;
formConsole.Show;
Exit;
DataModule1.adoTable1.Next;
ShowMessage('
登录失败,请重试!
edit1.Text:
='
;
comboBox1.SetFocus;
DataModule1.adoTable1.Close;
procedureTFormLogin.Button2Click(Sender:
Application.Terminate;
procedureTFormLogin.Timer1Timer(Sender:
if(notisStop)then
shpBall1.Left:
=shpBall1.Left-10;
shpBall2.Left:
=shpBall2.Left+10;
if(shpBall1.Left<
=100)thenisStop:
=true;
end
elselblMsg.Visible:
end.
预览界面:
UnitConsole.pas
unitUnitConsole;
Dialogs,Menus,Grids,DBGrids,StdCtrls,ExtCtrls,jpeg;
TFormConsole=class(TForm)
MainMenu1:
TMainMenu;
view1:
TMenuItem;
User:
quit1:
DBGrid1:
TDBGrid;
DBGrid2:
Add:
help:
userMang:
time1:
lblSec:
lblNote:
lblMin:
lblHour:
editSec:
editMin:
editHour:
procedureview1Click(Sender:
procedurequit1Click(Sender:
procedureAddUserClick(Sender:
procedureuserMangClick(Sender:
procedureAddClick(Sender:
procedurehelpClick(Sender:
procedureFormCreate(Sender:
proceduretime1Timer(Sender:
FormConsole:
TFormConsole;
usesUnitView,UnitAdd,UnitDataModule,UnitUserMang,UnitLogin;
varhour,min,sec,msec:
word;
procedureTFormConsole.view1Click(Sender:
formView.ShowModal;
procedureTFormConsole.quit1Click(Sender:
procedureTFormConsole.AddUserClick(Sender:
formAdd.ShowModal;
procedureTFormConsole.userMangClick(Sender:
formUserMang.ShowModal;
procedureTFormConsole.AddClick(Sender:
if(nowPower=1)thenformAdd.ShowModal
elseShowMessage('
您没有权限添加新用户,请联系管理员!
procedureTFormConsole.helpClick(Sender:
Delphi学生信息管理系统1.0,纪念于2012.5.20.'
procedureTFormConsole.FormShow(Sender:
withdataModule1.ADOQuery1do
Close;
SQL.Text:
select*fromStudent'
Open;
procedureTFormConsole.FormCreate(Sender:
DecodeTime(Now,hour,min,sec,msec);
editHour.Text:
=IntToStr(hour);
editMin.Text:
=IntToStr(min);
editSec.Text:
=IntToStr(sec);
procedureTFormConsole.time1Timer(Sender:
sec:
=sec+1;
if(sec=60)then
min:
=min+1;
=0;
if(min=60)then
hour:
=hour+1;
if(hour=24)then
=IntToStr(