赞
踩
开发语言为Java,开发环境Eclipse或者IDEA都可以。数据库采用:MySQL。运行主程序,或者执行打开JAR文件即可以运行本程序。
利用JDK自带的SWING框架开发,不需要安装第三方JAR包。MySQL数据库,纯窗体模式,直接运行Main文件即可以。同时带有详细得设计文档
1用户注册:用户输入:用户名和密码、邮箱进行注册,注册成功后,可以进行登陆系统
2 用户登陆:输入用户名和密码进行登陆。输入正确后,进入系统主界面
3 套餐维护:对餐厅里面的套餐进行维护,包括:新增、删除、修改。套餐信息包括:序号、名称,价格,简介、图片。
4 订单查询:查询所有的订单。一个订单包含多个订单项。订单包括:订单编号、菜品数量、总价、状态
5 在线点餐:用户可以对菜品逐一加入到购物车,也可以在添加的过程一一删除。选好菜品后,点击删除,完成菜品的删除。
6 取消订单:对下的订单取消
7 订单维护:订单维护就是对订单的状态进行变更:包括以下4中状态:确认订单、去送餐、已经完成、删除订单
- public class DbUtil {
- private String dbUrl = "jdbc:mysql://localhost:3306/db_food?useUnicode=true&characterEncoding=utf8";
-
- private String dbUserName = "root";
-
- private String dbPassword = "root";
-
- private String jdbcName = "com.mysql.jdbc.Driver";
-
- /**
- * 获取数据库连接
- *
- * @return
- * @throws Exception
- */
- public Connection getCon() throws Exception {
- Class.forName(jdbcName);
- Connection con = DriverManager.getConnection(dbUrl, dbUserName, dbPassword);
- return con;
- }
-
- /**
- * 关闭数据库连接
- *
- * @param con
- * @throws Exception
- */
- public void closeCon(Connection con) throws Exception {
- if (con != null) {
- con.close();
- }
- }
-
- public static void main(String[] args) {
- DbUtil dbUtil = new DbUtil();
- try {
- dbUtil.getCon();
- System.out.println("数据库连接成功");
- }
- catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- System.out.println("数据库连接失败");
- }
-
- }
- }
-
- public class StringUtil {
- public static boolean isEmpty(String str){
- if("".equals(str)||str==null){
- return true;
- }else{
- return false;
- }
- }
-
- public static boolean isNotEmpty(String str){
- if(!"".equals(str)&&str!=null){
- return true;
- }else{
- return false;
- }
- }
- /**
- * 验证邮箱地址是否正确
- * @param email
- * @return
- */
- public static boolean checkEmail(String email){
- boolean flag = false;
- try{
- String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
- Pattern regex = Pattern.compile(check);
- Matcher matcher = regex.matcher(email);
- flag = matcher.matches();
- }catch(Exception e){
- flag = false;
- }
-
- return flag;
- }
- /**
- * 验证手机号码
- * @param mobiles
- * @return [0-9]{5,9}
- */
- public static boolean isMobileNO(String mobiles){
- boolean flag = false;
- try{
- Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
- Matcher m = p.matcher(mobiles);
- flag = m.matches();
- }catch(Exception e){
- flag = false;
- }
- return flag;
- }
-
- //浮点型判断
- public static boolean isNum(String str){
- return str.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$");
- }
-
-
- }

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。