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

📄 perservlet.java

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
				String xh = strRCXH;
				errcode = dabean.delRC(personno,xh);
				response.sendRedirect("oa/person/person.jsp?txt_type=2&txt_personno="+personno+"&errcode="+errcode);			
			}
/*删除日程安排中多条信息
			if(strType!=null && strType.equals("1") && strEdit.equals("4"))
			{
				errcode = dabean.delRC(strPersonNo,strRCXH);
				//返回到查看列表的界面
				response.sendRedirect("oa/person/person.jsp?txt_type=2&txt_personno="+strPersonNo+"&errcode="+errcode);
			}*/
//清空日程安排记录
			if(strType!=null && strType.equals("2") && strEdit.equals("4"))
			{
				errcode = dabean.clearRecord(strPersonNo);
				//返回到查看列表的界面
				response.sendRedirect("oa/person/person.jsp?txt_type=2&txt_personno="+strPersonNo+"&errcode="+errcode);
			}

/*
 ****************************************************************************
 *	 个人群组部分的处理 2003年11月2日 (strType="4")
 *   @author 许晓昕
 *	 @version 1.0
 ****************************************************************************
*/
//System.out.println("\nBefore:::"+strType+"   "+strEdit);
//新增个人群组信息
			if(strType!=null && strType.equals("4") && strEdit.equals("1"))
			{
				String strNewGroupName=ds.toString((String)request.getParameter("newgroup_Name"));
				if(strNewGroupName.equals("")){
					errcode=-1;
				}else{
					pGroupBean.setPersonNO(strPersonNo);
					errcode=pGroupBean.addRec(ds.toGBK(strNewGroupName));
				}//end if else
				//返回到查看列表的界面
				response.sendRedirect("oa/person/person.jsp?txt_type=4&errcode="+errcode);
			}
//修改个人群组信息
			if(strType!=null && strType.equals("4") && strEdit.equals("2"))
			{
				String strNewGroupName=ds.toString((String)request.getParameter("newgroup_Name"));
				if(strGroupNo.equals("")||strNewGroupName.equals("")){
					errcode=-1;
				}else{
					pGroupBean.setPersonNO(strPersonNo);
					pGroupBean.setGroupNO(strGroupNo);
					errcode=pGroupBean.modRec_GroupName(ds.toGBK(strNewGroupName));
				}//end if else
				//返回到查看列表的界面
				response.sendRedirect("oa/person/person.jsp?txt_type=4&errcode="+errcode);
			}

//删除个人群组信息
			if(strType!=null && strType.equals("4") && strEdit.equals("3"))
			{
				if(strGroupNo.equals("")){
					errcode=-1;
				}else{
					pGroupBean.setPersonNO(strPersonNo);
					pGroupBean.setGroupNO(strGroupNo);
					errcode=pGroupBean.delRec();
				}//end if else
				//返回到查看列表的界面
				response.sendRedirect("oa/person/person.jsp?txt_type=4&errcode="+errcode);
			}

/*
 *	end个人群组----------------------------------------------------------------------------->
 */
			
			if(strType!=null && strType.equals("5"))///我的短消息
			{
				smsbean = new SmsBean();

				if( smsbean.getConn() == null ){
					PrintWriter out = response.getWriter();
					response.setContentType("text/html; charset=GB2312");
					out.println("<html>");
					out.println(ds.toASCII("<title>数据库无响应,请后退并重试</title>"));
					out.println(ds.toASCII("数据库无法响应,请&nbsp;<a href='javascript:window.history.back(-1);'>返回</a>&nbsp;重试"));
					out.println("</html>");
					out.close();
					return;
				}
				smsbean.setSendUID(strPersonNo);
				smsbean.setReceiveUID(strPersonNo);

				String strID = ds.toString((String)request.getParameter("txt_rcxh"));
				String strReceiver = ds.toString((String)request.getParameter("txt_receiver"));
				String strTitle = ds.toGBK(ds.toString((String)request.getParameter("txt_title")));
				String strContent = ds.toGBK(ds.toString((String)request.getParameter("txt_content")));
				String strIP = ds.toGBK(ds.toString((String)request.getParameter("txt_ip")));
				String t = ds.toGBK(ds.toString((String)request.getParameter("txt_paixu")));
				String go = "";

	strTitle = strTitle.replaceAll("<","&lt;");
	strTitle = strTitle.replaceAll(">","&gt;");
	strContent = strContent.replaceAll("<","&lt;");
	strContent = strContent.replaceAll(">","&gt;");

				if(strEdit.equals("1"))//删除已收到的短消息
				{
					errcode=smsbean.delSMS(strID);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("2"))//清空已收到的短消息
				{
					errcode=smsbean.clrSMS_Receive(true);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("3"))//增加短消息
				{
					Hashtable hashs = new Hashtable();
					hashs.put("sender",strPersonNo);
					hashs.put("receiver",strReceiver);
					hashs.put("title",strTitle);
					hashs.put("content",strContent);
					hashs.put("ip",strIP);
					errcode=smsbean.addSMS(hashs);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
				}
				if(strEdit.equals("4"))//修改短消息
				{
					Hashtable hashs = new Hashtable();
					hashs.put("id",strID);
					hashs.put("title",strTitle);
					hashs.put("content",strContent);
					hashs.put("ip",strIP);
					errcode=smsbean.modSMS(hashs);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
				}
				if(strEdit.equals("7"))//修改短消息为已读
				{
					Hashtable hashs = new Hashtable();
					hashs.put("id",strID);
					hashs.put("isread","1");
					errcode=smsbean.modSMSRead(hashs);		
					go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("5"))//真删除短消息
				{
					errcode=smsbean.delSMS(strID);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("6"))//假删除短消息
				{
					errcode=smsbean.delSMS(strID,true);	
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;	
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;				
				}
				if(strEdit.equals("8"))//删除已发送的短消息
				{
					errcode=smsbean.delSMS(strID);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("81"))//删除已发送的短消息
				{
					errcode=smsbean.delSMS(strID,true);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("9"))//清空已发送的短消息
				{
					errcode=smsbean.clrSMS_Send(true);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				if(strEdit.equals("91"))//清空已发送的短消息
				{
					errcode=smsbean.clrSMS_Send(false);
					go = "oa/person/person.jsp?txt_type=5&txt_edit=2&errcode="+errcode;
					if(t.equals("1"))go = "oa/person/person.jsp?txt_type=5&txt_edit=1&errcode="+errcode;
				}
				response.sendRedirect(go);
			}


		}catch (Exception e){System.out.println("PerServlet处理时出错;错误为:"+e);}
		finally{
			if(smsbean!=null) smsbean.closeConn();
			if(pGroupBean!=null) pGroupBean.closeConn();
			if(tbean!=null) tbean.closeConn();
			if(dabean!=null) dabean.closeConn();
		}
	}


	public void doPost(HttpServletRequest request ,HttpServletResponse response)throws IOException, ServletException
	{
		doGet(request,response);
	}
}

⌨️ 快捷键说明

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