newarticleEdit_do.jsp~51~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:3k
源码类别:
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 url = request.getParameter("article_contexturl");
- String type = request.getParameter("type");
- String depar = request.getParameter("depar");
- String time = request.getParameter("time1");
- 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";//全部都有选择
- }
- }
- //out.print("edep is "+ edep+"<br />");
- if(title==null||title.equals("")||title.equals(null)||title.trim().equals("")){
- out.print("<h3 align="center">标题不能为空!请返回重填!</h3>");
- out.print("还要一个返回链接!");
- }else{
- String path =application.getRealPath("article")+"\"+url;
- String contant = request.getParameter("context");
- file.WriteFile(path,contant);
- StringBuffer getselect = new StringBuffer();
- getselect.append("insert into article(");
- getselect.append("users,");
- getselect.append("depar,");
- getselect.append("title,");
- getselect.append("date,");
- getselect.append("context,");
- getselect.append("type,edit,timeout ) values (");
- getselect.append("'"+users+"','"+depar+"','"+title+"','"+time+"','"+url+"','"+type+"','"+edep+"','"+time4+"');");
- String select = getselect.toString();
- //out.print(select);
- sql.MouChoose(select);
- sql.closeDB();%>
- <div align="center">
- <h3>录入成功,请进行其他操作!</h3><hr><a href="newArticleEdit.jsp">继续录入</a>
- </div>
- <%
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- <script type="text/javascript">
- </script>
- </body>
- </html>