changearticle_do.jsp~34~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:4k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*,java.sql.*,java.lang.*" buffer="64kb" %>
- <%request.setCharacterEncoding("gbk"); %>
- <html>
- <head>
- <title>
- newarticle_do
- </title>
- </head>
- <jsp:useBean id="sql" scope="page" class="control.sqlcontrol" />
- <jsp:useBean id="file" scope="page" class="control.Filecontrol.Reader_Writer" />
- <body bgcolor="#ffffff">
- <%try{
- sql.getSQL2005conn("dbconfig.xml");
- String title = request.getParameter("title");
- String users = request.getParameter("users");
- String time = request.getParameter("time");
- String url = request.getParameter("article_contexturl");
- String type = request.getParameter("type");
- String depar = request.getParameter("depar");
- String id = request.getParameter("id");
- String path =application.getRealPath("article")+"\"+url;
- String contant = request.getParameter("context");
- if(type.equals("2")){
- String edep = "";
- String time2 = request.getParameter("time2");
- String time3 = request.getParameter("time3");
- Tool tl = new Tool();
- String time4 = tl.getTime1(time2,time3);
- //out.print(tl.getTime2(time4));
- int jj = Integer.parseInt(request.getParameter("jj"));
- if(jj!=0){
- String[] dep = new String[jj];
- int cc = 0;
- int ccc = 0;
- for(int ii = 0; ii < jj; ii++){
- if(request.getParameter("edep"+ii)==null){
- //out.print("edep"+ii +" is null<br />");
- cc++;
- }else{
- dep[ii] = request.getParameter("edep"+ii);
- //out.print(dep[ii]+"; ");
- edep += dep[ii]+";";
- ccc++;
- }
- }
- if(cc==dep.length){
- edep = "all";//全部都没有选择,默认为全部部门都可以编辑
- }
- if(ccc==dep.length){
- edep = "all";//全部都有选择
- }
- }
- if(title.equals(null)||title.equals("")||title==null){
- out.print("文章标题不能为空");
- }else{
- file.WriteFile(path,contant);
- StringBuffer getselect = new StringBuffer();
- getselect.append("update article set ");
- getselect.append("users='"+users+"',");
- getselect.append("depar='"+depar+"',");
- getselect.append("title='"+title+"',");
- getselect.append("date='"+time+"',");
- getselect.append("context='"+url+"',");
- getselect.append("type='"+type+"',edit='"+edep+"',timeout='"+time4+"' where id="+id+";");
- String select = getselect.toString();
- //out.print(select);
- sql.MouChoose(select);
- sql.closeDB();
- String ud = (String)session.getAttribute("UD");
- String udid = (String)session.getAttribute("UDID");
- String un = (String)session.getAttribute("UN");
- String uid = (String)session.getAttribute("UID");
- String pp = (String)session.getAttribute("POPE");
- String login = (String)session.getAttribute("LOGIN");
- DBConn dbc = new DBConn();
- String rsql = "insert into records (userid,record,time,opertype) values('"+uid+"','"+id+"','"+tl.getTime()+"','多部门编辑文章')";
- out.print(rsql);
- }
- }else{
- if(title.equals(null)||title.equals("")||title==null){
- out.print("文章标题不能为空");
- }else{
- file.WriteFile(path,contant);
- StringBuffer getselect = new StringBuffer();
- getselect.append("update article set ");
- getselect.append("users='"+users+"',");
- getselect.append("depar='"+depar+"',");
- getselect.append("title='"+title+"',");
- getselect.append("date='"+time+"',");
- getselect.append("context='"+url+"',");
- getselect.append("type='"+type+"' where id="+id+";");
- String select = getselect.toString();
- //out.print(select);
- sql.MouChoose(select);
- sql.closeDB();
- }
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- <div align="center">
- <h3>录入成功,请进行其他操作!</h3><hr><a href="changearticlelist.jsp">继续修改</a>
- </div>
- </body>
- </html>