usermgr.java

来自「JSP实现的在线网络购物系统JAVA程序源码,」· Java 代码 · 共 135 行

JAVA
135
字号
package com.shopping.business;

import java.sql.*;
import java.util.*;

import com.comm.*;
import com.comm.vo.*;
import com.shopping.dao.*;

public class UserMgr {

    public int registerUser(GenericVO gvo) throws AppException {
        try {
            return new UserDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void modifyUser(GenericVO gvo) throws AppException {
        try {
            new UserDao().modify(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public ListVO searchUser(GenericVO gvo) throws AppException {
        try {
            return new UserDao().search(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO getUserDetail(int userId) throws AppException {
        try {
            return new UserDao().getDetail(userId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void updateUserDot(int userId, int dot) throws AppException {
        try {
            new UserDao().updateUserDot(userId, dot);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public GenericVO login(String userName, String password) throws
            AppException {
        try {
            return new UserDao().login(userName, password);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getOrdersByUserId(int userId) throws AppException {
        try {
            return new OrderDao().getOrdersByUserId(userId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getOrdersByUserId(int userId, int status, int num) throws
            AppException {
        try {
            return new OrderDao().getOrdersByUserId(userId, status, num);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addRemit(GenericVO gvo) throws AppException {
        try {
            new RemitDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addFavorite(GenericVO gvo) throws AppException {
        try {
            new FavoriteDao().add(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void deleteFavorite(int favoriteId) throws AppException {
        try {
            new FavoriteDao().delete(favoriteId);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public ListVO searchFavorite(GenericVO gvo) throws AppException {
        try {
            return new FavoriteDao().search(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public int modifyUserPass(int userId, String oldPass, String newPass) throws
            AppException {
        try {
            return new UserDao().passModify(userId, oldPass, newPass);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public void addOrderStatus(GenericVO gvo) throws AppException {
        try {
            new OrderDao().addOrderStatus(gvo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }

    public Vector getOrderStatusByOrderNo(String orderNo) throws AppException {
        try {
            return new OrderDao().getOrderStatusByOrderNo(orderNo);
        } catch (SQLException ex) {
            throw new AppException(ex);
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?