已阅读5页,还剩25页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
商品销售管理系统一 系统需求分析与系统设计本系统从代理商的角度出发而设计开发的,本系统主要有个模块,分别为:adminForm(系统管理员模块),enStroageForm(库存管理模块),venditionForm(销 售管理模块),registrationForm(注册模块),mainForm(主模块)。有主要有三类用户:总的系统管理员(即代理商),销售人员,库存管理人员;要使用该系统 的销售人员或者库存管理人员必须先注册,然后必须由代理商分配相应的权限(admin(管理员权限),enstroage(库存管理权限),vendition(销售权限)),各用户得 到由代理商分配的权限后就能根据自己拥有的权限进入各自的功能模块,即:1: 管理员(代理商)有admin权限能进入adminForm模块,其主要职责是权限分配;删除用户,退出系统。相应的代码见下面:销售人员 有vendition权限能进入venditionForm模块,其主要权限是能够查看库存;添加客户资料;发货;订单详情查看;个人信息修改;月底统计;删除已处理的客户;退出系统;该模块主要模拟了这样一个流程:A:客户发来买货需求,然后销售人员根据用户的需求先查看库存,看是否有客户需要的数量,如果有库存就把用户的详细需求添加进数据库,添加的数据主要包括客户的地址,手机号码,产品编号,订货日期,发货日期,是否预订等信息;如果没有库存,且该客户是预订产品的话,也要添加客户的详细信息;B:添加完客户信息后,就进入发货模块,发货的结果是得到打印的发货详情,保管好订单,然后把该订单详情通知发货的人员,由发货人员负责拿货出库C:到月底时候进行一个月的工作统计,把已经处理了的订单详情打印出来,进行统计,然后删除已经处理的订单的相应的客户信息D:如果有必要的话,销售人员还可以更改自己的信息,然后通知管理员为其分配权限,呵呵,有点麻烦。E:退出系统。 3:库存管理人员有enstorage权限能进入enStorageForm模块,该模块主要有以下功能:产品入库;库存查询(了解库存,以便及时进货更新库存),个人信息修改(修改后需要通知管理员为其分配权限);退出系统;二数据库设计 产品表: 列名数据类型长度产品编号varchar20品牌varchar20库存量varchar20产品单价varchar20 客户:列名数据类型长度客户编号Varchar20客户姓名Varchar20客户地址Varchar50手机号码Varchar20是否预订Varchar10(允许为空) 用户:列名数据类型长度用户名Varchar20密码Varchar20权限Varchar20(允许为空) 订单:列名数据类型长度订单编号Varchar20产品编号Varchar20订货日期Varchar20发货日期Varchar20客户姓名Varchar20处理与否Varchar10(允许为空)品牌Varchar20订货量Varchar20单价Varchar10总额Varchar20三:各个模块完全代码如下: 1:mainForm模块代码: unit mainform;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, Buttons, ExtCtrls, StdCtrls, Grids, DBGrids, jpeg;type TForm1 = class(TForm) ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; DataSource1: TDataSource; Image1: TImage; Panel1: TPanel; GroupBox1: TGroupBox; Label1: TLabel; Edit1: TEdit; Label2: TLabel; Edit2: TEdit; Panel2: TPanel; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); private Private declarations public Public declarations end;var Form1: TForm1;implementationuses classDefinitionForm,adminForm,venditionForm,enStorageForm,registrationForm;$R *.dfmprocedure TForm1.SpeedButton1Click(Sender: TObject);var i:Integer;var popedom:string;begin with ADOQuery1 do begin close; SQL.Clear; SQL.Add(select * from 用户 where 用户名=+Edit1.Text+ and 密码=+Edit2.Text+); ADOQuery1.Open; if DataSource1.DataSet.RecordCount0 then begin /DataSource1.DataSet.FindFirst; popedom:=ADOQuery1.FieldByName(权限).AsString; /popedom:=DataSource1.DataSet.FieldByName(权限).AsString; end; showmessage(popedom); i:=recordcount; end; if i0 then begin if popedom =admin then /如果是管理员权限,则显示管理员界面 begin ADOQuery1.Close; Form1.Hide; form5.Show; end; if popedom =enstorage then /如果是库存管理员权限,则显示库存管理界面 begin ADOQuery1.Close; Form1.Hide; Form2.Show; end; if popedom =vendition then /如果是销售员权限,则显示销售管理界面 begin ADOQuery1.Close; Form1.Hide; Form3.Show; end; end /与第一个if想对应 else begin ADOQuery1.Close; showmessage(用户名或者密码有错误); end;end;procedure TForm1.SpeedButton2Click(Sender: TObject);begin Form6.Show; Form6.Edit1.Text:=; Form6.Edit2.Text:=; Form6.Edit3.Text:=;end;end.2:registrationForm模块代码:unit registrationForm;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB, jpeg;type TForm6 = class(TForm) GroupBox1: TGroupBox; Image1: TImage; Label1: TLabel; Edit1: TEdit; Label2: TLabel; Edit2: TEdit; Label3: TLabel; Edit3: TEdit; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; DataSource1: TDataSource; Panel1: TPanel; Panel2: TPanel; procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); private Private declarations public Public declarations end;var Form6: TForm6;implementation uses mainform;$R *.dfmprocedure TForm6.SpeedButton1Click(Sender: TObject);var i:Integer;begin if Edit1.Text then /用户名不为空,则 begin if Edit2.Text =Edit3.Text then /前后两次密码相等,则 begin with ADOQuery1 do begin ADOQuery1.Close; with SQL do begin SQL.Clear; SQL.Add(select * from 用户 where 用户名=+Edit1.Text+ ); ADOQuery1.Open; i:=recordcount; if i0 then /检查输入的用户名是否已经存在,则 begin ADOQuery1.Close; showmessage(该用户名已经存在,请重新输入); end else /输入的用户名还没有注册,则 begin ADOQuery1.Close; SQL.Clear; SQL.Add(insert into 用户(用户名,密码) values(+Edit1.Text+,+Edit2.Text+); ADOQuery1.ExecSQL; ADOQuery1.Close; showmessage(操作成功,新增用户名为:+Edit1.Text+,密码为:+Edit2.Text+ ); Form6.Hide; end; end; end; end else /前后两次密码不正确,则 begin ADOQuery1.Close; showmessage(前后两次密码输入不正确,请重新输入密码!); end; end else /用户名为空,则 begin ADOQuery1.Close; showmessage(用户名为空,请重新输入!); end;end;procedure TForm6.SpeedButton2Click(Sender: TObject);begin Form6.Edit1.Text:=; /重置为空 Form6.Edit2.Text:=; Form6.Edit3.Text:=;end;end.3:adminForm代码:unit adminForm;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, ADODB, Buttons, ExtCtrls, StdCtrls, jpeg;type TForm5 = class(TForm) ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; DataSource1: TDataSource; Panel1: TPanel; SpeedButton1: TSpeedButton; Panel3: TPanel; DBGrid1: TDBGrid; Panel4: TPanel; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; Panel5: TPanel; SpeedButton4: TSpeedButton; SpeedButton5: TSpeedButton; Label1: TLabel; Edit1: TEdit; Label2: TLabel; ComboBox1: TComboBox; Panel6: TPanel; Label3: TLabel; Edit2: TEdit; SpeedButton6: TSpeedButton; Image1: TImage; procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton5Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); private Private declarations public Public declarations end;var Form5: TForm5;implementation uses mainform;$R *.dfmprocedure TForm5.SpeedButton3Click(Sender: TObject);beginApplication.Terminate;end;procedure TForm5.SpeedButton1Click(Sender: TObject);begin Panel5.Visible:=True; /分配权限面板显现 Panel6.Visible:=false; /删除用户面板隐藏 Panel3.Visible:=True; /整个大的面板显现end;procedure TForm5.SpeedButton4Click(Sender: TObject); var i:Integer;begin with ADOQuery1 do begin ADOQuery1.Close; With SQL do begin /检查输入用户名是否正确 SQL.Clear; SQL.Add(select 用户名 from 用户 where 用户名=+Edit1.Text+ ); ADOQuery1.Open; i:=recordcount; if i0 then /用户名存在,则 begin ADOQuery1.Close; SQL.Clear; SQL.Add(delete from 用户 where 用户名=+Edit2.Text+ ); ADOQuery1.ExecSQL; DBGrid1.DataSource.DataSet.Refresh; /刷新DBGrid1中的显示数据 ADOQuery1.Close; showmessage(用户:+Edit2.Text+被成功删除!); end else /用户名不存在,则 begin ADOQuery1.Close; showmessage(+Edit2.Text+用户不存在,请重新填写!); end; end;end;end.4:venditionForm代码:unit venditionForm;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Buttons, Grids, DBGrids, DB, ADODB, Mask, QuickRpt, QRCtrls, jpeg;type TForm3 = class(TForm) Image1: TImage; Panel1: TPanel; MainPanel: TPanel; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; Panel3: TPanel; SpeedButton6: TSpeedButton; SpeedButton7: TSpeedButton; SpeedButton8: TSpeedButton; SpeedButton10: TSpeedButton; Panel4: TPanel; ADOConnection1: TADOConnection; ADOTable1: TADOTable; ADOQuery1: TADOQuery; DataSource1: TDataSource; AddClientPanel: TPanel; Label3: TLabel; Edit3: TEdit; Label4: TLabel; Edit4: TEdit; Label5: TLabel; Edit5: TEdit; Label6: TLabel; Edit6: TEdit; SpeedButton13: TSpeedButton; SpeedButton14: TSpeedButton; RadioButton1: TRadioButton; StoragePanel: TPanel; Label1: TLabel; Edit1: TEdit; Label2: TLabel; Edit2: TEdit; SpeedButton11: TSpeedButton; SpeedButton12: TSpeedButton; Label7: TLabel; Edit7: TEdit; Label8: TLabel; Edit8: TEdit; Label9: TLabel; Edit9: TEdit; Label10: TLabel; Edit10: TEdit; RadioButton2: TRadioButton; Panel2: TPanel; Label11: TLabel; Label12: TLabel; Edit12: TEdit; Label13: TLabel; Edit13: TEdit; ComboBox1: TComboBox; ConsignmentPanel: TPanel; Label14: TLabel; SpeedButton15: TSpeedButton; SpeedButton16: TSpeedButton; Edit11: TEdit; Label15: TLabel; Label16: TLabel; Edit15: TEdit; SpeedButton17: TSpeedButton; ComboBox2: TComboBox; ModifyPanel: TPanel; Label17: TLabel; Edit14: TEdit; Label18: TLabel; Edit16: TEdit; Label19: TLabel; Edit17: TEdit; Label20: TLabel; Edit18: TEdit; SpeedButton5: TSpeedButton; SpeedButton9: TSpeedButton; SpeedButton18: TSpeedButton; QuickRep1: TQuickRep; QRBand1: TQRBand; QRLabel1: TQRLabel; QRBand2: TQRBand; QRLabel2: TQRLabel; QRLabel3: TQRLabel; QRLabel4: TQRLabel; QRLabel5: TQRLabel; QRLabel6: TQRLabel; QRLabel7: TQRLabel; QRLabel8: TQRLabel; QRLabel9: TQRLabel; QRLabel10: TQRLabel; QRBand3: TQRBand; QRDBText1: TQRDBText; QRDBText2: TQRDBText; QRDBText3: TQRDBText; QRDBText4: TQRDBText; QRDBText5: TQRDBText; QRDBText6: TQRDBText; QRDBText7: TQRDBText; QRDBText8: TQRDBText; QRDBText9: TQRDBText; ADOConnection2: TADOConnection; ADOTable2: TADOTable; ADOQuery2: TADOQuery; QRBand4: TQRBand; QRSysData1: TQRSysData; procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton12Click(Sender: TObject); procedure SpeedButton11Click(Sender: TObject); procedure SpeedButton10Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton13Click(Sender: TObject); procedure SpeedButton14Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton5Click(Sender: TObject); procedure SpeedButton18Click(Sender: TObject); procedure SpeedButton17Click(Sender: TObject); procedure SpeedButton16Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); procedure SpeedButton15Click(Sender: TObject); procedure SpeedButton8Click(Sender: TObject); procedure SpeedButton7Click(Sender: TObject); private Private declarations public Public declarations end;var Form3: TForm3;var p:Integer; implementation$R *.dfmprocedure TForm3.SpeedButton1Click(Sender: TObject);begin AddClientPanel.Visible:=false; ConsignmentPanel.Visible:=false; ConsignmentPanel.Visible:=false; ModifyPanel.Visible:=false; StoragePanel.Visible:=True; /库存查看面板显现end;procedure TForm3.SpeedButton12Click(Sender: TObject);begin Edit1.Text:=; /文本框清空 Edit2.Text:=; StoragePanel.Visible:=false; /库存查看面板隐藏end;procedure TForm3.SpeedButton11Click(Sender: TObject);var i:Integer;var storage:string;begin /输入产品编号后,则查看是否有该产品 ADOConnection1.Connected:=True; ADOTable1.Active:=True; with ADOQuery1 do begin ADOQuery1.Close; with SQL do begin SQL.Clear; SQL.Add(select * from 产品 where 产品编号=+Edit1.Text+ ); ADOQuery1.Open; i:=recordcount; if i0 then /有,则 begin storage:=ADOQuery1.FieldByName(库存量).AsString; /获得库存量 ADOQuery1.Close; Edit2.Text:=storage; end else begin ADOQuery1.Close; /没有,则 showmessage(编号为:+Edit1.Text+的产品不存在! ); end; end; end;end;procedure TForm3.SpeedButton10Click(Sender: TObject);begin ADOConnection1.Connected:=false; /断开与数据库的连接,并退出系统 ADOTable1.Active:=false; Application.Terminate;end;procedure TForm3.SpeedButton2Click(Sender: TObject);begin ConsignmentPanel.Visible:=false; ConsignmentPanel.Visible:=false; ModifyPanel.Visible:=false; StoragePanel.Visible:=false; /库存查看面板显现 AddClientPanel.Visible:=True; /end;procedure TForm3.SpeedButton13Click(Sender: TObject);var checked:Boolean;var i:string;var j:string;var k:Integer;var l:Integer;var m:Integer;begin ADOConnection1.Connected:=false; /断开与数据库的连接 ADOTable1.Active:=false; / ADOTable1.TableName:=客户; /更换要查询的表名 ADOConnection1.Connected:=True; /重新与数据库建立连接 ADOTable1.Active:=True; with ADOQuery1 do begin ADOQuery1.Close; with SQL do begin SQL.Clear; SQL.Add(select * from 订单 where 订单编号=+Edit7.Text+ ); ADOQuery1.Open; k:=recordcount; ADOQuery1.Close; if k0 then begin showmessage(该订单编号已存在,请重新输入!); end else begin with ADOQuery1 do /将输入的客户信息插入数据库 begin ADOQuery1.Close; with SQL do begin SQL.Clear; checked:=RadioButton1.Checked; /checked1:=RadioButton2.Checked; if checked =false then begin i:=false; j:=true; end else begin i:=true; j:=false; showmessage(i); / showmessage(j); / end; SQL.Add(insert into 客户 value
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《供配电系统》练习题集
- “茅台杯”第二届全国装甑(上甑)摘酒职业技能竞赛理论考试题库(含答案)
- 2022-2023学年黑龙江省哈尔滨重点中学七年级(下)期中英语试卷(含解析)
- 北京市某中学2023-2024学年高一年级上册期中检测数学试题
- 2024-2025学年广东省高三(上)开学数学试卷(含答案)
- 2024年坚果炒货项目资金申请报告代可行性研究报告
- 第1课《祖国啊我亲爱的祖国》教学设计+2023-2024学年统编版语文九年级下册
- 2023年超硬材料资金筹措计划书
- 2024年食品助剂项目资金申请报告代可行性研究报告
- 2023年高沸点溶剂资金筹措计划书
- 2024年企业数据存储与安全服务合同
- 2022年北京市公务员录用考试《行测》真题及答案解析
- 江苏省泰兴市2024-2025学年高三上学期期中考试语文试题(含答案)
- 家长会教学课件
- 律师事务所律师事务所风险管理手册
- 静脉曲张的护理查房课件
- 广东省邮政公司招聘2024年应届高校毕业生(152人)高频难、易错点500题模拟试题附带答案详解
- 四川省绵阳市高中2022级第一次诊断性考试数学试题(解析版)
- DB11∕T 353-2014 城市道路清扫保洁质量与作业要求
- 2024年代步车使用协议书模板
- 五年级上册数学试题试卷(8篇)
评论
0/150
提交评论