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

📄 actionent_record_thought.java.svn-base

📁 公司CRM部分原代码,采用的是java技术.
💻 SVN-BASE
字号:
package GDPE.thought;

import java.util.StringTokenizer;

import levin.base.*;
import levin.util.*;

import javax.servlet.http.*;

public class ActionEnt_Record_Thought extends Service
{

  public ActionEnt_Record_Thought()
  {
  }

  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
  {
	String id =null;
	id = request.getParameter("iEnterpriseId");
	EnEnt_Record_Thought [] aEnEnt_Record_Thought;
	if(id==null||id.equals("")){
		aEnEnt_Record_Thought = (EnEnt_Record_Thought[])(DAOBase.findAll(new DbAccess(),EnEnt_Record_Thought.class.getName()));
	}else {
		String where = "iEnterpriseId ="+id;
		aEnEnt_Record_Thought = (EnEnt_Record_Thought[])(DAOBase.findByCondition(new DbAccess(), EnEnt_Record_Thought.class.getName(),where,""));
	}
    for (int i = 0; i < aEnEnt_Record_Thought.length; i++) {
		if (!aEnEnt_Record_Thought[i].getDtTrackingDate().equals(""))
			aEnEnt_Record_Thought[i]
					.setDtTrackingDate(aEnEnt_Record_Thought[i]
							.getDtTrackingDate().substring(0, 10));
	}
    request.setAttribute("aEnEnt_Record_Thought", aEnEnt_Record_Thought);
    return this.getTargetPage("summary");
  }

  public String addQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    EnEnt_Record_Thought cEnEnt_Record_Thought = new EnEnt_Record_Thought();
    request.setAttribute("cEnEnt_Record_Thought", cEnEnt_Record_Thought);
    request.setAttribute("doType","add");
    return this.getTargetPage("detail");
  }

  public String add(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    EnEnt_Record_Thought cEnEnt_Record_Thought = (EnEnt_Record_Thought)request.getAttribute("cEnEnt_Record_Thought");
    DbAccess db = new DbAccess();
    try
    {
      db.beginTransaction();
      DAOBase.insert(db,cEnEnt_Record_Thought);
      db.commit();
    }
    catch(Exception ex)
    {
      db.rollback();
      throw ex;
    }
    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
        "新增成功.",
        "openTop(\"GDPE.thought.ActionEnt_Record_Thought.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_Record_Thought cEnEnt_Record_Thought = (EnEnt_Record_Thought)DAOBase.findByPK(new DbAccess(),EnEnt_Record_Thought.class.getName(),id);
    
		if (!cEnEnt_Record_Thought.getDtTrackingDate().equals(""))
			cEnEnt_Record_Thought
					.setDtTrackingDate(cEnEnt_Record_Thought
							.getDtTrackingDate().substring(0, 10));
	
    request.setAttribute("cEnEnt_Record_Thought",cEnEnt_Record_Thought);
    request.setAttribute("doType","modify");
    return this.getTargetPage("detail");
  }

  public String modify(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    EnEnt_Record_Thought cEnEnt_Record_Thought = (EnEnt_Record_Thought)request.getAttribute("cEnEnt_Record_Thought");
    DbAccess db = new DbAccess();
    try
    {
      db.beginTransaction();
      DAOBase.update(db,cEnEnt_Record_Thought);
      db.commit();
    }
    catch(Exception ex)
    {
      db.rollback();
      throw ex;
    }
    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
        "修改成功.",
        "openTop(\"GDPE.thought.ActionEnt_Record_Thought.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_Record_Thought cEnEnt_Record_Thought = (EnEnt_Record_Thought)DAOBase.findByPK(new DbAccess(),EnEnt_Record_Thought.class.getName(),id);
    if (!cEnEnt_Record_Thought.getDtTrackingDate().equals(""))
		cEnEnt_Record_Thought
				.setDtTrackingDate(cEnEnt_Record_Thought
						.getDtTrackingDate().substring(0, 10));
    
    request.setAttribute("cEnEnt_Record_Thought",cEnEnt_Record_Thought);
    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();
            db.beginTransaction();
            DAOBase.delete(db,EnEnt_Record_Thought.class.getName(),index);
		}
		db.commit();
    }
    catch(Exception ex)
    {
      db.rollback();
      throw ex;
    }
    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
        "删除成功.",
        "openTop(\"GDPE.thought.ActionEnt_Record_Thought.do?doType=summary\");");
    msg.save(request);
    return this.getTargetPage("Message");
  }
}

⌨️ 快捷键说明

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