网上花店后台管理系统_第1页
网上花店后台管理系统_第2页
网上花店后台管理系统_第3页
网上花店后台管理系统_第4页
网上花店后台管理系统_第5页
已阅读5页,还剩84页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、网上花店后台管理系统设计报告 1 概述 现如今网上购物越來越趋于大众化,购物种类应有尽有,方便又不受地域 的限制,所以我们小组本次的课程设计决定做一个网上花店的管理系统,把在这 个系统里的管理员模块详细的展示出来。 本系统以网上花店日常工作为起点,把管理员模块通过对花店的管理表现出 来。管理员管理模块包括查询模块和更新模块。管理员可以对鲜花,供应商,货 物的出入记录进行更新,也可以查询供应商的信息,鲜花的信息,以及顾客的信 息。 本次课程设计用SQL 2008、eclipse等工具开发。 2. 设计内容 网上花店管理系统主要功能是用于查询、保存和编辑添加鲜花,供应商的资 料、工作人员信息和统计

2、资金、货物的信息,包括供应商、顾客、资金及鲜花等。 用于查询和编辑供应商的基本信息,包括供应商的厂商名、地址和电话等;用于 查询和编辑鲜花的基本信息,包括鲜花的名称、颜色、成本价、零售价、送花对 象、适用季节以及花的用途等;用于查询和编辑顾客的基本信息,包括顾客的姓 名、登陆账号、年龄、联系电话和性别等。 模式图表示如下: k上 总体设计依据的表格 表:supplier供应眉 序号 列名 数据类 型 长度 是否为 空 默认 值 说明 1 SUno char 10 Not null 供应商编号(主键) 2 SUname char 20 Not null 厂商名 3 SUaddre ss char

3、 20 Not null 地址 4 SUtel char 11 Not null 电话 表2: flower鲜花 序 号 列名 数据类型 长 度 是否为 空 默认值 说明 1 FLno Char 10 not null 鲜花编号(主键) 2 FLname char 10 not null 花名 3 FLcolor char 20 not null 颜色 4 FLcostprice numeric( 3, 2) not null 成本价 5 FLretailpri ce numeric( 3, 2) not null 零售价 6 FLobject Char 4 not null 对象 7 FLf

4、estival char 6 not null 适用节日 8 FLfunctions char 20 not null 用途 表 5: customer 顾客 序 号 列名 数据类型 长度 是否为 空 默认值 说明 1 CUno Char 6 not null 顾客编号 (主键) 2 CUname Char 8 not null 姓名 3 CUaccount Char 8 not null 登陆账号 4 CUage Tinyint 年龄 5 CUtel char 11 not null 联系电话 6 CUsex char 2 男或女 性别 表6: supply供应 序 号 列名 数据类型 长

5、度 是否为 空 默认值 说明 1 Dino Char 10 Not null 订单号 1 SUno char 10 not null 供应商编号(外键参 照表supplier的 SUno) 2 FLno char 10 not null 鲜花编号(外键参照 表 flower 的 FLno) 3 SUPtime Char 15 not null 供应时间 4 SUPquli ty double not null 供应量 表9: netorder网上订购 序 号 列名 数据类 型 长度 是否为 空 认 默值 说明 1 CUno Char 6 Not null 顾客编号(外键参照 表 custome

6、r 的 CUno) 2 FLno Char 10 Not null 鲜花编号(外键参照 表 flower 的 FLno) 3 NETsaleti me Char 15 Not null 订货时间 4 NETqulity int Not null 订货数量 5 NETaddres s char 50 Not null 送货地点 6 NETtaketi me Char 15 Not null 送货时间 7 NETremark char 50 Not null 备注 3. 具体设计 关系图: 各类,函数,成员 鲜花总框架 class FlowerManage 是否己登录flag 与数据库的链接成员C

7、onnection con Statement st PreparedStatement p ResuItSet re private static String DBUrl; 登录面板JPanel pdenglu=new JPanel (); 菜单栏 JMenuItemf dengluMenuItem 构造函数 所有面板 JMenuItem checkMenuItem JMenuItem gengxinMenuItem JMenuItem tuichuMenultem public FlowerManage() public void sevenoperation() 登录面板 this.

