Java鲜花操作系统服务层

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);
	 }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

.wei-upup

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值