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

📄 transactionhistory.jsp

📁 Oracle的J2EE Sample
💻 JSP
字号:
<?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?>
<%--
 * @author  Elangovan
 * @version 1.0
 *
 * Development Environment       : Oracle9i JDeveloper
 * 
 * Name of the File              : TransactionHistory.jsp
 *
 * Creation/Modification History :
 *
 *    Elangovan     26-Apr-2002      Created
 *
 * Overview of Application       :
 *
 *   This page displays the all successful transactions done by the user.
 *
--%>

<%@page language="java" %>
<%@ page session="true" %>
<%@ page contentType="text/vnd.oracle.mobilexml; charset=UTF-8" %>

<%@page import="java.util.Collection" %>
<%@page import="java.util.HashMap" %>
<%@page import="java.util.Iterator" %>
<%@page import="oracle.otnsamples.ibfbs.usermanagement.ejb.AccountInfo" %>
<%@page import="oracle.otnsamples.ibfbs.trademanagement.ejb.TradeDetailsInfo" %>
<%@page import="oracle.otnsamples.ibfbs.trademanagement.helper.DateFormatter" %>

<!DOCTYPE SimpleResult PUBLIC "-//ORACLE//DTD SimpleResult 1.1//EN" 
                "http://xmlns.oracle.com/ias/dtds/SimpleResult_1_1_0.dtd">


<% 
    // Get portfolio info
    HashMap hm = (HashMap) session.getAttribute("MOBILE-TRANS.RESPONSE");
    Collection retCollection = (Collection)hm.get("TRADEDETAILSINFO");
    
    Iterator retIter = retCollection.iterator();
        
    String hasPrev = "false";
    String hasNext = "false";
        
    Collection tdCollection = null;
        
    if (retIter.hasNext()) {
      hasPrev = (String)retIter.next();
      hasNext = (String)retIter.next();
        
      tdCollection = (Collection)retIter.next();
    }  

    // Record Number of the first record in the set displayed
    String recordNum = request.getParameter("RECORDNUM"); 
    
    // Get the Account information of the logged in user
    AccountInfo acInfo = (AccountInfo)hm.get("ACCOUNTINFO"); 
    
    // Get the lines per page
    int linesPerPage = acInfo.getLinesPerPage().intValue(); 
    
    if (recordNum == null) recordNum = "1";
%>


<SimpleResult>

  <SimpleContainer>

    <SimpleText>     
      <SimpleTextItem>Transaction History</SimpleTextItem>
    </SimpleText>  
    <SimpleBreak/>

  <SimpleTable>
    <SimpleTableHeader>
      <SimpleCol>DATE</SimpleCol>
      <SimpleCol>SYMBOL</SimpleCol>     
      <SimpleCol>ACTION</SimpleCol>
      <SimpleCol>PRICE</SimpleCol>
      <SimpleCol>QTY</SimpleCol>
    </SimpleTableHeader>     
    
    <SimpleTableBody>  
      <% 
         Iterator tdIter = tdCollection.iterator();
         int rowCount = 0;

         // Iterate and display transaction summary
         while (tdIter.hasNext()) {
           TradeDetailsInfo tdif = (TradeDetailsInfo)tdIter.next(); 
           rowCount++;
     %>
      <SimpleRow>
        <SimpleCol><%= DateFormatter.getStringFromDate(tdif.getTradeDate(), "dd-MMM-yyyy") %></SimpleCol>
        <SimpleCol><%=tdif.getSymbol()%></SimpleCol>      
        <SimpleCol><%=tdif.getAction()%></SimpleCol>
        <SimpleCol><%=tdif.getPrice()%></SimpleCol>
        <SimpleCol><%=tdif.getQuantity()%></SimpleCol>
      </SimpleRow>  
                   
     <% } %>

       </SimpleTableBody>
            
      </SimpleTable>
        <%
          // No transactions
          if (rowCount == 0) {
        %>
             <SimpleText>
               <SimpleTextItem>No Transactions.</SimpleTextItem>
             </SimpleText>
        <%  }   %>
      
     <SimpleMenu>
            
         <SimpleTitle>Go to</SimpleTitle>
         <%  
           // If the page required iteration, set a form with the RECORDNUM to the index of the 
           // first record and the EVENTNAME, display the Prev and Next buttons if required
           if (hasPrev.equals("true") || hasNext.equals("true")) { 
           
           // If there are some more previous records, display the prev button
           if (hasPrev.equals("true")) {
             int prev = Integer.parseInt(recordNum) - linesPerPage;
         %>
             <SimpleMenuItem target="controllerservlet?EVENTNAME=MOBILE-TRANS&amp;RECORDNUM=<%=prev%>">Prev</SimpleMenuItem>
         <%
           } 
           // If there are some more next records, display the next button
           if (hasNext.equals("true")) {
             int next = Integer.parseInt(recordNum) + linesPerPage;
         %>
             <SimpleMenuItem target="controllerservlet?EVENTNAME=MOBILE-TRANS&amp;RECORDNUM=<%=next%>">Next</SimpleMenuItem>
         <%
           } 
           
          } 
         %>    
         
         <SimpleMenuItem target="controllerservlet?EVENTNAME=MOBILE-PORTFOLIO">Portfolio</SimpleMenuItem>
         <SimpleMenuItem target="controllerservlet?EVENTNAME=MOBILE-BUY">Buy</SimpleMenuItem>
         <SimpleMenuItem target="controllerservlet?EVENTNAME=MOBILE-SELL">Sell</SimpleMenuItem>         
  
     </SimpleMenu>
      
      
    </SimpleContainer>
       
</SimpleResult>

⌨️ 快捷键说明

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