8、dengLuPanel (); 供应商查询面板 this. gongyingshangc. setOpaque(false); 顾客查询面板 鲜花查询面板 this. gukec. setOpaque(false); this. xianhuac. setOpaque(false); 订单查询面板 this. dingdanc. setOpaque(false); 货物更新面板 供应商更新面板 this. huowug. setOpaque(false); this, gongyingshangg. setOpaque(false); 鲜花更新面板 this. xianhuag. setOpa

9、que (false); 提醒登录面板 this. meidenglu. setOpaque(false); 设置背景 public void setBackO 登录面板具体设置public void dengLuPanel () 管理框架的菜单设置public void operationmenu() 事件监听 public void actio nPerformed(Ac tio nEve nt eve nt) 总框架的重新构建public void rebuildO 供应商查询的面板具体设置 供应商的更新面板设置 鲜花查询面板的具体设置 鲜花更新面板的具体设置public class G

10、ongyingshangc public class Gongyingshangg public class Xianhuac public class Xianhuag 货物更新面板的具体设置 顾客查询面板的具体设置 订单查询面板的具体设置 public class Huowug public class Gukec public class Dingdanc 4. 设计结果 旦I网上I = 回I 22 代码 import java. awt. Color; import java. awt. Font; import java. awt. Graphics; import java awt

11、. event. ActionEvent; import java. awt. event. ActionListener; import java. sql. Statement; import java. sql. Connection; import java. sql. DriverManager; import java. sql. PreparedStatement; import java. sql. ResuItSet; import java. sql. SQLException; import java, util. Random; import javax. swing.

12、 BorderFactory; import javax. swing. ImageIcon; import javax. swing. JButton; import javax. swing. JComboBox; import javax. swing. JFrame; import javax. swing. JLabel; import javax. swing. JMenu; import javax. swing. JMenuBar; import javax. swing. JMenuItem; import javax. swing. JPanel; import javax

13、. swing. JTable; import javax. swing. JTextField; import javax. swing, table. DefauItTableModel; 管理框架 SuppressWamings (serial) public class FlowerManage extends JFrame implements ActionListener private iirt flag=O; private Connection con=null; private Statement st=null; private PreparedStatement p=n

14、ull; private ResuItSet re=null; privatestaticStringDBDriverStr com. microsoft. sqlserver. jdbc. SQLServerDriver*; private static String DBUrl; 登录面板 private JPanel pdenglu=new JPanel(); private String s; private JLabel ldenglu=new JLabel (*管理员登录); private JLabel lyonghuming=new JLabel (*用户名); private

15、 JTextField tyonghuming=new JTextFieldO; private JLabel lmima=new JLabel (密码); private JTextField tmima=new JTextFieldO ; private JLabel 1 yanzhengma=new JLabel (验证码); private JTextField tyanzhengma=new JTextFieldO; private JLabel tjianyanshu=new JLabel0: private JButton bchange=new JButton (*看不清,换一

16、张); private JLabel tixingjian=new JLabel(); private JButton bdenglu=new JButton(*登录); private JButton btuichu=new JButton (*退出); private Gongyingshangc gongyingshangc=new GongyingshangcO; private Xianhuac xianhuac=new Xianhuac(); private Gukec gukec=new Gukec(); private Dingdanc dingdanc=new Dingdan

17、c(); private Gongyingshangg gongyingshangg=new Gongyingshangg 0; private Xianhuag xianhuag=new XianhuagO; private Huowug huowug=new Huowug(); private Tongzhi meidenglu=new Tongzhi (请先登录); JMenuBar mymenu=new JMenuBar (); JMenu menu= new JMenu (*登陆“), new JMenu (*査询), new JMenu (* 更新), new JMenu (*退出

18、) ; JMenuItem dengluMenuIteitf= new JMenuItemC*登陆管理界面), ; JMenuItem checkMenuItem= new JMenuItem (供应商信息査询), new JMenuItem(*顾客信息査询), new JMenuItem(*订单信息査询”), new JMenuItem(*鲜花信息査询) ; JMenu It em gengx inMenu It em= new JMenuItem (供应商信息更新), new JMenuItem(*鲜花信息更新”), new JMenuItem(*货物信息更新) JMenuItem tui

