![仓库管理系统delphi源码(DOC68页)_第1页](http://file3.renrendoc.com/fileroot_temp3/2021-12/17/35e7f654-da74-405e-a34d-635de8bf9efa/35e7f654-da74-405e-a34d-635de8bf9efa1.gif)
![仓库管理系统delphi源码(DOC68页)_第2页](http://file3.renrendoc.com/fileroot_temp3/2021-12/17/35e7f654-da74-405e-a34d-635de8bf9efa/35e7f654-da74-405e-a34d-635de8bf9efa2.gif)
![仓库管理系统delphi源码(DOC68页)_第3页](http://file3.renrendoc.com/fileroot_temp3/2021-12/17/35e7f654-da74-405e-a34d-635de8bf9efa/35e7f654-da74-405e-a34d-635de8bf9efa3.gif)
![仓库管理系统delphi源码(DOC68页)_第4页](http://file3.renrendoc.com/fileroot_temp3/2021-12/17/35e7f654-da74-405e-a34d-635de8bf9efa/35e7f654-da74-405e-a34d-635de8bf9efa4.gif)
![仓库管理系统delphi源码(DOC68页)_第5页](http://file3.renrendoc.com/fileroot_temp3/2021-12/17/35e7f654-da74-405e-a34d-635de8bf9efa/35e7f654-da74-405e-a34d-635de8bf9efa5.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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; ADOTable1:
2、 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 declarati
3、ons 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 用户名='''
4、+yonghu+'''' open; if (adoQuery1.RecordCount<>0) and (edit2.Text<>'') and (adoQuery1.FieldByName('密码').AsString= edit2.Text) then begin if adoQuery1.FieldByName('是否管理员').AsString ='True' then begin form12.SpeedButton1.Visible:=true; form12.
5、Button13.Visible:=true; application.MessageBox('密码正确,即将进入系统。','提示',mb_ok); form1.Hide; form12.Show; end else begin form12.SpeedButton1.Visible:=false; form12.Button13.Visible:=false; application.MessageBox('密码正确,即将进入系统。','提示',mb_ok); form1.Hide; form12.Show; end; end
6、else begin if (count=1) then begin application.MessageBox('用户名或密码错误,还剩2次机会','提示',mb_ok); edit1.SetFocus;/光标是向左对齐的 也就是在编辑框的最左边 end; if(count=2) then begin application.MessageBox('您还有最后一次机会,请仔细核对用户名和密码','提示',mb_ok); edit1.Clear; edit2.clear; edit1.SetFocus; end; if (cou
7、nt=3) then begin application.MessageBox('密码错误超过三次系统即将关闭','提示',mb_ok); application.Terminate;/退出程序 end; end; end;end;procedure TForm1.Button2Click(Sender: TObject);begin application.Terminate;end;procedure TForm1.Button3Click(Sender: TObject);begin form19.ShowModal;end;End.unit Unit2;
8、interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, jpeg, ExtCtrls, DB, ADODB;type TForm2 = class(TForm) Image1: TImage; Label1: TLabel; GroupBox1: TGroupBox; DBGrid1: TDBGrid; Button1: TButton; GroupBox2: TGroupBox; GroupBox3:
9、TGroupBox; GroupBox4: TGroupBox; Label3: TLabel; Label4: TLabel; Edit1: TEdit; Edit2: TEdit; Label5: TLabel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; Button2: TButton; Label6: TLabel; Label7: TLabel; Edit3: TEdit; RadioButton3: TRadioButton; RadioButton4: TRadioButton; Button3: TButto
10、n; ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; ADOQuery2: TADOQuery; DataSource1: TDataSource; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure FormShow(Sender: TObject); private Priva
11、te declarations public Public declarations end;var Form2: TForm2;implementation$R *.dfmprocedure TForm2.Button1Click(Sender: TObject);begin if application.MessageBox('请确认是否要删除', '超市仓库管理系统', mb_iconinformation +mb_yesno) = idyes then/MB_ICONINFORMATION是显示出的对话框里会有一个“i”图标,mb_yesno同时显示确定
12、和取消按钮,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 radiobutton2.Checked) then begin yonghuming:=edit1.Text; adoque
13、ry1.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 radiobutton
14、1.Checked=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.Chec
15、ked:=false; end 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.
16、Text := 'select * from 用户信息表 where 用户名=''' +yonghuming+'''' ; 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.
17、MessageBox('请确认是否要修改', '超市仓库管理系统', mb_iconinformation + mb_yesno) = idyes then begin adotable1.Locate('用户名',yonghuming,); adotable1.Edit; adotable1'是否管理员':=quanxian; adotable1.Post; adotable1.Close; adotable1.Open;/更改一个已经从数据库中读取的数据库表格 showmessage('修改成功'); end;
18、 end else showmessage('信息填写不全');end; procedure TForm2.FormShow(Sender: TObject);beginadoconnection1:=TADOConnection.Create(nil);/动态创建ADO控件adoconnection1.LoginPrompt:=false;/如果不加这句的话,每次连接数据库时都会跳出一个身份验证对话框,要求你输入用户名和密码adoconnection1.Connected:=false;/释放连接adoconnection1.ConnectionString:='Pr
19、ovider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=天天;Data Source=WIN-RNSK1TMAK9L'adoconnection1.Connected:=true;adotable1:=TADOTable.Create(nil);adotable1.Connection:=adoconnection1;adotable1.TableName:='用户信息表'adotable1.Open;datasource1.DataSet:=adotable1;adoquery1
20、:=TADOQuery.Create(nil);adoquery1.Connection:=adoconnection1;adoquery2:=TADOQuery.Create(nil);adoquery2.Connection:=adoconnection1;end;end.unit Unit3;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ADODB, DB, StdCtrls, Grids, DBGrids, jpeg, ExtCtrls;
21、type TForm3 = class(TForm) GroupBox1: TGroupBox; GroupBox2: TGroupBox; GroupBox3: TGroupBox; Image1: TImage; Label1: TLabel; DBGrid1: TDBGrid; Button1: TButton; Button2: TButton; Button3: TButton; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8:
22、 TLabel; Label9: TLabel; Label10: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; Edit7: TEdit; ComboBox1: TComboBox; ComboBox2: TComboBox; Label11: TLabel; ComboBox3: TComboBox; Edit8: TEdit; Button4: TButton; Button5: TButton; Button6: TButton; ADOConnec
23、tion1: TADOConnection; ADOTable1: TADOTable; DataSource1: TDataSource; ADOQuery1: TADOQuery; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); pr
24、ocedure Button6Click(Sender: TObject); procedure FormShow(Sender: TObject); private Private declarations public Public declarations end;var Form3: TForm3;implementation$R *.dfm procedure TForm3.FormShow(Sender: TObject);begin adoconnection1:=TADOConnection.Create(nil);adoconnection1.LoginPrompt:=fal
25、se;adoconnection1.Connected:=false;adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=411114;Persist Security Info=True;User ID=sa;Initial Catalog=天天;Data Source=win-rnsk1tmak9l'adoconnection1.Connected:=true;adotable1:=TADOTable.Create(nil);adotable1.Connection:=adoconnection1;a
26、dotable1.TableName:='商品信息表'adotable1.Open;datasource1.DataSet:=adotable1;adoquery1:=TADOQuery.Create(nil);adoquery1.Connection:=adoconnection1;adoquery1.Close;adoquery1.SQL.Clear;adoquery1.SQL.Text:='select 仓库名称 from 仓库信息表'adoquery1.Open; while not adoquery1.Eof do begin combobox2.It
27、ems.Add(adoquery1'仓库名称'); adoquery1.Next; end;end;procedure TForm3.Button2Click(Sender: TObject);begin adotable1.Edit;end;procedure TForm3.Button1Click(Sender: TObject);begin if application.MessageBox('确定要删除?', '超市仓库管理系统', mb_iconinformation + mb_yesno) = idyes thenbegin adot
28、able1.Delete; showmessage('删除成功'); end;end;procedure TForm3.Button3Click(Sender: TObject);begin adotable1.Post; showmessage('修改成功');end;procedure TForm3.Button4Click(Sender: TObject); vartemp:string; juti:string;begin juti:=edit8.Text; if(combobox3.Text<>'')and(edit8.Te
29、xt<>'') then begin if (combobox3.ItemIndex=0) then/ItemIndex=0列表标号从0开始 begin adotable1.Filtered:=false; adotable1.Filter:='商品编号='''+juti+'''' adotable1.Filtered:=true; end; if (combobox3.ItemIndex=1) then begin adotable1.Filtered:=false;/ 解除过滤 temp:=trim
30、('%'+juti+'%'); adotable1.Filter:='商品名称 like '''+temp+'''' adotable1.Filtered:=true; end; if (combobox3.ItemIndex=2) then begin adotable1.Filtered:=false; adotable1.Filter:='型号='''+juti+'''' adotable1.Filtered:=true; end
31、; if (combobox3.ItemIndex=3) then begin adotable1.Filtered:=false; adotable1.Filter:='仓库名称='''+juti+'''' adotable1.Filtered:=true; end; end;end;procedure TForm3.Button5Click(Sender: TObject);begin adotable1.Filtered:=false;adotable1.Close;adotable1.Open;end;procedure
32、TForm3.Button6Click(Sender: TObject);begin if (edit1.Text<>'') and (edit2.Text<>'') and (edit3.Text<>'') and (edit4.Text<>'') and (edit5.Text<>'') and (edit6.Text<>'') and (edit7.Text<>'') and (combobox
33、1.Text<>'') and (combobox2.Text<>'') then begin if application.MessageBox('确定要添加?', '超市仓库管理系统', mb_iconinformation + mb_yesno) = idyes then begin adotable1.InsertRecord(edit1.Text,edit2.Text,edit3.Text,combobox1.Text,edit4.Text,edit5.Text,combobox2.Text,ed
34、it6.Text,edit7.Text); adotable1.Close; adotable1.Open; showmessage('新商品添加成功'); end; end else showmessage('信息未填全');end;end.unit Unit4;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ADODB, DB, StdCtrls, Grids, DBGrids, jpeg, ExtCtrls;t
35、ype TForm4 = class(TForm) Image1: TImage; Label1: TLabel; GroupBox1: TGroupBox; GroupBox2: TGroupBox; DBGrid1: TDBGrid; DBGrid2: TDBGrid; Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; DataSource1: TDataSo
36、urce; DataSource2: TDataSource; ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; ADOQuery2: TADOQuery; ADOQuery3: TADOQuery; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Send
37、er: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Edit3KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); procedure DBGrid1CellClick(Column: TColumn); procedure FormShow(Sender: TObject); private Private declarations public Public decla
38、rations end;var Form4: TForm4;implementation$R *.dfmprocedure TForm4.Button1Click(Sender: TObject);begin if application.MessageBox('请确认是否要删除', '超市仓库管理系统', mb_iconinformation + mb_yesno) = idyes then begin adotable1.Delete; end;end;procedure TForm4.Button2Click(Sender: TObject);begin
39、adotable1.Edit;end;procedure TForm4.Button3Click(Sender: TObject);begin adotable1.Post;showmessage('修改成功');end;procedure TForm4.Button4Click(Sender: TObject);var cangku,dizhi,bianhao:string;begin if (edit1.Text<>'') and (edit2.Text<>'') and (edit3.Text<>'
40、;') then begin cangku:=edit1.Text; dizhi:=edit2.Text; bianhao:=edit3.Text; adoquery1.Close; adoquery1.SQL.Text := 'select * from 仓库信息表 where 仓库名称=''' +cangku+'''' ; adoquery1.open; if not adoquery1.Eof then begin MessageBox(handle, '此仓库名已存在!', '提示'
41、, mb_IconInformation + mb_Ok); exit; end; adoquery1.Close; adoquery1.SQL.Text := 'select * from 员工信息表 where 编号=''' +bianhao+'''' ; adoquery1.open; if adoquery1.RecordCount = 0 then begin showmessage('不存在此用户,请重新输入'); edit3.SetFocus; exit; end; if application.Me
42、ssageBox('确定要添加新仓库?', '超市仓库管理系统', mb_iconinformation + mb_yesno) = idyes then begin adotable1.InsertRecord(cangku,dizhi,bianhao); adotable1.Close; adotable1.Open; showmessage('新仓库添加成功'); end; end else showmessage('信息未填全');end;procedure TForm4.Edit3KeyUp(Sender: TObjec
43、t; var Key: Word; Shift: TShiftState); var bianhao:string;begin bianhao:=edit3.Text; with adoquery2 dobegin close; sql.clear; sql.add('select 姓名 from 员工信息表 where 编号='''+bianhao+''''); open; edit4.Text:=Fieldbyname('姓名').AsString; close; sql.clear; sql.add('
44、;select 电话 from 员工信息表 where 编号='''+bianhao+''''); open; edit5.Text:=Fieldbyname('电话').AsString;end;end;procedure TForm4.DBGrid1CellClick(Column: TColumn);vartemp:variant;workerId:string;begintemp:=DataSource1.DataSet.FieldValues'负责人编号'workerID:=VarToStr(te
45、mp);adoquery3.Close;adoquery3.SQL.Clear;adoquery3.SQL.Text:='select 编号,姓名,性别,电话,地址,出生日期,部门,职务 from 员工信息表 where 编号='''+workerid+''''adoquery3.Open; dbgrid2.Columns0.Width:=100; dbgrid2.Columns1.Width:=100; dbgrid2.Columns2.Width:=100; dbgrid2.Columns3.Width:=100; dbgri
46、d2.Columns4.Width:=100; dbgrid2.Columns5.Width:=100; dbgrid2.Columns6.Width:=100; dbgrid2.Columns7.Width:=100;end; procedure TForm4.FormShow(Sender: TObject);beginadoconnection1:=TADOConnection.Create(nil);adoconnection1.LoginPrompt:=false;adoconnection1.Connected:=false;adoconnection1.ConnectionStr
47、ing:='Provider=SQLOLEDB.1;Password=411114;Persist Security Info=True;User ID=sa;Initial Catalog=天天;Data Source=win-rnsk1tmak9l;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WIN-RNSK1TMAK9L'adoconnection1.Connected:=true;adotable1:=TADOTable.Create(nil);adota
48、ble1.Connection:=adoconnection1;adotable1.TableName:='仓库信息表'adotable1.Open;datasource1.DataSet:=adotable1;adoquery1:=TADOQuery.Create(nil);adoquery1.Connection:=adoconnection1;adoquery2:=TADOQuery.Create(nil);adoquery2.Connection:=adoconnection1;adoquery3.Connection:=adoconnection1;end;end.u
49、nit Unit5;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, ComCtrls, DBCtrls, DB, ADODB,JPEG, ExtCtrls;type TForm5 = class(TForm) GroupBox1: TGroupBox; Label1: TLabel; DBGrid1: TDBGrid; Button1: TButton; GroupBox2: TGroupBox;
50、 Label2: TLabel; Edit1: TEdit; Label3: TLabel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; Label4: TLabel; Edit2: TEdit; Label5: TLabel; Edit3: TEdit; Label6: TLabel; DateTimePicker1: TDateTimePicker; Label7: TLabel; ComboBox1: TComboBox; Label8: TLabel; Edit4: TEdit; Label9: TLabel; Gro
51、upBox3: TGroupBox; Label10: TLabel; ComboBox2: TComboBox; Edit5: TEdit; Button2: TButton; Button3: TButton; ADOConnection1: TADOConnection; ADOTable1: TADOTable; DataSource1: TDataSource; OpenDialog1: TOpenDialog; Button5: TButton; Button6: TButton; Edit6: TEdit; Image1: TImage; Image2: TImage; Labe
52、l11: TLabel; Button4: TButton; Button7: TButton; procedure Button5Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure Button6Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure DBGrid1CellClick(Column: TColumn); procedure Button4Click(Sender: TObject); proce
53、dure Button7Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private Private declarations public Public declarations end;var Form5: TForm5;implementation var myjpeg,myjpeg1:TJpegImage; tempstream,tempstream1:TMemoryStream;$R *.dfmprocedure TFo
54、rm5.Button5Click(Sender: TObject);var bianhao,yuangong,dianhua,dizhi,bumen,zhiwu,chusheng:string; xingbie:string; max:integer;begin if (edit1.Text<>'') and (edit2.Text<>'')and (edit3.Text<>'') and (edit4.Text<>'') and (radiobutton1.Checked xor
55、radiobutton2.Checked) and(combobox1.Text<>'') then begin yuangong:=edit1.Text; bianhao:=edit6.Text; dianhua:=edit2.Text; dizhi:=edit3.Text; bumen:=combobox1.Text; zhiwu:=edit4.Text; chusheng:= datetostr(datetimepicker1.date); if radiobutton1.Checked=true then xingbie:='男' else xingbie:='女' adotable1.InsertRecord(bianhao,yuangong,xingbie,dianhua,'NULL',dizhi,chusheng,bume
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 山东省威海市文登区2024-2025学年高三上学期第一次模拟物理试题(解析版)
- 江苏省扬州市邗江区2024-2025学年高二上学期期中考试物理试题(解析版)
- 江苏省2025年第一次普通高中学业水平合格性考试仿真模拟物理试卷01(解析版)
- 外研版高中英语选择性必修第四册UNIT3 Period1课件
- 2025年铸钢件项目可行性研究报告
- 2025年高档工具车行业深度研究分析报告
- 电力系统智能化在应急管理中的实践
- 新版人教PEP版三年级下册英语课件 Unit 6 Part C 第5课时
- 现代服务业中的大数据应用与实践
- 电子支付在电子商务平台中的运营策略
- 墨点美术:芥子园画谱
- 火龙罐技术课件
- 奥迪TT汽车说明书
- 撤销因私出国(境)登记备案国家工作人员通知书
- (21)-9.1《艺术学概论》第九章第一节 艺术批评的含义与性质、原
- 北师大版五年级数学上册《分数的再认识》评课稿
- 楼梯台阶抹灰施工技术交底
- 给教师的一百条建议-读书分享会
- 小学数学教学评一致性研讨活动
- EIM Book 1 Unit 7 Learning languages单元检测试题
- WTC瓦斯突出参数仪操作规程
评论
0/150
提交评论