📄 actionent_personal_change.java.svn-base
字号:
package GDPE.customer.personchange;
import java.util.StringTokenizer;
import levin.base.*;
import levin.util.*;
import javax.servlet.http.*;
import GDPE.customer.linkman.DAOLinkMan;
import GDPE.customer.linkman.EnENT_CUSTOMER_LINKMAN;
import GDPE.customer.personal.EnENT_CUSTOMER_PERSONAL;
public class ActionENT_PERSONAL_CHANGE extends Service
{
public ActionENT_PERSONAL_CHANGE()
{
}
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_PERSONAL_CHANGE aEnENT_PERSONAL_CHANGE[] = (EnENT_PERSONAL_CHANGE[])(DAOBase.findAll(new DbAccess(),EnENT_PERSONAL_CHANGE.class.getName()));
for(int i=0;i<aEnENT_PERSONAL_CHANGE.length;i++){
if(!aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().equals(""))
{
String year=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(0,4);
String month=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(5,7);
String day=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(8,10);
aEnENT_PERSONAL_CHANGE[i].setDtBegin_Time(year+month+day);
}
}
request.setAttribute("chooseType","checkBox");
request.setAttribute("aEnENT_PERSONAL_CHANGE", aEnENT_PERSONAL_CHANGE);
return this.getTargetPage("summary");
}
public String addQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PERSONAL_CHANGE cEnENT_PERSONAL_CHANGE = new EnENT_PERSONAL_CHANGE();
request.setAttribute("cEnENT_PERSONAL_CHANGE", cEnENT_PERSONAL_CHANGE);
request.setAttribute("doType","add");
return this.getTargetPage("detail");
}
public String add(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PERSONAL_CHANGE cEnENT_PERSONAL_CHANGE = (EnENT_PERSONAL_CHANGE)request.getAttribute("cEnENT_PERSONAL_CHANGE");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
DAOBase.insert(db,cEnENT_PERSONAL_CHANGE);
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("服务更改",
"新增成功.",
"openTop(\"GDPE.customer.personchange.ActionENT_PERSONAL_CHANGE.do?doType=summary\");");
msg.save(request);
return this.getTargetPage("Message");
}
public String modifyQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String id = request.getParameter("id");
EnENT_PERSONAL_CHANGE cEnENT_PERSONAL_CHANGE = (EnENT_PERSONAL_CHANGE)DAOBase.findByPK(new DbAccess(),EnENT_PERSONAL_CHANGE.class.getName(),id);
request.setAttribute("cEnENT_PERSONAL_CHANGE",cEnENT_PERSONAL_CHANGE);
request.setAttribute("doType","modify");
return this.getTargetPage("detail");
}
public String modify(HttpServletRequest request, HttpServletResponse response) throws Exception
{
EnENT_PERSONAL_CHANGE cEnENT_PERSONAL_CHANGE = (EnENT_PERSONAL_CHANGE)request.getAttribute("cEnENT_PERSONAL_CHANGE");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
DAOBase.update(db,cEnENT_PERSONAL_CHANGE);
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("服务更改",
"修改成功.",
"openTop(\"GDPE.customer.personchange.ActionENT_PERSONAL_CHANGE.do?doType=summary\");");
msg.save(request);
return this.getTargetPage("Message");
}
public String view(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String id = request.getParameter("id");
EnENT_PERSONAL_CHANGE cEnENT_PERSONAL_CHANGE = (EnENT_PERSONAL_CHANGE)DAOBase.findByPK(new DbAccess(),EnENT_PERSONAL_CHANGE.class.getName(),id);
if(!cEnENT_PERSONAL_CHANGE.getDtBegin_Time().equals(""))
{
String year=cEnENT_PERSONAL_CHANGE.getDtBegin_Time().substring(0,4);
String month=cEnENT_PERSONAL_CHANGE.getDtBegin_Time().substring(5,7);
String day=cEnENT_PERSONAL_CHANGE.getDtBegin_Time().substring(8,10);
cEnENT_PERSONAL_CHANGE.setDtBegin_Time(year+month+day);
}
request.setAttribute("cEnENT_PERSONAL_CHANGE",cEnENT_PERSONAL_CHANGE);
request.setAttribute("doType","view");
return this.getTargetPage("detail");
}
public String delete(HttpServletRequest request, HttpServletResponse response) throws Exception
{
String id = request.getParameter("id");
DbAccess db = new DbAccess();
try
{
db.beginTransaction();
StringTokenizer st = new StringTokenizer(id,",");
while(st.hasMoreElements()){
String index =(String)st.nextElement();
DAOBase.delete(db,EnENT_PERSONAL_CHANGE.class.getName(),index);
}
db.commit();
}
catch(Exception ex)
{
db.rollback();
throw ex;
}
levin.iMessage msg = levin.iMessage.getNewInstance("服务更改",
"删除成功.",
"openTop(\"GDPE.customer.personchange.ActionENT_PERSONAL_CHANGE.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 chFollower_Name = request.getParameter("chFollower_Name");
String chAnother_Follower_Name = request.getParameter("chAnother_Follower_Name");
String dtBegin_Time = request.getParameter("dtBegin_Time");
System.out.println(".......................22222222....................................................");
EnENT_PERSONAL_CHANGE searchPersonChange = new EnENT_PERSONAL_CHANGE();
searchPersonChange.setDtBegin_Time(dtBegin_Time);
searchPersonChange.setChAnother_Follower_Name(chAnother_Follower_Name);
searchPersonChange.setChFollower_Name(chFollower_Name);
if(!request.getParameter("iCustomer_ID").equals("")){
System.out.println(".......................1111111....................................................");
searchPersonChange.setICustomer_ID(Integer.parseInt(request.getParameter("iCustomer_ID")));
}else{
System.out.println(".......................3333333....................................................");
searchPersonChange.setICustomer_ID(0);
}
EnENT_PERSONAL_CHANGE aEnENT_PERSONAL_CHANGE[] = (EnENT_PERSONAL_CHANGE[]) (DAOPersonChange.searchEnPersonChange(db, searchPersonChange));
for(int i = 0;i<aEnENT_PERSONAL_CHANGE.length;i++){
if(!aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().equals(""))
{
String year=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(0,4);
String month=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(5,7);
String day=aEnENT_PERSONAL_CHANGE[i].getDtBegin_Time().substring(8,10);
aEnENT_PERSONAL_CHANGE[i].setDtBegin_Time(year+month+day);
}
}
request.setAttribute("aEnENT_PERSONAL_CHANGE",aEnENT_PERSONAL_CHANGE);
request.setAttribute("chooseType","checkBox");
request.setAttribute("doType", "search");
return this.getTargetPage("summary");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -