当前位置:首页>> >>


韩运畅_订餐管理系_源代码.rar

收藏

资源目录
    文档预览:
    编号:20181030003615219    类型:共享资源    大小:214.53KB    格式:RAR    上传时间:2018-10-30
    尺寸:148x200像素    分辨率:72dpi   颜色:RGB    工具:   
    35
    金币
    关 键 词:
    韩运畅 管理 源代码
    资源描述:
    课 程 设 计 报 告 书(理工类)课程名称 Java 基础实训_______姓 名 韩运畅 _______ 班 级 17 软嵌 1 班 ______ 学 号 1712011001 指导教师 濮宏伟____________ 金陵科技学院2018.71题目:在线订餐系统设计的目的和要求:该系统主要分为店家和顾客两类用户。顾客具备注册、登录功能,具备基本的餐馆选择、菜品展示功能以及下达订单、修改订单、退单功能;店家具备发布菜品信息、管理顾客订单以及配送订单等功能。设计的软件环境:奔腾以上计算机,Windows7 操作系统,装有 JDK1.8 和 Eclipse 软件功能模块设计:用户模块:用户注册,用户登录,查询商品,购买商品,查询订单,撤销订单,修改订单管理员模块:管理员登录,发布商品,查询商品,删除商品,修改商品,查询订单,删除订单,修改订单,发货设计过程和内容:MainFrame.java(主界面)package JieMian;import java.awt.BorderLayout;import java.awt.EventQueue;import javax.swing.JFrame;24import javax.swing.JPanel;import javax.swing.border.EmptyBorder;import Data.PageData;import Model.Page;import Util.GoodsUtils;import Util.PageUtils;import Util.UserUtils;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JTextField;import javax.swing.JButton;import java.awt.event.ActionListener;import java.awt.event.ActionEvent;public class AddPage3 extends JFrame {private JPanel contentPane;private JTextField textNewName;private JTextField textNewUserName;/*** Launch the application.*/public static void main(String[] args) {EventQueue.invokeLater(new Runnable() {public void run() {try {AddPage3 frame = new AddPage3();frame.setVisible(true);} catch (Exception e) {e.printStackTrace();}}});}/*** Create the frame.*/public AddPage3() {setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 222, 201);contentPane = new JPanel();25contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setContentPane(contentPane);contentPane.setLayout(null);JLabel lblNewLabel = new JLabel(“\u65B0\u5546\u54C1\u540D\uFF1A“);lblNewLabel.setBounds(10, 40, 79, 15);contentPane.add(lblNewLabel);textNewName = new JTextField();textNewName.setBounds(99, 37, 86, 21);contentPane.add(textNewName);textNewName.setColumns(10);JLabel lblNewLabel_1 = new JLabel(“\u65B0\u4E70\u5BB6\uFF1A“);lblNewLabel_1.setBounds(10, 82, 79, 15);contentPane.add(lblNewLabel_1);textNewUserName = new JTextField();textNewUserName.setBounds(99, 79, 86, 21);contentPane.add(textNewUserName);textNewUserName.setColumns(10);JButton button = new JButton(“\u786E\u8BA4“);button.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {String name=textNewUserName.getText();String goodsName=textNewName.getText();if(““.equals(name)||““.equals(goodsName)){JOptionPane.showMessageDialog(AddPage3.this, “内容不能为空“, “失败“,JOptionPane.ERROR_MESSAGE);}else if(!GoodsUtils.searchGoods(goodsName)){JOptionPane.showMessageDialog(AddPage3.this, “没有该商品“, “失败“,JOptionPane.ERROR_MESSAGE);}else if(!UserUtils.searchUser(name)){JOptionPane.showMessageDialog(AddPage3.this, “没有该用户“, “失败“,JOptionPane.ERROR_MESSAGE);}else{PageData.now_page.setGoodsName(name);PageData.now_page.setIsGoing(“否“);PageData.now_page.setName(goodsName);AdminMainFrame main=new AdminMainFrame();26main.setVisible(true);main.showPages();AddPage3.this.setVisible(false);}}});button.setBounds(50, 129, 93, 23);contentPane.add(button);}}管理员主界面:button.addActionListener( new ActionListener() {public void actionPerformed(ActionEvent e) {showGoods();}});btnNewButton.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {showPages();}});button_1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {int row=tableGoods.getSelectedRow();if(row==-1){JOptionPane.showMessageDialog(AdminMainFrame.this,“请选定所删内容“ ,“提醒“,JOptionPane.INFORMATION_MESSAGE);}else{String name=tableGoods.getValueAt(row, 0).toString();int num=JOptionPane.showConfirmDialog(AdminMainFrame.this, “是否删除“+ name+“的订单“,“提醒“,JOptionPane. YES_NO_OPTION);if(num==JOptionPane.YES_OPTION){GoodsUtils.deleteGoods(name);showGoods();}}}});button_2.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {int row=tableGoods.getSelectedRow();if(row==-1){JOptionPane.showMessageDialog(AdminMainFrame.this,“请选定所修改商27品“,“提醒“,JOptionPane. INFORMATION_MESSAGE);}else{String name=tableGoods.getValueAt(row, 0).toString();GoodsUtils.deleteGoods(name);AdminMainFrame.this.setVisible(false);new AddGoods2().setVisible(true);}}});button_3.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {new AddPage2().setVisible(true);AdminMainFrame.this.setVisible(false);}});button_4.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {int row=tablePage.getSelectedRow();if(row==-1){JOptionPane.showMessageDialog(AdminMainFrame.this,“请选定所删内容“,“提醒“,JOptionPane. INFORMATION_MESSAGE);}else{String name=tablePage.getValueAt(row, 0).toString();int num=JOptionPane.showConfirmDialog(AdminMainFrame.this, “是否删除“+name+“的订单“,“ 提醒“,JOptionPane. YES_NO_OPTION);if(num==JOptionPane.YES_OPTION){PageUtils.deleteOrder(name);showPages();}}}});button_5.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {int row=tablePage.getSelectedRow();if(row==-1){JOptionPane.showMessageDialog(AdminMainFrame.this,“请选定所要修改内容“ ,“提醒“,JOptionPane.INFORMATION_MESSAGE);}else{String name=tablePage.getValueAt(row, 0).toString();PageData.now_page=PageUtils.getOrderByName(name);2AdminMainFrame.this.setVisible(false);new AddPage3().setVisible(true);}}});button_6.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {int row=tablePage.getSelectedRow();if(row==-1){JOptionPane.showMessageDialog(AdminMainFrame.this,“请选定所要修改内容“ ,“提醒“,JOptionPane.INFORMATION_MESSAGE);}else{String name=tablePage.getValueAt(row, 0).toString();Page page=PageUtils.getOrderByName(name);page.setIsGoing(“是“);showPages();}}});public void showGoods(){String name = textGoodsName.getText();//将查询的结果封装到 DefaultTableModel 的模型中//类似于 ArrayList,只不过是线程安全的Vector title = new Vector datalist = GoodsUtils.getGoodsByName(name);//封装表格内容tableModelGoods.setDataVector(datalist, title);}public void showPages(){String name = textPageName.getText();//将查询的结果封装到 DefaultTableModel 的模型中//类似于 ArrayList,只不过是线程安全的Vector title = new Vector datalist = PageUtils.getOrdersByNameOnAdmin(name);//封装表格内容tableModelPage.setDataVector(datalist, title);}用户注册界面:button.addActionListener( new ActionListener() {public void actionPerformed(ActionEvent arg0) {String name=textName.getText();String password=textPassword.getText();if (““.equals(name) || ““.equals(password)) {// 非空判读// 提示用户名或密码不能为空JOptionPane.showMessageDialog(RegisterFrame.this, “提示用户名或密码不能为空“, “非空验证“,JOptionPane.WARNING_MESSAGE);return;}else{User user = new User();user.setName(name);user.setPass(password);if(UserUtils.addUser(user)){JOptionPane.showMessageDialog(RegisterFrame.this, “注册成功“, “成功 “,JOptionPane.INFORMATION_MESSAGE);new LoginFrame().setVisible(true);RegisterFrame.this.setVisible(false);}else{JOptionPane.showMessageDialog(RegisterFrame.this, “注册失败“, “失败 “,JOptionPane.ERROR_MESSAGE);}}}});用户登录界面:butLogin.addActionListener( new ActionListener() {public void actionPerformed(ActionEvent e) {String name=textName.getText();String password=textPassword.getText();if(UserUtils.searchUser(name, password)){2UserData.now_name=name;JOptionPane.showMessageDialog(LoginFrame.this, “登录成功“, “成功“ ,JOptionPane.INFORMATION_MESSAGE);LoginFrame.this.setVisible(false);new MainFrame().setVisible(true);}else{JOptionPane.showMessageDialog(LoginFrame.this, “登录失败“, “失败“ ,JOptionPane.ERROR_MESSAGE);}}});butRegister.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {new RegisterFrame().setVisible(true);LoginFrame.this.setVisible(false);}});butAdmin.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {new AdminLogin().setVisible(true);//LoginFrame.this.setVisible(false);}});管理员登录界面:button.addActionListener( new ActionListener() {public void actionPerformed(ActionEvent e) {String name=textName.getText();String password=textPassword.getText();if(name.equals(“root“)AdminLogin.this.setVisible(false);}else{JOptionPane.showMessageDialog(AdminLogin.this, “登录失败“, “失败“ ,JOptionPane.INFORMATION_MESSAGE);}}});public class GoodsUtils {public static boolean addGoods(Goods good){GoodsData.GoodsList.add(good);return true;}public static boolean searchGoods(String GoodsName,String GoodsPrice){2boolean flag = false;// 注册用户for(Goods u:GoodsData.GoodsList){if(u.getName().equals(GoodsName) }}return flag;}public static boolean searchGoods(String GoodsName){boolean flag = false;// 注册用户for(Goods u:GoodsData.GoodsList){if(u.getName().equals(GoodsName) ){flag = true;}}return flag;}public static void deleteGoods(String name){for(int i=0; i> getGoodsByName(String name) {Vector> list = new Vector> ();if(““.equals(name)){for(Goods u:GoodsData.GoodsList){Vector str = new Vector<>();str.add(u.getName());str.add(u.getPrice());list.addElement(str);}}else{
    展开阅读全文
    1
      金牌文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
    0条评论

    还可以输入200字符

    暂无评论,赶快抢占沙发吧。

    关于本文
    本文标题:韩运畅_订餐管理系_源代码.rar
    链接地址:http://www.gold-doc.com/p-255300.html
    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服客服 - 联系我们
    [email protected] 2014-2018 金牌文库网站版权所有
    经营许可证编号:浙ICP备15046084号-3
    收起
    展开