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

📄 _device_0list__jsp.java

📁 生产管理系统
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * JSP generated by Resin-3.1.0 (built Fri, 22 Dec 2006 07:00:35 PST)
 */

package _jsp._device;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.io.*;
import device.*;
import java.text.*;
import java.util.Date;
import java.util.*;
import java.math.*;
import java.sql.*;
import java.net.*;
import java.lang.*;
import devicecomm.*;

public class _device_0list__jsp extends com.caucho.jsp.JavaPage
{
  private final java.util.HashMap<String,java.lang.reflect.Method> _jsp_functionMap = new java.util.HashMap<String,java.lang.reflect.Method>();
  private boolean _caucho_isDead;

  

  	//\u5224\u65ad\u662f\u5426\u4e3a\u7ecf\u7406

  	public boolean isManager(String suid){

  	 try{

  		 // \u5b9a\u4e49\u7528\u6237\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u7528\u6237\u540d\u4e3asuid

  		 User o_user = new User();

  		 o_user.setUserId(suid);

  		 // \u5982\u679c\u5b58\u5728\u6b64\u7528\u6237\uff0c\u5219\u5224\u65ad\u7528\u6237\u7c7b\u578b

  		 if(o_user.getUser()){

  			 // \u5982\u679c\u7528\u6237\u7c7b\u578b\u4e3a1\uff08\u90e8\u95e8\u7ecf\u7406\uff09\uff0c\u8fd4\u56detrue

  			 if(o_user.getUserType()==1)

  				 return true;

  		 }

  	  }catch(Exception e)

  			{e.printStackTrace();}

  	  return false;

  	}

  	//\u5224\u65ad\u662f\u5426\u4e3a\u7ba1\u7406\u5458

  	public boolean isAdmin(String suid)

  	{

  	 try{

  		 User o_user = new User();

  		 o_user.setUserId(suid);

  		 if(o_user.getUser())

  		 {

  			 if(o_user.getUserType()==2)

  				 return true;

  		 }

  	  }catch(Exception e)

  			{e.printStackTrace();}

  	  return false;

  	}



  

  // \u4e3a\u5206\u9875\u5b9a\u4e49\u53d8\u91cf

  	int i=0,pageno=0,totalPage=0;

  	Vector v_dev;

  	// cMaxPerPage-\u6bcf\u9875\u663e\u793a\u7684\u8bb0\u5f55\u4e2a\u6570

  	int iDevCnt,ShowCount,lPage,nPage,cMaxPerPage=10;

  	String strPage;

  	// currentpage - \u5f53\u524d\u9875\uff1biPageStop - \u5faa\u73af\u505c\u6b62\u5f97\u8bb0\u5f55\u4e2a\u6570\uff1biMaxPage-\u6700\u5927\u9875\u6570

