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

📄 insertpurview.java

📁 电信的网厅的整站代码
💻 JAVA
字号:
package com.doone.fj1w.fjmgr.sysmgr;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.doone.data.DacClient;
import com.doone.uurm.Sys_Purview;

/**
 * Created by IntelliJ IDEA. User: lizhx Date: 2005-7-18 Time: 8:57:16
 * Email:lizx@doone.com.cn
 */
public class InsertPurview extends HttpServlet {
    static final private String CONTENT_TYPE = "text/html; charset=GBK";

    public void init() throws ServletException {

    }

    public void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws ServletException, IOException {
        httpRequest.setCharacterEncoding("GBK");
        httpResponse.setContentType(CONTENT_TYPE);
        PrintWriter out = httpResponse.getWriter();
        try {
            String sName = httpRequest.getParameter("NAME").trim();
            String sPurviewCode = httpRequest.getParameter("PURVIEWCODE").trim();
            String sPurviewMode = httpRequest.getParameter("PURVIEWMODE").trim();
            String sPurviewOper = httpRequest.getParameter("PURVIEWOPER").trim();
            String sUpPurviewId = httpRequest.getParameter("UPPURVIEWID").trim();
             String sDescribe = httpRequest.getParameter("DESCRIBE").trim();
            String sState = httpRequest.getParameter("STATE").trim();
            String sUnInherit = httpRequest.getParameter("UNINHERIT");
            String sATTCHMENT = httpRequest.getParameter("ATTCHMENT");
            
            if (sUnInherit == null) sUnInherit = "N";

            sName = Util.Replace(sName);
            // createtime = Replace(createtime);
            sPurviewCode = Util.Replace(sPurviewCode);
            sPurviewMode = Util.Replace(sPurviewMode);
            sPurviewOper = Util.Replace(sPurviewOper);
            sUpPurviewId = Util.Replace(sUpPurviewId);
            sDescribe = Util.Replace(sDescribe);
            sState = Util.Replace(sState);
        	//Sys_Purview oSys_Purview=Sys_Purview.getPurviewByID(new DacClient(),Long.parseLong(sPurviewId));
            Sys_Purview oSys_Purview = Sys_Purview.newPurview(new DacClient());
            long sPurviewid= oSys_Purview.getPurviewId();
            Date d_createtime = new Date();
            oSys_Purview.setCreateTime(d_createtime);
            oSys_Purview.setName(sName);
            oSys_Purview.setPurviewCode(sPurviewCode);
            oSys_Purview.setPurviewMode(sPurviewMode);
            oSys_Purview.setPurviewOper(sPurviewOper);
            oSys_Purview.setUpPurviewId(Long.parseLong(sUpPurviewId));
            oSys_Purview.setDescribe(sDescribe);
            oSys_Purview.setOrderNo(1);
            oSys_Purview.setState(sState);
            oSys_Purview.setUnInherit(sUnInherit);
            oSys_Purview.save();
            if (sATTCHMENT!=null&&sATTCHMENT.length()!=0){
            out.write("<script language=javascript>window.location.href='"
                + httpRequest.getContextPath() + "/view/sysmgr/upImg_submit.jsp?PURVIEWID="
                + sPurviewid + "&ATTCHMENT="+sATTCHMENT+"';</script>");//上传模块图片
            }else{
            out.write("<script language=javascript>window.location.href='"
                      + httpRequest.getContextPath() + "/view/sysmgr/OperSuccess.jsp?id="
                      + sUpPurviewId + "';</script>");}
        } catch (RuntimeException e) {
            out.write("<script language=javascript>window.location.href='"
                      + httpRequest.getContextPath() + "/view/sysmgr/OperFailure.jsp?error="
                      + Util.Replace(e.getMessage()) + "';</script>");
        } catch (Exception e) {
            out.write("<script language=javascript>window.location.href='"
                      + httpRequest.getContextPath() + "/view/sysmgr/OperFailure.jsp';</script>");
        }
    }

    public void doPost(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws ServletException, IOException {
        doGet(httpRequest, httpResponse);

    }

    // Clean up resources
    public void destroy() {
    }
}

⌨️ 快捷键说明

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