19、chuMenuItemF new JMenuItem(*退出管理界面) ; public FlowerManage () this. setSize(500, 500); this. setTitleC网上鲜花后台管理); this. setBack0; this. operationmenu (); this. setJMenuBar (mymenu); this. getContentPane() setLayout (null); sevenoperationO ; 所有面板 public void sevenoperation 0 登录面板 this. dengLuPanel ();

20、this. pdenglu. setOpaque(false); pdenglu. setBounds (25, 25, 400, 400); this. getContentPane 0. add(pdenglu); this. pdenglu. setLayout(null); this. pdenglu. setVisible(false); 供应商査询面板 this, gongyingshangc. set Opaque (false); gongyingshangc. setBounds(25, 25, 400, 400); this. getContentPane(). add(g

21、ongyingshangc); this. gongyingshangc. setLayout(null); this. gongyingshangc. setVisible(false); /顾客査询面板 this, gukec. setOpaque(false); gukec. setBounds (25, 25, 400, 400); this. getContentPane (). add(gukec); this, gukec. setLayout(null); this, gukec. setVisible(false); 鲜花査询面板 this, xianhuac. setOpa

22、que(false); xianhuac. setBounds(25, 25, 400, 400); this. getContentPane(). add(xianhuac); this. xianhuac. setLayout(null); this, xianhuac. setVisible(false); /订单査询面板 t his. dingdanc. set Opaque (false); dingdanc. setBounds(25, 25, 400, 400); this. getContentPane 0. add(dingdanc); this. dingdanc. set

23、Layout(null); this. dingdanc. setVisible(false); 货物更新面板 this. huowug. setOpaque(false); huowug. setBounds(25, 25, 400, 400); this. getContentPane 0. add(huowug); this. huowug. setLayout(null); this. huowug. setVisible(false); 供应商更新面板 t his. gongyingshansg* set Opaque (false); gongyingshangs. setBoun

24、ds(25, 25, 400, 400); this. getContentPane 0. add(gongyingshangg); this. gongyingshangg. setLayout (null); this. gongyingshangg. setVisible(false); /鮮花更新面板 t his. xiemhuag. set Opaque (false); xianhuag. setBounds(25, 25, 400, 400); this. getContentPaneO. add (xianhuag); this. xianhuag. setLayout(nul

25、l); this, xianhuag. setVisible(false); /提醒登录面板 this. meidenglu. setOpaque(false); meidenglu. setBounds(100, 100, 200, 200); this. getContentPane(). add(meidenglu); this. meidenglu. setLayout(null); this. meidenglu. setVisible(false); 设置背景 public void setBack() (JPanel)this. getContentPane0). setOpaq

