📄 actionent_phone_contract.java
字号:
package GDPE.contract.phone;
import java.util.StringTokenizer;
import levin.UserInfo;
import levin.base.*;
import levin.util.*;
import javax.servlet.http.*;
import portal.sa.auditor.EnAuditor;
import GDPE.contract.manager.EnEnt_Record_Contract;
import GDPE.customer.enterprise.DAOCustomer;
import GDPE.customer.enterprise.EnEnt_Customer_Enterprise;
public class ActionENT_PHONE_CONTRACT extends Service
{
public ActionENT_PHONE_CONTRACT()
{
}
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception
{
throw new Exception("Error on doType=" + request.getParameter("doType") + ".");
}
public String summary(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PHONE_CONTRACT aEnENT_PHONE_CONTRACT[] = (EnENT_PHONE_CONTRACT[])(DAOBase.findAll(new DbAccess(),EnENT_PHONE_CONTRACT.class.getName()));
for(int i=0;i<aEnENT_PHONE_CONTRACT.length;i++) {
if (!aEnENT_PHONE_CONTRACT[i].getDtContractBeginTime().equals("")) {
if (aEnENT_PHONE_CONTRACT[i].getDtContractBeginTime().startsWith("1900")) {
aEnENT_PHONE_CONTRACT[i].setDtContractBeginTime("");
} else {
String year = aEnENT_PHONE_CONTRACT[i].getDtContractBeginTime()
.substring(0, 4);
String month = aEnENT_PHONE_CONTRACT[i].getDtContractBeginTime()
.substring(5, 7);
String day = aEnENT_PHONE_CONTRACT[i].getDtContractBeginTime()
.substring(8, 10);
aEnENT_PHONE_CONTRACT[i].setDtContractBeginTime(year + month + day);
}
}
if (!aEnENT_PHONE_CONTRACT[i].getDtContractEndTime().equals("")) {
if (aEnENT_PHONE_CONTRACT[i].getDtContractEndTime().startsWith("1900")) {
aEnENT_PHONE_CONTRACT[i].setDtContractEndTime("");
} else {
String year = aEnENT_PHONE_CONTRACT[i].getDtContractEndTime()
.substring(0, 4);
String month = aEnENT_PHONE_CONTRACT[i].getDtContractEndTime()
.substring(5, 7);
String day = aEnENT_PHONE_CONTRACT[i].getDtContractEndTime()
.substring(8, 10);
aEnENT_PHONE_CONTRACT[i].setDtContractEndTime(year + month + day);
}
}
if (!aEnENT_PHONE_CONTRACT[i].getDtRecordTime().equals("")) {
if (aEnENT_PHONE_CONTRACT[i].getDtRecordTime().startsWith("1900")) {
aEnENT_PHONE_CONTRACT[i].setDtRecordTime("");
} else {
String year = aEnENT_PHONE_CONTRACT[i].getDtRecordTime()
.substring(0, 4);
String month = aEnENT_PHONE_CONTRACT[i].getDtRecordTime()
.substring(5, 7);
String day = aEnENT_PHONE_CONTRACT[i].getDtRecordTime()
.substring(8, 10);
aEnENT_PHONE_CONTRACT[i].setDtRecordTime(year + month + day);
}
}
}
request.setAttribute("aEnENT_PHONE_CONTRACT", aEnENT_PHONE_CONTRACT);
return this.getTargetPage("summary");
}
public String addQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PHONE_CONTRACT cEnENT_PHONE_CONTRACT = new EnENT_PHONE_CONTRACT();
request.setAttribute("cEnENT_PHONE_CONTRACT", cEnENT_PHONE_CONTRACT);
request.setAttribute("doType","add");
return this.getTargetPage("detail");
}
public String add(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PHONE_CONTRACT cEnENT_PHONE_CONTRACT = (EnENT_PHONE_CONTRACT)request.getAttribute("cEnENT_PHONE_CONTRACT");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
DAOBase.insert(db,cEnENT_PHONE_CONTRACT);
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("电话报单",
"新增成功.",
"openTop(\"GDPE.contract.phone.ActionENT_PHONE_CONTRACT.do?doType=summary\");");
msg.save(request);
return this.getTargetPage("Message");
}
public String modifyQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String chContractNo = request.getParameter("chContractNo");
EnENT_PHONE_CONTRACT cEnENT_PHONE_CONTRACT = (EnENT_PHONE_CONTRACT)DAOBase.findByPK(new DbAccess(),EnENT_PHONE_CONTRACT.class.getName(),chContractNo);
if (!cEnENT_PHONE_CONTRACT.getDtContractBeginTime().equals("")) {
if (cEnENT_PHONE_CONTRACT.getDtContractBeginTime().startsWith("1900")) {
cEnENT_PHONE_CONTRACT.setDtContractBeginTime("");
} else {
String year = cEnENT_PHONE_CONTRACT.getDtContractBeginTime()
.substring(0, 4);
String month = cEnENT_PHONE_CONTRACT.getDtContractBeginTime()
.substring(5, 7);
String day = cEnENT_PHONE_CONTRACT.getDtContractBeginTime()
.substring(8, 10);
cEnENT_PHONE_CONTRACT.setDtContractBeginTime(year + month + day);
}
}
if (!cEnENT_PHONE_CONTRACT.getDtContractEndTime().equals("")) {
if (cEnENT_PHONE_CONTRACT.getDtContractEndTime().startsWith("1900")) {
cEnENT_PHONE_CONTRACT.setDtContractEndTime("");
} else {
String year = cEnENT_PHONE_CONTRACT.getDtContractEndTime()
.substring(0, 4);
String month = cEnENT_PHONE_CONTRACT.getDtContractEndTime()
.substring(5, 7);
String day = cEnENT_PHONE_CONTRACT.getDtContractEndTime()
.substring(8, 10);
cEnENT_PHONE_CONTRACT.setDtContractEndTime(year + month + day);
}
}
if (!cEnENT_PHONE_CONTRACT.getDtRecordTime().equals("")) {
if (cEnENT_PHONE_CONTRACT.getDtRecordTime().startsWith("1900")) {
cEnENT_PHONE_CONTRACT.setDtRecordTime("");
} else {
String year = cEnENT_PHONE_CONTRACT.getDtRecordTime()
.substring(0, 4);
String month = cEnENT_PHONE_CONTRACT.getDtRecordTime()
.substring(5, 7);
String day = cEnENT_PHONE_CONTRACT.getDtRecordTime()
.substring(8, 10);
cEnENT_PHONE_CONTRACT.setDtRecordTime(year + month + day);
}
}
request.setAttribute("cEnENT_PHONE_CONTRACT",cEnENT_PHONE_CONTRACT);
request.setAttribute("doType","modify");
return this.getTargetPage("detail");
}
public String modify(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PHONE_CONTRACT cEnENT_PHONE_CONTRACT = (EnENT_PHONE_CONTRACT)request.getAttribute("cEnENT_PHONE_CONTRACT");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
DAOBase.update(db,cEnENT_PHONE_CONTRACT);
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("电话报单",
"修改成功.",
"openTop(\"GDPE.contract.phone.ActionENT_PHONE_CONTRACT.do?doType=summary\");");
msg.save(request);
return this.getTargetPage("Message");
}
public String view(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String chContractNo = request.getParameter("chContractNo");
EnENT_PHONE_CONTRACT cEnENT_PHONE_CONTRACT = (EnENT_PHONE_CONTRACT)DAOBase.findByPK(new DbAccess(),EnENT_PHONE_CONTRACT.class.getName(),chContractNo);
request.setAttribute("cEnENT_PHONE_CONTRACT",cEnENT_PHONE_CONTRACT);
request.setAttribute("doType","view");
return this.getTargetPage("detail");
}
public String delete(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String chContractNo = request.getParameter("chContractNo");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
StringTokenizer st = new StringTokenizer(chContractNo, ",");//
while (st.hasMoreElements()) {
String index = (String) st.nextElement();
DAOBase.delete(db,EnENT_PHONE_CONTRACT.class.getName(),index);
}
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("电话报单",
"删除成功.",
"openTop(\"GDPE.contract.phone.ActionENT_PHONE_CONTRACT.do?doType=summary\");");
msg.save(request);
return this.getTargetPage("Message");
}
public String search(HttpServletRequest request,
HttpServletResponse response) throws Exception {
levin.util.DbAccess db = new levin.util.DbAccess();
String chEnterpriseName = request.getParameter("chEnterpriseName");
String chConnectPhone = request.getParameter("chConnectPhone");
String chDealPhone = request.getParameter("chDealPhone");
String chPassword = request.getParameter("chPassword");
EnENT_PHONE_CONTRACT aEnENT_PHONE_CONTRACT[];
EnENT_PHONE_CONTRACT searchContract = new EnENT_PHONE_CONTRACT();
searchContract.setChEnterpriseName(chEnterpriseName);
searchContract.setChConnectPhone(chConnectPhone);
searchContract.setChDealPhone(chDealPhone);
searchContract.setChPassword(chPassword);
aEnENT_PHONE_CONTRACT = (EnENT_PHONE_CONTRACT[]) (DAOContract
.searchePhContract(db, searchContract));
request.setAttribute("aEnENT_PHONE_CONTRACT",
aEnENT_PHONE_CONTRACT);
request.setAttribute("doType", "search");
return this.getTargetPage("summary");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -