仓库管理系统delphi源码(DOC68页)[68页].docx
《仓库管理系统delphi源码(DOC68页)[68页].docx》由会员分享,可在线阅读,更多相关《仓库管理系统delphi源码(DOC68页)[68页].docx(68页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、最新资料推荐unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, ADODB, jpeg, ExtCtrls;type TForm1 = class(TForm) ADOConnection1: TADOConnection; ADOQuery1: TADOQuery; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TButton; ADOT
2、able1: TADOTable; Image1: TImage; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Button3: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private Private declarations public count:integer; Public dec
3、larations end;var Form1: TForm1;implementationuses Unit12,Unit19;$R *.dfmprocedure TForm1.Button1Click(Sender: TObject); var yonghu:string;begin yonghu:=trim(edit1.Text);/trim去除字符串空格 count:=count+1;/登陆次数 with adoquery1 do begin Close; SQL.Clear; SQL.text:=select * from 用户信息表 where 用户名=+yonghu+; open
4、; if (adoQuery1.RecordCount0) and (edit2.Text) and (adoQuery1.FieldByName(密码).AsString= edit2.Text) then begin if adoQuery1.FieldByName(是否管理员).AsString =True then begin form12.SpeedButton1.Visible:=true; form12.Button13.Visible:=true; application.MessageBox(密码正确,即将进入系统。,提示,mb_ok); form1.Hide; form12
5、.Show; end else begin form12.SpeedButton1.Visible:=false; form12.Button13.Visible:=false; application.MessageBox(密码正确,即将进入系统。,提示,mb_ok); form1.Hide; form12.Show; end; end else begin if (count=1) then begin application.MessageBox(用户名或密码错误,还剩2次机会,提示,mb_ok); edit1.SetFocus;/光标是向左对齐的 也就是在编辑框的最左边 end; if
6、(count=2) then begin application.MessageBox(您还有最后一次机会,请仔细核对用户名和密码,提示,mb_ok); edit1.Clear; edit2.clear; edit1.SetFocus; end; if (count=3) then begin application.MessageBox(密码错误超过三次系统即将关闭,提示,mb_ok); application.Terminate;/退出程序 end; end; end;end;procedure TForm1.Button2Click(Sender: TObject);begin appl
7、ication.Terminate;end;procedure TForm1.Button3Click(Sender: TObject);begin form19.ShowModal;end;End.unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, jpeg, ExtCtrls, DB, ADODB;type TForm2 = class(TForm) Image1: TIma
8、ge; Label1: TLabel; GroupBox1: TGroupBox; DBGrid1: TDBGrid; Button1: TButton; GroupBox2: TGroupBox; GroupBox3: TGroupBox; GroupBox4: TGroupBox; Label3: TLabel; Label4: TLabel; Edit1: TEdit; Edit2: TEdit; Label5: TLabel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; Button2: TButton; Label6
9、: TLabel; Label7: TLabel; Edit3: TEdit; RadioButton3: TRadioButton; RadioButton4: TRadioButton; Button3: TButton; ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; ADOQuery2: TADOQuery; DataSource1: TDataSource; procedure Button1Click(Sender: TObject); procedure Button2Clic
10、k(Sender: TObject); procedure Button3Click(Sender: TObject); procedure FormShow(Sender: TObject); private Private declarations public Public declarations end;var Form2: TForm2;implementation$R *.dfmprocedure TForm2.Button1Click(Sender: TObject);begin if application.MessageBox(请确认是否要删除, 超市仓库管理系统, mb_
11、iconinformation +mb_yesno) = idyes then/MB_ICONINFORMATION是显示出的对话框里会有一个“i”图标,mb_yesno同时显示确定和取消按钮,idyes单击”是“按钮 ADOtable1.Delete;end;procedure TForm2.Button2Click(Sender: TObject);var yonghuming,mima:string; quanxian:boolean;begin if (edit1.Text) and (edit2.Text) and (radiobutton1.Checked xor radiobut
12、ton2.Checked) then begin yonghuming:=edit1.Text; adoquery1.Close; adoquery1.SQL.Text := select * from 用户信息表 where 用户名= +yonghuming+ ; adoquery1.open; if not adoquery1.Eof then/判断表是否为空 begin MessageBox(handle, 此用户名已存在!, 提示, mb_IconInformation + mb_Ok); exit; end; mima:=edit2.Text; if radiobutton1.Che
13、cked=true then quanxian:=true else quanxian:=false; adotable1.InsertRecord(yonghuming,mima,quanxian); adotable1.Close; /把ADOTable控件对应的数据源关闭 adotable1.Open;/重新打开ADOTable控件对应的数据源,这样做的目的是刷新数据源 showmessage(新建用户添加成功); edit1.Clear; edit2.Clear; radiobutton1.Checked:=false; radiobutton2.Checked:=false; end
14、 else showmessage(信息填写不全);end;procedure TForm2.Button3Click(Sender: TObject);var yonghuming:string; quanxian:boolean;begin if (edit3.Text) and (radiobutton3.Checked xor radiobutton4.Checked) then begin yonghuming:=edit3.Text; adoquery1.Close; adoquery1.SQL.Text := select * from 用户信息表 where 用户名= +yon
15、ghuming+ ; adoquery1.open; if adoquery1.RecordCount = 0 then begin showmessage(不存在此用户,请重新输入); edit3.SetFocus; exit; end; if radiobutton3.Checked=true then quanxian:=true else quanxian:=false; if application.MessageBox(请确认是否要修改, 超市仓库管理系统, mb_iconinformation + mb_yesno) = idyes then begin adotable1.Lo
16、cate(用户名,yonghuming,); adotable1.Edit; adotable1是否管理员:=quanxian; adotable1.Post; adotable1.Close; adotable1.Open;/更改一个已经从数据库中读取的数据库表格 showmessage(修改成功); end; end else showmessage(信息填写不全);end; procedure TForm2.FormShow(Sender: TObject);beginadoconnection1:=TADOConnection.Create(nil);/动态创建ADO控件adoconn
17、ection1.LoginPrompt:=false;/如果不加这句的话,每次连接数据库时都会跳出一个身份验证对话框,要求你输入用户名和密码adoconnection1.Connected:=false;/释放连接adoconnection1.ConnectionString:=Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=天天;Data Source=WIN-RNSK1TMAK9L;adoconnection1.Connected:=true;adotable1:=TADOTable.Cr
18、eate(nil);adotable1.Connection:=adoconnection1;adotable1.TableName:=用户信息表;adotable1.Open;datasource1.DataSet:=adotable1;adoquery1:=TADOQuery.Create(nil);adoquery1.Connection:=adoconnection1;adoquery2:=TADOQuery.Create(nil);adoquery2.Connection:=adoconnection1;end;end.unit Unit3;interfaceuses Windows
19、, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ADODB, DB, StdCtrls, Grids, DBGrids, jpeg, ExtCtrls;type TForm3 = class(TForm) GroupBox1: TGroupBox; GroupBox2: TGroupBox; GroupBox3: TGroupBox; Image1: TImage; Label1: TLabel; DBGrid1: TDBGrid; Button1: TButton; Button2: T
20、Button; Button3: TButton; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; Edit7: TEdit; ComboBox1: TComboBox; ComboBox2
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 68页 仓库 管理 系统 delphi 源码 DOC68 68
限制150内