26、ue(false); ImageIcon img = new Imagelcon(*F:/workspace for book/BB/src/l. jpg*); JLabel background = new JLabel(img); this, getLayeredPane() add(background, new Integer(Integer. MIN_VALUE); background, set Bounds (0, 0, im. getl conW idt h(), img. getlconHeigh 10); 登录面板具体设置 public void dengLuPanel0

27、this. pdenglu. add(ldenglu); ldenglu. setBounds(150, 25, 200, 50); ldenglu. setFont (new Font (隶书,Font. BOLD, 22); this. pdenglu. add (lyonghuming); lyonghuming. setBounds(50, 100, 50, 30); this. pdenglu. add(tyonghuming); tyonghuming. setBounds(150, 100, 200, 30); this. pdenglu. add(lmima); lmima.

28、setBounds(50, 150, 50, 30); this. pdenglu. add(tmima); tmima. setBounds(150, 150, 200, 30); this. pdenglu. add(lyanzhengma); lyanzhengma. setBounds(50, 200, 50, 30); this. pdenglu. add(tyanzhensma); tyanzhengma. setBounds(150, 200, 60, 30); this. pdenglu. add(tjianyanshu); tjianyanshu. setBounds(220

29、, 200, 40, 30); this, pdenglu. add(bchange); bchange. setBounds(270, 200, 130, 30); bchange. setBackground(Color. PINK); this. bchange. addActionListencr(this); this, pdenglu. add(tixingjian); tixingjian. setBounds(110, 250, 200, 30); this, pdenglu. add(bdenglu); bdenglu. setBounds(100, 300, 100, 30

30、); this. bdenglu. addActionListener(this); this. pdenglu. add(btuichu); btuichu. setBounds(250, 300,100, 30); this. btuichu. addActionListener(this); this. tjianyanshu. setOpaque(true); this, tjianyanshu. setBorder(BorderFactory. createLineBorder(Color, pink); this. tjianyanshu. setBackground(Color,

31、 pink); this, tjianyanshu. setText(47258); /管理框架的菜单设置 public void operationmenu 0 for(int i=0;KdensluMenuItem. length; i+) menu0. add (dengluMenu; dengluMenuItemi. addActionListenerCthis); forGnt i=O;icheckMenuItem, length;i+) menul. add (checkMenuItemi); checkMenuItemi. addActionListener(this); for

32、 (int i=0; Kgengx inMenu Item, leng th; i+) menu 2. add (gengx inMenu It emi); sengx inMenu It emi. addActionLis tener( this); for(int i=0;ituichuMenuItem. length;i+) menu3. add(tuichuMenuItemi); tuichuMenuItemi. addActionListener(this); for(int i=0;imenu. length;i+) mymenu. add(menui); 事件监听 public

33、void actionPerformed(ActionEvent event) s=event. getActionCommand 0; Random r=new Random 0; int a; String ”; if(flag=l) this. xianhuac. setVisible(false); this. dingdanc. setVisible(false); this. gukec. setVisible(false); this. gongyingshang. setVisible(false); this. xianhuag. setVisible(false); thi

34、s. huowug. setVisible(false); this. gongyingshansg. setVisible(false); tyonghuming. set Tex t (); tmima. setText (); ty anzhengma. set Text (); for(int i=0;i=4;i+) a=r. nextint(9); str=String. valueOf(a)+str; this. tjianyanshu. setText(str); if(s. equals C登陆管理界面)=true) this. meidenglu. setVisible (f

35、alse); this. pdenglu. setVisibleCtrue); if (s. equals (看不清,换一张)=true) this. tyanzhengma. setText (; for(int i=0;i=4;i+) a=r. nextlnt(9); str=String. valueOf(a)+str; this. tjianyanshu. setText(str); else if (s. equals (登录)=true) if (ty anzhengma. get Tex 10. equals (t jianyanshu. get Tex t () ) =fals

36、e) this, tixingjian. setText (*验证码不正确,请重新输入! ”); this, tyanzhengma setText; for(int i=0;i=4;i+) a=r. nextint(9); str=String. valueOf(a)+str; this. tjianyanshu. setText(str); else DBUrl=*jdbc:sqlserver:/localhost:1433;*+ databaseName二huadian;user=*+tyonghuming. getTex10 +;password二+tmima. getText ( )

37、+; try Class. forNeune (DBDriverStr); con=DriverManager. getConnection(DBUrl); catch(ClassNotFoundException e) System, err. println(ClassNotFoundException: +e getMessage(); catch(SQLExcept ion e) JFrame tishi=new JFrame (*提示); tishi. setSize(400, 100); JLabel tishil=new JLabel(*您的用户名或密码不正确,请重新输 入J;

38、tishi. getContentPane() add(tishil); tishi. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE); tishi. setVisible(true); Systern. out. println(*SQLException: +e. getMessage(); rebuildO ; this. pdenglu. setVisible(false); flag=l; else if (s. equals (供应商信息查询)=true) this. xianhuac. setVisible(false); this

39、. dindanc. setVisible(false); this. gukec. setVisible(false); this. gongyingshangg. setVisible(false); this. xianhuas- setVisible(false); this. huowug. setVisible(false); if(flag=0) this. meidenglu. setVisible (true); else pdenglu. setVisible(false); this, gonyingshangc. setVisible(true); else if (s

40、. equals (*退出管理界面)=true) this. dispose 0; else if (s. equals (*顾客信息査询*) =true) this. xianhuac. setVisible(false); this. dingdanc. setVisible(false); this. gongyingshangc. setVisible(false); this. gongyingshangg. setVisible(false); this. xianhuag. setVisible(false); this. huowug. setVisible(false); i

41、f(flag=O) t his. meidenglu. set Visible (true); else pdenglu. setVisible(false); this. gukec. setVisible(true); else if (s. equals (鲜花信息査询)=true) this. gongyingshangc. setVisible (false); this. dingdanc. setVisible(false); this. gukec. setVisible(false); this. gongyingshemgg. setVisible(false); this

42、. xianhuag. setVisible(false); this. huowug. setVisible(false); if(flag=0) pdenglu. setVisible(false); this. meidenglu. setVisible(true); else this, xianhuac. setVisible (true); else if (s. equals 订单信息査询*) =true) this. xianhuac. setVisible(false); this. gongyingshangc. setVisible(false); this. gukec

43、. setVisible(false); this. gongyingshangg. setVisible(false); this. xianhuag. setVisible(false); else pdenglu. setVisible(false); this. dingdanc. setVisible(true); else if (s. equals (供应商信息更新*) =true) this. xianhuac. setVisible(false); this. dingdanc. setVisible(false); this. gongyingshangc. setVisi

44、ble(false); this. gukec. setVisible(false); this. xianhuag. setVisible(false); this. huowug. setVisible(false); if(flag=0) this, meidenglu. setVisible(true); else pdenglu. setVisible (false); this. gonsyingshansg. setVisible(true); else if (s. equals (*鲜花信息更新)=true) this. xianhuac. setVisible(false)

45、; this. dingdanc. setVisible(false); this. gukec. setVisible(false); this. gongyingshangg. setVisible(false); this. gongyingshangc. setVisible(false); this. huowug. setVisible(false); if(flag=O) t his. meidenglu. set Visible (true); else pdenglu. setVisible(false); this. xianhuag. setVisible(true);

46、else if (s. equals C货物信息更新*) =true) this. xianhuac. setVisible(false); this. dingdanc. setVisible(false); this. gukec. setVisible(false); this. gongyingshemgg. setVisible(false); this. xianhuag. setVisible(false); this. gongyingshangc. setVisible(false); if(flag=0) this, meidenglu. setVisible(true);

47、 else pdenglu. setVisible (false); this, huowug. setVisible(true); public void rebuild0 this dispose(); FlowerManage flowerManagel=new FlowerManage 0; flowerManagel. setDefaultCloseOperat ion(JFrame. EXIT_ON_CLOSE); flowerManage1 setVisible(true); public static void main(String args) / TODO Auto-gen

48、erated method stub FlowerManage flowerManage=new FlowerManage 0; flowerManage. setDcfaultCloseOperation(JFrame. EXIT_ON_CLOSE); flowerManage. setVisible(true); 供应商査询的面板具体设置 SuppressWamings (serial) public class Gongyingshangc extends JPanel imp1ements ActionListener private String si; private Strins

49、 no; private String address; private String changming; private String tel; private JLabel gc=new JLabelC*供应商信息査询); private JButton t jcx=new JButton (*条件査询); private JButton qbcx=new JButton (*全部査询); private JPanel t j=neir JPanel 0 ; private JLabel lgbl=new JLabel (供应商编号); private JTextField tgb=ne