  	int currentpage=1,iNext=0,iFinish=0,iMaxPage=0,iPageStop;


  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    javax.servlet.http.HttpSession session = request.getSession(true);
    com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication();
    javax.servlet.ServletContext application = _jsp_application;
    com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false);
    javax.servlet.jsp.JspWriter out = pageContext.getOut();
    final javax.el.ELContext _jsp_env = pageContext.getELContext();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    response.setContentType("text/html;charset=gb2312");
    request.setCharacterEncoding("GB2312");
    try {
      out.write(_jsp_string0, 0, _jsp_string0.length);
      
	String userid,passwd;
	// \u4ecesession\u4e2d\u53d6\u7528\u6237\u540d\u548c\u5bc6\u7801
	userid = (String)session.getValue("user_id");
	passwd = (String)session.getValue("passwd");
	
	// \u5982\u679cuserid\u6216\u8005passwd\u4e3a\u7a7a\uff0c\u5219\u91cd\u65b0\u767b\u5f55
	try{
		if(userid==null || passwd==null)
			response.sendRedirect("Login.htm");
		else{
			// \u5b9a\u4e49\u7528\u6237\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u5176\u7528\u6237\u540d\u548c\u5bc6\u7801
			User o_user = new User();
			o_user.setUserId(userid);
			o_user.setPassWord(passwd);
			// \u5224\u65ad\u662f\u5426\u5b58\u5728\u6b64\u7528\u6237\u4fe1\u606f\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u6b64\u7528\u6237\u5219\u8fd4\u56de\u767b\u5f55\u9875\u9762
			if(!o_user.getUser())
				response.sendRedirect("Login.htm");
		}
	}catch(Exception e){
		e.printStackTrace();
		out.println("<br><br><br><center>\u7528\u6237\u4fe1\u606f\u67e5\u627e\u5931\u8d25\uff01 </center>");
	}

      out.write(_jsp_string1, 0, _jsp_string1.length);
      
// \u5224\u65ad\u6b64\u7528\u6237\u7c7b\u578b\u662f\u5426\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\uff0c\u5982\u679c\u4e0d\u662f\u5219\u4e0d\u80fd\u67e5\u770b\u6b64\u9875\u9762\u4fe1\u606f
// \u8fd9\u91cc\u4f7f\u7528head.jsp\u6587\u4ef6\u4e2d\u7684\u65b9\u6cd5isAdmin()
if(isAdmin((String)session.getValue("user_id")))
{

      out.write(_jsp_string2, 0, _jsp_string2.length);
      
try{
	// \u65b0\u5efa\u8bbe\u5907\u5bf9\u8c61\uff0c\u53d6\u591a\u4e2a\u8bbe\u5907\u4fe1\u606f
	Device o_dev = new Device();
	v_dev = o_dev.getMoreDevice();
	iDevCnt = v_dev.size();	// \u8bbe\u5907\u4e2a\u6570

	if(iDevCnt==0) 
		out.println("<tr align='center'><td colspan=9><font color=red>\u76ee\u524d\u8fd8\u6ca1\u6709\u8bbe\u5907</font></td></tr>");
	else
	{
		// \u4ece\u4f20\u9012\u7684\u53c2\u6570\u4e2d\u53d6\u7684\u9875\u6570\u503c
		strPage = request.getParameter("page");
		// \u5982\u679c\u9875\u6570\u503c\u4e3anull\uff0c\u5219\u8bbe\u7f6e\u5f53\u524d\u9875\u4e3a1\uff0c\u5426\u5219\u4e3a\u9875\u6570\u503c
		// \u628a\u5b57\u7b26\u578b\u53d8\u91cf\u8f6c\u4e3a\u6570\u5b57\u578b\u4f7f\u7528\uff1aInteger.parseInt(strParameter)\u65b9\u6cd5\uff0c\u540c\u6837\u6709:Long.parseLong(strParameter)
		if(strPage == null)
			currentpage = 1;
		else
			currentpage = Integer.parseInt(strPage);
		// \u5982\u679c\u5f53\u524d\u9875\u5c0f\u4e8e1\uff0c\u5219\u5f53\u524d\u9875\u8bbe\u4e3a1
		if(currentpage<1)
			currentpage = 1;
		// \u6700\u5927\u9875\u6570=\u8bb0\u5f55\u4e2a\u6570/\u6bcf\u9875\u8bb0\u5f55\u6700\u5927\u503c
		if ((iDevCnt%cMaxPerPage)==0)
	      iMaxPage = iDevCnt / cMaxPerPage;
	    else
	      iMaxPage = iDevCnt / cMaxPerPage + 1;		
		// \u5206\u60c5\u51b5\u663e\u793a\u8bbe\u5907\u8bb0\u5f55\u4fe1\u606f
        if (currentpage==1){
			// \u5f53\u8bb0\u5f55\u4e2a\u6570\u5927\u4e8e\u6bcf\u9875\u6700\u5927\u8bb0\u5f55\u6570\u65f6\uff0c\u6bcf\u9875\u5e94\u8be5\u663e\u793a\u6700\u5927\u8bb0\u5f55\u6570
			if(iDevCnt>cMaxPerPage)
				iPageStop = cMaxPerPage;
			// \u5982\u679c\u8bb0\u5f55\u4e2a\u6570\u5c0f\u4e8e\u6bcf\u9875\u6700\u5927\u8bb0\u5f55\u6570\u65f6\uff0c\u6bcf\u9875\u5e94\u8be5\u663e\u793a\u8bb0\u5f55\u4e2a\u6570
			else
				iPageStop = iDevCnt;
			// \u663e\u793a\u8bbe\u5907\u8bb0\u5f55\u4fe1\u606f
			for(i=0;i<iPageStop;i++){ 
			  o_dev =(Device)v_dev.elementAt(i);

      out.write(_jsp_string3, 0, _jsp_string3.length);
      out.print((o_dev.getDevCate()));
      out.write(_jsp_string4, 0, _jsp_string4.length);
      out.print((o_dev.getDevId()));
      out.write(_jsp_string5, 0, _jsp_string5.length);
      out.print((o_dev.getDevId()));
      out.write(_jsp_string6, 0, _jsp_string6.length);
      out.print((o_dev.getDevName()));
      out.write(_jsp_string7, 0, _jsp_string7.length);
      out.print((o_dev.getDevType()));
      out.write(_jsp_string8, 0, _jsp_string8.length);
      out.print((o_dev.getDevNumber()));
      out.write(_jsp_string8, 0, _jsp_string8.length);
      out.print((o_dev.getPrice()));
      out.write(_jsp_string8, 0, _jsp_string8.length);
      out.print((o_dev.getPrice()*o_dev.getDevNumber()));
      out.write(_jsp_string9, 0, _jsp_string9.length);
      out.print((o_dev.getDevId()));
      out.write(_jsp_string10, 0, _jsp_string10.length);
      out.print((o_dev.getDevId()));
      out.write(_jsp_string11, 0, _jsp_string11.length);
      
			}  //end for
		}  // end if
		else
		{
			// \u5f97\u5230\u5f00\u59cb\u663e\u793a\u7684\u8bb0\u5f55\u503ciNext\uff0c\u4ee5\u53ca\u5269\u4f59\u8bb0\u5f55\u4e2a\u6570iFinish
		   iNext = (currentpage-1)*cMaxPerPage;
		   iFinish = iDevCnt - iNext ;
		   // \u5982\u679c\u5269\u4f59\u8bb0\u5f55\u4e2a\u6570\u5927\u4e8e\u6bcf\u9875\u6700\u5927\u8bb0\u5f55\u6570\uff0c\u6bcf\u9875\u5e94\u8be5\u663e\u793a\u6700\u5927\u8bb0\u5f55\u6570\uff0c\u5426\u5219\u663e\u793a\u8bb0\u5f55\u4e2a\u6570
		   if(iFinish>cMaxPerPage)
			   iPageStop = cMaxPerPage;
		   else
			   iPageStop = iFinish;
	       if (iNext<iDevCnt){
			   for(int j=iNext;j<iNext+iPageStop;j++){ 
				o_dev =(Device)v_dev.elementAt(j);

      out.write(_jsp_string3, 0, _jsp_string3.length);
      out.print((o_dev.getDevCate()));
      out.write(_jsp_string4, 0, _jsp_string4.length);
      out.print((o_dev.getDevId()));

⌨️ 快捷键说明

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