delphi公寓管理系统设计与实现(源代码+论文)
收藏
资源目录
压缩包内文档预览:
编号:149740989
类型:共享资源
大小:4.71MB
格式:RAR
上传时间:2021-10-10
上传人:好资料QQ****51605
认证信息
个人认证
孙**(实名认证)
江苏
IP属地:江苏
20
积分
- 关 键 词:
-
delphi
公寓
管理
系统
设计
实现
源代码
论文
- 资源描述:
-
delphi公寓管理系统设计与实现(源代码+论文),delphi,公寓,管理,系统,设计,实现,源代码,论文
- 内容简介:
-
Delphi课程设计报告 姓名:朱大鹏 计科系022班 学号:0204111085 【设计题目】 公寓管理系统【设计目的】 .熟悉delphi编程的环境;.熟练使用SQL Server数据库,及SQL;.能够系统地规划程序设计的步骤;.做一个合理、有效的系统,方便公寓管理;【系统分析】公寓管理系统是为方便管理公寓日常事务的系统,它应该具备的功能有:建立设置楼层信息,建立必要的学生档案,及学生的住宿情况,删除过期的学生档案,可以按多种方式查询学生的档案,登记来访人员的信息,登记贵重物品的搬出情况,记录和排序各寝室的卫生评比情况(尚未实现),记录各寝室的财产状况,等等。要尽可能使系统人性化(易操作,界面友好),健壮(尽量避免系统错误,对用户的误操作加以限制)以及节省系统资源,等等。【概要设计】【详细设计】 本系统所用的是SQL Server数据库,用到了以下五个表: 本系统主要由菜单驱动,其主要功能描述如下:1. 登陆窗口:procedure TForm_flash.SpeedButton1Click(Sender: TObject);varlogname,pawor:string;begin query1.Close; query1.SQL.Clear; logname:=ComboBox1.Text; query1.SQL.Add(select * from userinfo where username=:username and password=:password); query1.ParamByName(username).AsString:=ComboBox1.Text; query1.ParamByName(password).AsString:=Edit1.Text; query1.Open; if query1.RecordCount=1 then begin pawor:=query1.FieldList.Fields2.Value; /获得用户权限 application.CreateForm(Tform_main,form_main); form_flash.Free; form_main.Show; form_main.StatusBar1.Panels1.Text:=logname; form_main.StatusBar1.Panels3.Text:=pawor; if pawor=超级用户 then form_main.menu_config_uesr.Enabled:=true; /超级用户可以使用用户设置菜单项 end else begin showmessage(Error:密码错误!); edit1.Text:=; edit1.SetFocus; end ;end;2. 主窗体: procedure TForm_main.Timer1Timer(Sender: TObject);var dow:string;begin case dayofweek(date() of 1: dow:=日; 2: dow:=一; 3: dow:=二; 4: dow:=三; 5: dow:=四; 6: dow:=五; 7: dow:=六; end; statusbar1.Panels.Items5.Text:=datetostr(date()+ +timetostr(time(); statusbar1.Panels.Items6.Text:=星期+dow;end;procedure TForm_main.menu_config_uesrClick(Sender: TObject);begin application.CreateForm(TForm_userconfig,Form_userconfig); Form_userconfig.ShowModal;end;procedure TForm_main.FormCreate(Sender: TObject);begin projectdir.Caption:=getcurrentdir; /获得工程所在的路径 end;(下面代码省略)3. 主要菜单:系统设置: 学生管理: 出入登记: 4. 楼层设置窗体: procedure TForm_floorconfig1.But_submit1Click(Sender: TObject);var floorcount,roomcount :integer; f,r :integer;begin /在个Edit都不能为空 if Edit_floorNum.Text= then begin showmessage(楼房号不能为空!); Edit_floorNum.SetFocus; end else if Edit_floorcount.Text= then begin showmessage(楼层数不能为空!); Edit_floorcount.SetFocus; end else if Edit_roomcount.Text= then begin showmessage(每层房间数不能为空!); Edit_roomcount.SetFocus; end else begin floorcount:=strtoint(Form_floorconfig1.Edit_floorcount.Text); roomcount:=strtoint(Form_floorconfig1.Edit_roomcount.Text); for f:=1 to floorcount do with Form_floorconfig1.Query1 do begin for r:=1 to roomcount do begin Close; SQL.Clear; SQL.Add(insert into room(Num_room) values(:x1); if r0 then /如果有这个学号的学生,载入照片Image1.Picture.LoadFromFile(form_jectdir.caption+image+query1.FieldList.Fields0.Value+.bmp) else begin showmessage(没有这个学生!); Edit5.SetFocus; end;end;6. 添加学生信息窗体:procedure TForm_infos_s.Button1Click(Sender: TObject);begin if Edit1.Text then begin with Form_infos_s.query1 do begin close; sql.Clear; sql.Add(insert into student values(:sno,:sdept,:time_s,:sname,:ssex,:Num_room,:Num_bed,:remark); ParamByName(sno).AsString:=Form_infos_s.Edit1.Text; ParamByName(sdept).AsString:=Form_infos_s.ComboBox1.Text; ParamByName(time_s).AsString:=Form_infos_s.ComboBox2.Text; ParamByName(sname).AsString:=Form_infos_s.Edit2.Text; if RadioButton1.Checked then ParamByName(ssex).AsString:=男; if RadioButton2.Checked then ParamByName(ssex).AsString:=女; ParamByName(Num_room).AsString:=Form_infos_s.Edit3.Text; ParamByName(Num_bed).AsString:=Form_infos_s.Edit4.Text; ParamByName(remark).AsString:=Form_infos_s.Memo1.Text; Form_infos_s.query1.ExecSQL; /if Form_infos.Image1.Picture. Form_infos_s.Image1.Picture.SaveToFile(form_jectdir.caption+image+Edit1.Text+.bmp); query2.ParamByName(Num_room).AsString:=edit3.Text; query2.ExecSQL; showmessage(OK,添加成功!); Form_infos_s.Close; end; end else begin showmessage(请填写学号!); end;end;procedure TForm_infos_s.Edit1Exit(Sender: TObject);begin query3.Close; / 下面的query3.Open使得query3处于active状态,不再接受再次的参数赋值 query3.ParamByName(sno).AsString:=edit1.Text; query3.Open; if query3.RecordCount0 then begin showmessage(已经存在相同的学号!); edit1.SetFocus; end;end;7. 删除学生信息的窗体:procedure TForm_infos_del.Button3Click(Sender: TObject);begin if RadioButton1.Checked then begin if edit1.Text= then begin showmessage(请填写学号!); edit1.SetFocus; end else if MessageDlg(确认删除+edit1.Text,mtConfirmation,mbOkCancel,0)=mrOk then begin query1.Close; query1.SQL.Clear; query1.SQL.Add(delete from student where sno=:sno); query1.ParamByName(sno).AsString:=edit1.Text; query1.ExecSQL; query2.ParamByName(Num_room).AsString:=Num_room; query2.ExecSQL; edit1.Text:=; end; end; if RadioButton3.Checked then begin if edit2.Text= then begin showmessage(请填写寝室号!); edit2.SetFocus; end else if edit3.Text= then begin showmessage(请填写床位号!); edit3.SetFocus; end else if MessageDlg(确认删除?,mtConfirmation,mbOkCancel,0)=mrOk then begin query1.Close; query1.SQL.Clear; query1.SQL.Add(delete from student where Num_room=:Num_room and Num_bed=:Num_bed); query1.ParamByName(Num_room).AsString:=edit2.Text; query1.ParamByName(Num_bed).AsString:=edit3.Text; query1.ExecSQL; edit2.Text:=; edit3.Text:=; end; end;end;procedure TForm_infos_del.Button2Click(Sender: TObject);begin if Form_infos_del.Edit2.Text then begin Form_info_q3.Edit5.Text:=Form_infos_del.Edit2.Text; Form_info_q3.Show; Form_info_q3.Button1.Click; if Form_info_q3.query1.RecordCount0 then Button3.enabled:=true else begin Button3.enabled:=false; edit2.SetFocus; end; end else begin showmessage(请填写要查找的寝室号!); end;end;8. 来访进入楼时的登记窗体:procedure TForm_vist_in.Button2Click(Sender: TObject);begin if (edit1.Text) and (edit5.Text) and (edit2.Text) then begin query1.Close; query1.SQL.Clear; query1.SQL.Add(insert into vist_log (visitor_name,host_name,host_room,relation,time_in,time_out,watch,certificate,remark) values(:visitor_name,:host_name,:host_room,:relation,:time_in,:time_out,:watch,:certificate,:remark); query1.ParamByName(visitor_name).AsString:=Edit2.Text; query1.ParamByName(host_name).AsString:=Edit1.Text; query1.ParamByName(host_room).AsString:=Edit5.Text; query1.ParamByName(relation).AsString:=ComboBox1.Text; query1.ParamByName(time_in).AsString:=Edit3.Text; query1.ParamByName(time_out).AsString:=Edit4.Text; query1.ParamByName(watch).AsString:=ComboBox2.Text; query1.ParamByName(certificate).AsString:=ComboBox3.Text; query1.ParamByName(remark).AsString:=Memo1.Text; query1.ExecSQL; showmessage(已记入数据库,访问完请急时下楼登记!); Form_vist_in.Close; end else begin showmessage(请完整填写信息!); end;end;9. 来访出楼时的登记窗体: procedure TForm_vist_out2.Button1Click(Sender: TObject);begin query1.Close; query1.SQL.Clear; query1.SQL.Add(update vist_log set time_out=:time_out ,is_out=1 where id=:id); query1.ParamByName(time_out).AsString:=Edit4.Text; query1.ParamByName(id).AsInteger:=Form_vist_out.DataSource1.DataSet.FieldList.Fields0.Value; query1.ExecSQL; showmessage(登记完毕!); Form_vist_out2.Close;end;10贵重物品搬出登记:procedure TForm_valuables_move.Button1Click(Sender: TObject);begin if (Edit1.Text) and (Edit2.Text) and (Edit3.Text) and(Edit4.Text) and(Edit5.Text) then begin query1.Close; query1.ParamByName(name_res).AsString:=Edit1.Text; query1.ParamByName(name_man).AsString:=Edit2.Text; query1.ParamByName(type_cer).AsString:=Edit3.Text; query1.ParamByName(num_cer).AsString:=Edit4.Text; query1.ParamByName(reason).AsString:=Edit5.Text; query1.ParamByName(time_move).AsString:=Label8.Caption; query1.ParamByName(watch).AsString:=Label10.Caption; query1.ParamByName(remark).AsString:=Memo1.Text; query1.ExecSQL; showmessage(登记完成!)
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。