ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

Java鲜花操作系统服务层

2021-06-27 16:57:45  阅读:137  来源: 互联网

标签:Exception Java 操作系统 鲜花 throws import return public String


1.CustomerService

//顾客表操作

package Service;


import java.util.List;

import DAO.CustomerDAO;
import Factory.DAOFactory;
import StoreManager.Customer;

public class CustomerService {
	CustomerDAO cusDao = DAOFactory.getCustomerDAO();
	public int insert(Customer cus) throws Exception {
		return cusDao.insert(cus);
	}
	public void delete(String cusid) throws Exception{
		cusDao.delete(cusid);
	}
	public String[][] queryById(String cusid) throws Exception{
		return cusDao.queryById(cusid);
	}
	public List<String> queryAll() throws Exception{
		return cusDao.queryAll();
	}
	public void update(Customer cus) throws Exception{
		cusDao.update(cus);
	}
	public int update1(Customer cus) throws Exception{
		return cusDao.update1(cus);
	}
	public int shopping(double balance,String id) throws Exception{
		return cusDao.shopping(balance, id);
	}
	public double getBalance(String id) throws Exception{
		return cusDao.getBalance(id);
	}
	public void update2(Customer cus) throws Exception{
		cusDao.update2(cus);
	}
}

2.FlowerService

//鲜花表操作

package Service;

import java.util.List;

import DAO.FlowerDAO;
import Factory.DAOFactory;
import StoreManager.Flower;

public class FlowerService {
	FlowerDAO floDao = DAOFactory.getFlowerDAO();
	public void insert(Flower flo) throws Exception{
		floDao.insert(flo);
	}
	 public void delete(int flid) throws Exception{
		 floDao.delete(flid);
	 }
	 public String[][] queryById(int flid) throws Exception{
		 return floDao.queryById(flid);
	 }
	 public String[][] queryByName(String flname) throws Exception{
		 return floDao.queryByName(flname);
	 }
	 public double getPrice(String flname) throws Exception{
		 return floDao.getPrice(flname);
	 }
	 public List<String> queryAll() throws Exception{
		 return floDao.queryAll();
	 }
	 public List<String> queryComBox() throws Exception{
		 return floDao.queryComBox();
	 }
	 public void update(Flower flo) throws Exception{
		 floDao.update(flo);
	 }
	 public int getStore(String name) throws Exception{
		 return floDao.getStore(name);
	 }
	 public int shopping(int number,String name) throws Exception{
		 return floDao.shopping(number, name);
	 }
}

3.OrdersService

//订单表操作

package Service;

import java.util.List;

import DAO.OrdersDAO;
import Factory.DAOFactory;
import StoreManager.Orders;

public class OrdersService {
	 OrdersDAO orDao = DAOFactory.getOrdersDAO();
	 public void insert(String s1,String s2,String s3,double s4) throws Exception{
		 orDao.insert(s1, s2, s3, s4);
	 }
	 public String[][] queryById(String ordid) throws Exception{
		 return orDao.queryById(ordid);
	 }
	 public List<String> queryByC_Id(String cusid) throws Exception{
		 return orDao.queryByC_Id(cusid);
	 }
	 public List<String> queryAll() throws Exception{
		 return orDao.queryAll();
	 }
	 public void delete(int ordid) throws Exception{
		 orDao.delete(ordid);
	 }
	 public void update(Orders ord) throws Exception{
		 orDao.update(ord);
	 }
	 public void storemessageclear(){
		 orDao.storemessageclear();
	 }
}

4.UserService

//管理员表操作

package Service;

import java.util.List;

import DAO.UserDAO;
import Factory.DAOFactory;
import StoreManager.User;

public class UserService {
	 UserDAO userDAO = DAOFactory.getUserDAO();
	 public void insert(User user) throws Exception{
		 userDAO.insert(user);
	 }
	 public void delete(String userid) throws Exception{
		 userDAO.delete(userid);
	 }
	 public String[][] queryById(String userid) throws Exception{
		 return userDAO.queryById(userid);
	 }
	 public List<String> queryAll() throws Exception{
		 return userDAO.queryAll();
	 }
	 public void update(User user) throws Exception{
		 userDAO.update(user);
	 }
	 public void update1(User user) throws Exception{
		 userDAO.update1(user);
	 }
}

标签:Exception,Java,操作系统,鲜花,throws,import,return,public,String
来源: https://blog.csdn.net/m0_59287223/article/details/118276367

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有