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

📄 aphm003servlet.java

📁 HW-中国移动企业信息机,请查看
💻 JAVA
字号:
package com.sxit.phonemanager;

import com.sxit.common.*;
import com.sxit.operator.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.util.*;
import java.sql.*;
import java.io.*;

/**
 * <p>类名: APHM003Servlet</p>
 * <p>功能: 编辑品牌</p>
 * <p>公司: 深讯信科</p>
 * <p>版本: 1.0</p>
 * @程序 sxit
 * @日期 2005-03-22
 * @修改纪录
 */

public class APHM003Servlet extends ServletAdminBase{
     public APHM003Servlet(){
          super();
          operationRight = "APHM0,4";
     }
     public String perform(HttpServletRequest request, HttpServletResponse response) throws Exception{

          String nextPage="";
          Connection con=null;

          Tphmbrand tphmbrand=null;

          Topmuser myMember=(Topmuser)request.getSession().getAttribute("_currentUser");
          try{

               con=ConnPoolHandler.getConnection();
               String save=request.getParameter("save");
               long brandid=0;
               if(request.getParameter("brandid")!=null&&!request.getParameter("brandid").equals("")){
                    brandid=Long.parseLong(request.getParameter("brandid"));
               }

               tphmbrand=new Tphmbrand();
               tphmbrand.create(con,brandid);
               if(save!=null && save.equals("save")){
                    String brandname=request.getParameter("brandname");
                    tphmbrand.setBrandname(brandname);

                    tphmbrand.update(con);

                    request.setAttribute("messageID","编辑品牌成功");
                    request.setAttribute("returnPage","../aphm/aphm001");
                    nextPage="/aphm/aphmmessage.jsp";
                    writeLog("APHM",LogManager.LOGTYPE_APP,myMember.getStaffid(),"编辑品牌成功");
               }else{
             //需要判断数据属主
                    request.setAttribute("tphmbrand",tphmbrand);
                    nextPage ="/aphm/aphm003.jsp";
               }

          }
          catch (SQLException e){
               System.out.println(e);
               request.setAttribute("messageID","编辑品牌数据错");
               request.setAttribute("returnPage","../aphm/aphm001");
               nextPage="/aphm/aphmmessage.jsp";
               writeLog("APHM",LogManager.LOGTYPE_APP,myMember.getStaffid(),"编辑品牌数据错");
          }
          catch (Exception e){
               System.out.println(e);
               request.setAttribute("messageID","编辑品牌系统错");
               request.setAttribute("returnPage","../aphm/aphm001");
               nextPage="/aphm/aphmmessage.jsp";
               writeLog("APHM",LogManager.LOGTYPE_APP,myMember.getStaffid(),"编辑品牌系统错");
          }
          finally{
               ConnPoolHandler.closeConnection(con);
          }
          javax.servlet.RequestDispatcher rd =getServletContext().getRequestDispatcher(nextPage);
          rd.forward(request,response);
          return nextPage;
     }
}

⌨️ 快捷键说明

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