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

📄 callupdate.java

📁 企业办公自动化管理系统
💻 JAVA
字号:
package com.zh.util;
import java.sql.*;
import java.io.*;
import com.zh.conpool.*;
import com.bwm.string.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class callupdate{
	private String id;
	private String file;
	private String create;
	private String dattime;
	private String test;
	private String result;
	private String remark;
	private String modify;
	private String sql;
	private String callid;
	Condata con=new Condata();
	public void Init(javax.servlet.http.HttpServletRequest req,javax.servlet.http.HttpServletResponse res,javax.servlet.http.HttpSession session)throws ServletException,IOException,SQLException{
		PrintWriter out=res.getWriter();
		Str str=new Str();
		id=req.getParameter("id");
		file=req.getParameter("file");
		test=str.toChinese(req.getParameter("test"));
		dattime=req.getParameter("dattime");
		result=str.toChinese(req.getParameter("result"));
		remark=str.toChinese(req.getParameter("remark"));
		create=req.getParameter("create");
		modify=req.getParameter("modify");
		callid=req.getParameter("callid");
		out.println(modify);		
		try{
			con.getConnection();
		}catch(Exception e){
			out.println("数据库连接出现错误");
		}
		try{
		if(create!=null||!create.equals("")){
			if(create.equals("create")){
				sql="insert into tb_call(Dattime,ClientId,CallTest,CallResult,CallRemark,Operation)values('"+dattime+"','"+id+"','"+test+"','"+result+"','"+remark+"','"+session.getAttribute("username")+"')";
				
				
				int temp=con.executeUpdate(sql);
				if(temp>0){
					out.println("添加数据成功");
					out.println("<script language='javascript'>parent.bottom.location.reload();</script>");
					res.sendRedirect("Call_Index.jsp?id="+id+"");
				}else{
					out.println("添加数据失败");
				}
				
			}
		}
		}catch(Exception e){
			e.getMessage();
		}
		try{		
		if(modify!=null||!modify.equals("")){
			if(modify.equals("modify")){
				sql="delete tb_call where Id='"+callid+"'";
				int tem=con.executeUpdate(sql);
				if(tem>0){
					out.println("数据库更新成功");
					res.sendRedirect("Call_Index.jsp?id="+id+"");
				}else{
					out.println("数据更新失败");
				}
			}
		}
	}catch(Exception e){
		e.getMessage();
	}	
	try{
			con.close();
			con=null;
		}catch(Exception e){
			e.getMessage();
		}
	}
	public void close(){
	
	}

}

⌨️ 快捷键说明

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