?? deletecontractaction.java
字號:
package com.ICT.AFC.contract.actions;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.ServletContext;
import javax.sql.DataSource;
import com.ICT.AFC.DB.DB;
import com.ICT.AFC.contract.beans.ContractOperate;
import com.ICT.AFC.contracttree.beans.ContractTree;
import com.ICT.AFC.user.beans.User;
public class deleteContractAction
extends Action {
public ActionForward execute(ActionMapping Mapping,
ActionForm Form,
HttpServletRequest Request,
HttpServletResponse Response) throws Exception {
HttpSession session = Request.getSession();
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource) context.getAttribute("contract");//獲取數據源
String PageForward = "departmentcontract";
String contractid = Request.getParameter("contractID");//提取要刪除合同的編號
int contractId = Integer.parseInt(contractid);
DB db = new DB(dataSource);
ContractOperate.deleteContract(db, contractId);//從數據庫中刪除
User user = (User) session.getAttribute("USER");
String treestr = ContractTree.getTree(db, user);
session.setAttribute("CONTRACTTREE", treestr); //獲取樹型結構
String departmentID=(String)session.getAttribute("DEPARTMENTID");
String contractIsSell=(String) session.getAttribute("CONTRACTISSELL");
session.setAttribute("DEPARTMENTCONTRACTLIST",
ContractOperate.searchDepartment(db, departmentID,
contractIsSell));
db.close();
return (Mapping.findForward(PageForward));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -