⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tocompaddto.java

📁 实现银行系统中某个部门的计算机设备管理、公共信息管理、权限用户管理、系统设置等,为系统的安全正常运行提供保障
💻 JAVA
字号:
package com.isoftstone.banktearm1.to;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.StringTokenizer;

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

import com.isoftstone.banktearm1.dao.ToCompAddDao;
import com.isoftstone.banktearm1.db.DB;
import com.isoftstone.banktearm1.demo.ToComp;
import com.isoftstone.banktearm1.tools.DateZhu;
import com.isoftstone.banktearm1.vo.BankTeam1CompVo;

public class ToCompAddTo extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public ToCompAddTo() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
   String code=request.getParameter("code");
   if(code.equals("2")){
	   request.getRequestDispatcher("ToCompAdd.jsp").forward(request, response);
   }
   

		//String depid=request.getParameter("depid");
		//depid=new String(depid.getBytes("ISO-8859-1"),"gb2312");
		//System.out.println("depid="+depid);
		String computertype=request.getParameter("computertype");
		computertype=new String(computertype.getBytes("ISO-8859-1"),"gb2312");
		System.out.println("aaa"+computertype);
		String cpu=request.getParameter("cpu");
		cpu=new String(cpu.getBytes("ISO-8859-1"),"gb2312");
		String memory=request.getParameter("memory");
		memory=new String(memory.getBytes("ISO-8859-1"),"gb2312");
		String harddisk=request.getParameter("harddisk");
		harddisk=new String(harddisk.getBytes("ISO-8859-1"),"gb2312");
		String os=request.getParameter("os");
		os=new String(os.getBytes("ISO-8859-1"),"gb2312");
		//String mend=request.getParameter("memory");
		//String antiVirus=request.getParameter("memory");
		String ipAddress=request.getParameter("ipaddress");
		ipAddress=new String(ipAddress.getBytes("ISO-8859-1"),"gb2312");
		String macAddress=request.getParameter("macaddress");
		macAddress=new String(macAddress.getBytes("ISO-8859-1"),"gb2312");
		//int userId=Integer.parseInt()
		String userName=request.getParameter("username");
		userName=new String(userName.getBytes("ISO-8859-1"),"gb2312");
		//String userUnit=request.getParameter("memory");
		String houseId=request.getParameter("houseid");
		houseId=new String(houseId.getBytes("ISO-8859-1"),"gb2312");
		String dutyPeople=request.getParameter("dutypeople");
		dutyPeople=new String(dutyPeople.getBytes("ISO-8859-1"),"gb2312");
		String use=request.getParameter("use");
		use=new String(use.getBytes("ISO-8859-1"),"gb2312");
		String buytime=request.getParameter("buytime");
		String usetime=request.getParameter("usetime");

		String whichUse=request.getParameter("whichuse");
		whichUse=new String(whichUse.getBytes("ISO-8859-1"),"gb2312");
		
//		BankTeam1CompVo vo=new BankTeam1CompVo();
//		vo.setComputerType(computertype);
//		vo.setCpu(cpu);
//		vo.setMemory(memory);
//		vo.setHarddisk(harddisk);
//		vo.setOs(os);
//		vo.setIpAddress(ipAddress);
//		vo.setMacAddress(macAddress);
//		vo.setUserName(userName);
//		vo.setHouseId(houseId);
//		vo.setDutyPeople(dutyPeople);
//		vo.setUse(use);
//		vo.setBuyTime(buyTime);
//		vo.setUseTime(useTime);
//		vo.setWhichUse(whichUse);
//		ToCompAddDao a=new ToCompAddDao();
		try {
			ToComp a=new ToComp( computertype, cpu, memory, harddisk, os, ipAddress, macAddress, userName, houseId, dutyPeople, use, buytime, usetime, whichUse);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		BankTeam1CompVo vo=new BankTeam1CompVo();
		if(vo!=null){
		response.sendRedirect("ToCompAdd.jsp");
		}
		
		
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doGet(request, response);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

⌨️ 快捷键说明

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