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

📄 usertranscatins.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ page
    language="java"
    contentType="text/html; charset=GBK"
    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.text.*"
%>
<%
  session=request.getSession();
  userStruct user=(userStruct)session.getAttribute("user");

if(user==null){
response.sendRedirect("../../login.html");
}
else
  //if(!((user.getAccess().intValue()==9)||(user.getAccess().intValue()==10))){
if(!(((user.getAccess().intValue()==9)||(user.getAccess().intValue()==10)||(user.getAccess().intValue()==6)))){

      response.sendRedirect("../../error/access.html");
    }else{
String transcatid=request.getParameter("id");
if(transcatid==null){
  transcatid="";
}

String flag=request.getParameter("flag");
if(flag==null || flag.equals("")){
  flag="0"; //表示手工填入方式
}

%>



<jsp:useBean id="itemtableget" scope="page" class="imis.itemtableget" />
<jsp:useBean id="transcatget" scope="page" class="imis.transcatget" />
<jsp:useBean id="user1get" scope="page" class="imis.user1get" />
<jsp:useBean id="usertranscatget" scope="page" class="imis.usertranscatget" />
<jsp:useBean id="officeunitget" scope="page" class="imis.officeunitget" />
  <HTML><HEAD>
  <TITLE>MSA Office</TITLE>
  <link rel="stylesheet" href="../../css/msa.css" type="text/css">
  <script language="JavaScript" src="../../public/js/table_display.js"></script>
  <script language="JavaScript" src="../../public/js/all_checked.js"></script>
  <script language="javascript" src="../../public/util/openselect.js"></script>
  <script language="javascript" src="../../public/js/getdate.js"></script>


  <script>
  function frm1_submit(){
     if(frm1.flag.value=="0"){
        if(frm1.user_name.value==""){
                alert("请填写人员名称!");
                frm1.user_name.focus();
        }else if(frm1.processname.value==""){
                alert("请填写人员单位!");
                frm1.processname.focus();
        }else{
                frm1.action="usertranscatInsed.jsp?id=<%=transcatid%>";
                frm1.submit();
        }
     }else{
        if(frm1.unitid.value==""){
             alert("请选择单位名称!");
             frm1.unitid.focus();
        }else if(frm1.user_id.value==""){
             alert("请填写人员单位!");
             frm1.user_id.focus();
        }else{
             frm1.action="usertranscatInsed.jsp?id=<%=transcatid%>";
             frm1.submit();
        }
     }

  }

  function frm2_submit(){
     var re=confirm("您确定要删除吗?");
     if(re){
       frm2.submit();
     }
  }
</script>

  </HEAD>
  <BODY class="bg" topMargin=0 leftmargin="0" marginwidth="0" marginheight="0">
  <DIV align=center>
      <TABLE class=outter cellSpacing=0 cellPadding=0 width=500 border=0>
        <TR>
          <TD><IMG height=4 src="../../MacOS/lefttop.gif" width=6></TD>
          <TD background=../../MacOS/top.gif colSpan=3><IMG height=4
        src="../MacOS/top.gif" width=1></TD>
          <TD><IMG height=4 src="../../MacOS/righttop.gif"></TD>
        </TR>
        <TR>
          <TD vAlign=top background=../../MacOS/lwing.gif rowSpan=3><IMG height=18
        src="../../MacOS/left.gif" width=6></TD>
          <TD vAlign=top background=../../MacOS/titlebg.gif width="16"> <DIV><img src="../../MacOS/logo.gif" width="16" height="16" border="0" alt="返回MSA_Office首页"></a></DIV></TD>
          <TD vAlign=top noWrap align=center width="100%"
      background=../../MacOS/titlebg.gif><SPAN
        style="BACKGROUND-COLOR: #cecece"><FONT class=strong> MSA - OFFICE </font></SPAN></TD>
          <TD><IMG height=18 src="../../MacOS/right_b2.gif" width=18 border="0" alt="关闭窗口"></TD>
          <TD vAlign=top background=../../MacOS/rwing.gif rowSpan=3><IMG height=18
        src="../../MacOS/right.gif" width=7></TD>
        </TR>
        <TR>
          <TD background=../../MacOS/hr.gif colSpan=3><IMG height=2
        src="../../MacOS/hr.gif" width=1></TD>
        </TR>
        <TR>
          <TD colSpan=3 align="center" valign="top"><br> <table width="500" border="1" cellspacing="1" bordercolor="#666666">
              <tr bgcolor="#FAFAFA">
                <td valign="top">
                <table width="500" border="0" cellspacing="0" cellpadding="2">
                <form name="frm1" method="post" action="usertranscatIns.jsp?id=<%=transcatid%>">
                  <tr>
                    <td colspan="3" height="15" bgcolor="#666666"><font color='white' size='2'>合同管理</font></td>
                  </tr>
                  <tr bgcolor="#fafafa">
                    <td colspan="3"><a href="contractdisplay.jsp">合同管理</a>&gt;&gt;
                      增加讨论组参加成员 </td>
                  </tr>
                  <tr bgcolor="#fafafa">
                    <td width="114"> <font class="strong" > 增加方式:</font> </td>
                    <td width="281">
                      <select name="flag" onchange="frm1.submit();">
					  <option value="">请选择人员增加方式</option>
<%
if(flag.trim().equals("0")){
					  %><option value="0" selected>--手写填入--</option><%
}else{
					  %><option value="0">--手写填入--</option><%
}
%>

<%
if(flag.trim().equals("1")){
					  %><option value="1" selected>--选择填入--</option><%
}else{
					  %><option value="1">--选择填入--</option><%
}
%>


                      </select> </td>
                    <td width="93">&nbsp; </td>
                  </tr>
				  <tr bgcolor="#fafafa">
                    <td width="114"> <font class="strong" > 人员单位:</font> </td>
                    <td width="281">
<%
  String unitid=request.getParameter("unitid");
  if(unitid==null){
    unitid="";
  }


if(flag.trim().equals("0")){

  %><input type="hidden" name="unitid" class="file" value=""><input type="text" name="processname" value="" class="file"><%
}else{

  %><select name="unitid" onchange="frm1.submit();"><option value="">请选择人员单位</option><%
  officeunitget.query(pageContext);
  if(officeunitget.getRows()>0){
    for(int i=0;i<officeunitget.getRows();i++){
      officeunitget.next();
      if(officeunitget.getUnitid().trim().equals(unitid)){
        out.print("<option value=\""+officeunitget.getUnitid()+"\" selected>"+"--"+officeunitget.getProcessname()+"--");
      }else{
        out.print("<option value=\""+officeunitget.getUnitid()+"\">"+"--"+officeunitget.getProcessname()+"--");
      }
      out.print("</option>");

    }
  }
  %></select><%
  if( !(unitid.trim().equals("")) ){
     officeunitget.setSqlwhereget("unitid="+unitid);
     officeunitget.query(pageContext);

     %><input type="hidden" name="processname" value="<%=officeunitget.getProcessname()%>" class="file"><%
  }else{
     %><input type="hidden" name="processname" value="" class="file"><%
  }
}
%>

                    </td>
                    <td width="93">&nbsp; </td>
                  </tr>
				  <tr bgcolor="#fafafa">
                    <td width="114"> <font class="strong" > 人员姓名:</font> </td>
                    <td width="281">
<%
if(flag.trim().equals("0")){
  %><input type="hidden" name="user_id" class="file" value=""><input type="text" name="user_name" value="" class="file"><%
}else{
  %><select name="user_id" ><option value="">请选择人员姓名</option>
  <%
  String user_id=request.getParameter("user_id");
  if(user_id==null){
    user_id="";
  }

  if( !(unitid.trim().equals("")) ){
    user1get.setSqlwhereget("unitid="+unitid);
  }else{
    user1get.setSqlwhereget("unitid=-1");
  }
  user1get.query(pageContext);

  if(user1get.getRows()<1){

  }else{
    for(int i=0;i<user1get.getRows();i++){
      user1get.next();
      if(user1get.getUser_id().trim().equals(user_id)){
        out.print("<option value=\""+user1get.getUser_id()+"\" selected>"+"--"+user1get.getUser_name()+"--");
      }else{
        out.print("<option value=\""+user1get.getUser_id()+"\">"+"--"+user1get.getUser_name()+"--");
      }
      out.print("</option>");
    }
  }
   %></select>
<%

}
%>


                      <input type="button" name="Submit" value="增加" class="file" onClick="frm1_submit()">
                      <input name="reset" type="button" class="file" id="reset" value="还原" onclick="window.location.replace('usertranscatIns.jsp?id=<%=transcatid%>');">
                    </td>
                    <td width="93">&nbsp; </td>
                  </tr>

                  <input type="hidden" name="sqlwhereget">
                </form>
              </table>


              <table class=title width="500" border="0" cellspacing="1" cellpadding="2">
                <form name="frm2" method="post" action="usertranscatDel.jsp">
                  <tr bgcolor="#666666">
                    <td height="20" colspan="4"> <font class="strongw">谈判小组列表:</font>
                    </td>
                  </tr>
                  <tr bgcolor="#e0e0e0">

                    <td width="10"></td>
                    <td>编号</td>
                    <td>姓名</td>
                    <td>所在单位</td>
                  </tr>

<%
usertranscatget.setSqlwhereget("id="+transcatid);
usertranscatget.query(pageContext);
if(usertranscatget.getRows()>0){
  while(usertranscatget.next()){
    System.out.println("usertranscat_id="+1);
    %>
                  <tr bgcolor="#e0e0e0">
                    <td width="50" bgcolor="#e0e0e0" align=right><input type="checkbox" name="usertranscat_id" value="<%=usertranscatget.getUsertranscat_id()%>">
                    </td>
                    <td width="50" bgcolor="#e0e0e0"><%=usertranscatget.getUsertranscat_id()%></td>
                    <td width="131" bgcolor="#e0e0e0"><%=usertranscatget.getUser_name()%>
                    </td>
                    <td width="463" bgcolor="#e0e0e0"><%=usertranscatget.getProcessname()%></td>
                  </tr>

    <%
  }
}else{
    %>
  <tr bgcolor="#e0e0e0">
    <td colspan=4 bgcolor="#e0e0e0" align=center>该讨论组暂时无参加人员</font>
    </td>
  </tr>
    <%
}
%>
                  <tr bgcolor="#e0e0e0">

                    <td colspan=4 align=center><input type="hidden" name="transcatid" value="<%=transcatid%>"><input type="button" name="Button2" value="删除" class="file" onclick="frm2_submit();">
                      &nbsp; &nbsp;&nbsp; <input type="reset" name="Button32" value="还原" class="file" ></td>
                  </tr>



                </form>
              </table></td>
              </tr>
            </table>
            <p><img src="../../images/msalogo.gif" width="272" height="50">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="3"><img src="../personal/project/a.gif" width="1" height="1"></td>
              </tr>
              <tr>
                <td background="../../MacOS/hr.gif"><img src="../../MacOS/hr.gif" width="1" height="2"></td>
              </tr>
              <tr>
                <td height="3"><img src="../personal/project/a.gif" width="1" height="1"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td> <div align="right"><a href="../help.htm" target="blank" style="cursor:help" title="使用帮助"><img src="../../MacOS/help.gif" width="16" height="16" border="0">HELP</a></div></td>
              </tr>
            </table></TD>
        </TR>
        <TR>
          <TD><IMG height=7 src="../../MacOS/leftbottom.gif" width=6></TD>
          <TD background="../../MacOS/bottom.gif" colSpan=3><IMG height=7
        src="../../MacOS/bottom.gif" width=1></TD>
          <TD><IMG height=7 src="../../MacOS/rightbottom.gif"
  width=7></TD>
        </TR>
      </TABLE>
      <BR>
      <TABLE cellSpacing=1 cellPadding=2 width="500" border=0>
        <TBODY>
          <TR>

          <TD align=center><FONT class=footer><IMG height=8
        src="../../MacOS/hr_black.gif" width="100%"><BR>
            Orient Super Net NMIE-OFFICE System V1.2
              </FONT></TD>
          </TR>
        </TBODY>
      </TABLE>
  </DIV>
</BODY></HTML>


<%
}
%>

⌨️ 快捷键说明

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