dgbas公文管理核心java源码

源代码在线查看: orgdocservlet.java

软件大小: 5668 K
上传用户: apsdn
关键词: dgbas java 核心 源码
下载地址: 免注册下载 普通下载 VIP

相关代码

				package com.jasson.presentation.system;
				import java.io.*;
				import javax.servlet.*;
				import javax.servlet.http.*;
				import com.jasson.common.*;
				import com.jasson.business.document.RecipientDAO;
				public class OrgDocServlet  extends HttpServlet{
					public void service(HttpServletRequest request, HttpServletResponse  response) throws IOException, ServletException {
						HttpSession session = (HttpSession)request.getSession();
						ExtendString ExStr=new ExtendString();
						request.setCharacterEncoding("ISO8859-1");
						request.setAttribute("ErrMsg","");
						String Flag=ExStr.nullToSpace(request.getParameter("Flag"));
						if(request.getParameter("RecipientID")!=null)	
						{
							if(Flag.equals("Edit"))
							{
								RecipientDAO recipientDAO=new RecipientDAO();
								recipientDAO.setRecipientID(Integer.parseInt((String)request.getParameter("RecipientID")));
								recipientDAO.setRecipientName(ExStr.formDecode((String)request.getParameter("OrgName")));
								recipientDAO.setRecipientAddress(ExStr.formDecode((String)request.getParameter("Addr")));
								recipientDAO.setZipCode(ExStr.formDecode((String)request.getParameter("ZipCode")));
								recipientDAO.setOrgID(ExStr.formDecode((String)request.getParameter("OrgID")));
								recipientDAO.seteTransfer((String)request.getParameter("Transfer"));
								recipientDAO.update();
								System.out.println("update");
								//clientForward(request,response);
								forward("/DMS/system/reload.jsp",request,response);
								return;
					        
							}
							if(Flag.equals("Read"))
							{
								RecipientDAO recipientDAO = RecipientDAO.find(Integer.parseInt((String)request.getParameter("RecipientID")));
								System.out.println(recipientDAO);
								request.setAttribute("RecipientDAO",recipientDAO);
								request.setAttribute("pageSel",request.getParameter("pageSel"));
								forward("/DMS/system/OrgAddEdit.jsp",request,response);
								return;
							}
						}
						
						if(Flag.equals("Add"))
						{
							RecipientDAO[] recipientDAOs=RecipientDAO.findBy(ExStr.formDecode((String)request.getParameter("OrgName")));		     
							if(recipientDAOs==null ||recipientDAOs.length==0)
							{
								RecipientDAO recipientDAO=new RecipientDAO();
								recipientDAO.setRecipientName(ExStr.formDecode((String)request.getParameter("OrgName")));
								recipientDAO.setRecipientAddress(ExStr.formDecode((String)request.getParameter("Addr")));
								recipientDAO.setZipCode(ExStr.formDecode((String)request.getParameter("ZipCode")));
								recipientDAO.setOrgID(ExStr.formDecode((String)request.getParameter("OrgID")));
								recipientDAO.seteTransfer((String)request.getParameter("Transfer"));
								recipientDAO.insert();
								//clientForward(request,response);
								forward("/DMS/system/reload.jsp",request,response);
								return;
							}
							else
								request.setAttribute("ErrMsg","诀闽			

相关资源