sortupd.java

来自「仓库管理系统,适合各种行业的仓库管理系统」· Java 代码 · 共 54 行

JAVA
54
字号
package com.sort.action;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bean.DAO.ProductsortDAO;
import com.bean.DTO.ProductsortDTO;
import com.bean.DTO.UserinforDTO;
import com.database.DataSourceFactory;
import com.servlet.AbstractAction;
import com.system.action.popedomCheck;

public class sortUpd extends AbstractAction {
	public String process(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String url = "sortList.do";
		UserinforDTO udt = (UserinforDTO) request.getSession().getAttribute(
				"userinfor");
		popedomCheck pc = new popedomCheck(udt);
		if (pc.adminCheck()) {
			Connection con;
			try {
				con = DataSourceFactory.getDataSource().getConnection();
				request.setCharacterEncoding("UTF-8");
				ProductsortDAO ps = new ProductsortDAO();
				ProductsortDTO pd = new ProductsortDTO();
				String id = request.getParameter("sortID");
				String information = request.getParameter("information");
				String name = request.getParameter("name");
				if (id != null && name != null) {
					int sortID = Integer.parseInt(id);
					pd.setSortID(sortID);
					pd.setName(name);
					pd.setInformation(information);
					if (pd != null && sortID != 0)
						ps.updproductsort(pd, con);
				}
				con.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} else {
			url = "User/login.jsp";
		}
		return url;
	}

}

⌨️ 快捷键说明

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