50、w JTextFieldO; private JButton cx=new JButton (*査询); private JLabel gx=new JLabel (供应商基本详情); private JButton gybc=new JButton (供应査询); private JLabel gb2=new JLabel (供应商编号; private JLabel gb3=new JLabel(); private JLabel cml=new JLabel (供应商名称”); private JLabel cm2=new JLabel(); private JLabel dzl=new

51、 JLabel (地址); private JLabel dz2=new JLabel(); private JLabel lxdhl=new JLabel (*联系电话); private JComboBox year=new JComboBox 0; private JComboBox month=new JComboBox(); private JComboBox day=new JComboBox 0; private JLabel lxdh2=new JLabel (); private JLabel gyb=new JLabel (供应商供应表); private DefaultT

52、ableModel modl=new DefaultTableModel(9,4); private JTable gbl=new JTable(modi); private JPanel qb=new JPanel0; private JLabel gyjb=new JLabel (全部供应商基本表); private JButton qbcg=new JButton (*全部供应査询”); private DefaultTableModel mod2=new DefaultTableModel(7, 4); private JTable gybl=new JTable(mod2): pri

53、vate JLabel gygh=new JLabel (全部供应商供货单); private DefaultTableModel mod3=new DefaultTableModel(7, 5); private JTable gyb2=new JTable(mod3); private JComboBox yearl=new JComboBox(); private JComboBox monthl=new JComboBox 0; private JComboBox dayl=new JComboBox0; public void panel1() this. tj. add(lgbl)

54、; lgbl. setBounds(10, 0, 80, 20); this. tj. add (tgb); tgb. setBounds (95, 0,120, 20); t his. tj. add (ex); ex. setBounds (250, 0, 80, 20); ex. addActionListener(this); this tj. add(gx); gx. setBounds(10, 25, 300, 30); gx. setFont (new Font (隶书,Font. BOLD, 22); this, t j. add (gb2); gb2. setBounds (

55、10, 5 this. tj. add (gb3); gb3. setBounds (110, 5 this. tj. add (cml); cml. setBounds (210, 5 this. tj. add (cm2); cm2. setBounds(310, 58, 90, 20); this. tj. add (dzl); dzl. setBounds (10, 80, 90, 20); this, t j. add (dz2); dz2. setBounds (110, 80, 90, 20); this. tj. addClxdhl); lxdhl. setBounds(210

56、, 80, 90, 20); this. tj. add(lxdh2); lxdh2. setBounds(310, 80, 90, 20); this. t j. add (year); year. setBounds(220,105, 80, 20); year, additem (2012 年); year, additem (*2013 年); year, additem (2014 年); this. t j. add (month); month. setBounds (300,105, 50, 20); forCint i=l;i=12;i+) month, additem(St

57、ring. valueOf(i)+月 *); this. t j. add (day); day. setBounds (350,105, 50, 20); for (int i=l; i=30; i+) day. additem(String. valueOf(i)+日); this. tj. add(gyb); gyb. setBounds(150,130,100, 25); this, t j. add (gybe); gybe. setBounds(300,130,100, 25); gybe. addActionListener(this); this. tj. add(gbl);

58、gbl. setBounds (10,160, 380,190); modi. setValueAt (鲜花编号,0, 0 ); modi. setValueAt (鲜花名,0, 1 ); modi. setValueAt (数量,0, 2 ); modi. setValueAt (金额,0, 3 ); gbl. setOpaque(false); this. tj. setOpaque(false); this. tj. setVisible(false); this. tj. setLayout(null); this. tj. setBounds (0, 50, 400, 350); p

59、ublic void panel2() this. qb. add(gyjb); gyjb. setBounds(10, 0, 200, 28); gyjb. setFont (new Font (隶书,Font. BOLD, 22); mod2. setValueAt (供应商编号,0, 0 ); mod2. setValueAt (供应商名,0,1 ); mod2. setValueAt (地址,0, 2 ); mod2. setValueAt (联系电话,0, 3 ); this. qb. add(gybl); gybl. setBounds(10, 30, 380,115); gybl

60、. setOpaque(false); this. qb. add(gygh); gygh. setBounds(10,150,190, 30); sygh. setFont (new Font (隶书, Font. BOLD, 22); this. qb. add (yearl); yearl. setBounds (220,180, 80, 25); yearl. additem(2012 年); yearl. addItem(*2013 年); yearl. additem (*2014 年); t his. qb. add (mo nt hl); monthl. setBounds(3

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论