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

📄 index3.jsp

📁 jsp写的一个简单的售药系统(系统需求分析).采用sql2000数据库,通过odbc连接
💻 JSP
字号:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/syxt.jsp" %>
<%

if (request.getParameter("a1")  !=null) {



Driver DriverRecordset0 = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
Connection ConnRecordset0 = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
PreparedStatement StatementRecordset0 = ConnRecordset0.prepareStatement("SELECT dbo.xsdxz.ypbh,ph,sl FROM dbo.xsdxz,dbo.ypms where djh=? and dbo.ypms.ypbh=dbo.xsdxz.ypbh");
StatementRecordset0.setObject(1, request.getParameter("a0"));
ResultSet Recordset0 = StatementRecordset0.executeQuery();
boolean Recordset0_isEmpty = !Recordset0.next();
boolean Recordset0_hasData = !Recordset0_isEmpty;
Object Recordset0_data;
int Recordset0_numRows = 0;

while (Recordset0_hasData) {
Object t1=Recordset0.getObject("ypbh");
Object t2=Recordset0.getObject("ph");
Object t3=Recordset0.getObject("sl");

Driver DriverPrepared1 = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
Connection ConnPrepared1 = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
PreparedStatement Prepared1 = ConnPrepared1.prepareStatement("UPDATE dbo.kc SET sl=sl-"+t3+" WHERE ypbh="+t1+" and ph="+t2);
Prepared1.executeUpdate();

ConnPrepared1.close();

Recordset0_hasData = Recordset0.next();
}
Recordset0.close();
StatementRecordset0.close();
ConnRecordset0.close();

}


String Recordset1__MMColParam = "2";
if (request.getParameter("a0")  !=null) {Recordset1__MMColParam = (String)request.getParameter("a0") ;}
%>
<%
Driver DriverRecordset1 = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT * FROM dbo.xsd,dbo.xsdxz,dbo.ypms WHERE dbo.xsd.djh = ? and dbo.xsd.djh=dbo.xsdxz.djh and dbo.ypms.ypbh=dbo.xsdxz.ypbh;");
StatementRecordset1.setObject(1, Recordset1__MMColParam);
ResultSet Recordset1 = StatementRecordset1.executeQuery();
//boolean Recordset1_isEmpty = !Recordset1.next();
//boolean Recordset1_hasData = !Recordset1_isEmpty;
Object Recordset1_data;
int Recordset1_numRows = 0;
%>
<%
String Recordset2__MMColParam = "2";
if (request.getParameter("a0") !=null) {Recordset2__MMColParam = (String)request.getParameter("a0");}
%>
<%
Driver DriverRecordset2 = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
Connection ConnRecordset2 = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
PreparedStatement StatementRecordset2 = ConnRecordset2.prepareStatement("SELECT * FROM dbo.xsd,dbo.khzl WHERE djh = ? and dbo.khzl.khbh=dbo.xsd.khbh;");
StatementRecordset2.setObject(1, Recordset2__MMColParam);
ResultSet Recordset2 = StatementRecordset2.executeQuery();
boolean Recordset2_isEmpty = !Recordset2.next();
boolean Recordset2_hasData = !Recordset2_isEmpty;
Object Recordset2_data;
int Recordset2_numRows = 0;
%>
<%
String Recordset3__MMColParam = "2";
if (request.getParameter("a0") !=null) {Recordset3__MMColParam = (String)request.getParameter("a0");}
%>
<%
Driver DriverRecordset3 = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
Connection ConnRecordset3 = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
PreparedStatement StatementRecordset3 = ConnRecordset3.prepareStatement("SELECT sum(je) FROM dbo.xsdxz WHERE djh = ?");
StatementRecordset3.setObject(1, Recordset3__MMColParam);
ResultSet Recordset3 = StatementRecordset3.executeQuery();
boolean Recordset3_isEmpty = !Recordset3.next();
boolean Recordset3_hasData = !Recordset3_isEmpty;
Object Recordset3_data = Recordset3.getObject("");
int Recordset3_numRows = 0;
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>销售单</title>
<style type="text/css">
<!--
.STYLE1 {
	font-size: x-large;
	color: #0000FF;
}
.STYLE2 {font-size: small}
-->
</style>
</head>

<body>
<table width="736" border="0">
<tr><td align="center">
    <span class="STYLE1">广州粤华药业有限公司销售单</span></td>
</tr>
<tr>
  <td align="center">
电话:020-87024208&nbsp;&nbsp;邮编:510650&nbsp;&nbsp; 地址:广州市天河元岗</td>
</tr>
</table>
	
	  <%
	  if(request.getParameter("a0") !=null){
	  
	  String input="";
	  String outshu="";
	  if(Recordset3_data!=null){  
	  input=Recordset3_data.toString();
        String s1="零壹贰叁肆伍陆柒捌玖";  
        String s4="分角整元拾佰仟万拾佰仟亿拾佰仟";  
        String temp="";  
        String result="";  
        if (input==null) outshu="输入字串不是数字串只能包括以下字符(′0′~′9′,′.′),输入字串最大只能精确到仟亿,小数点只能两位!";  
        temp=input.trim();  
        float f;  
        try{  
        f=Float.parseFloat(temp);  

        }catch(Exception e){outshu= "输入字串不是数字串只能包括以下字符(′0′~′9′,′.′),输入字串最大只能精确到仟亿,小数点只能两位!";}  
        int len=0;  
        if (temp.indexOf(".")==-1) len=temp.length();  
        else len=temp.indexOf(".");  
        if(len>s4.length()-3) outshu="输入字串最大只能精确到仟亿,小数点只能两位!";  
        int n1,n2=0;  
        String num="";  
        String unit="";  

        for(int i=0;i<temp.length();i++){  
        if(i>len+2){break;}  
        if(i==len) {continue;}  
        n1=Integer.parseInt(String.valueOf(temp.charAt(i)));  
        num=s1.substring(n1,n1+1);  
        n1=len-i+2;  
        unit=s4.substring(n1,n1+1);  
        result=result.concat(num).concat(unit);  
        }  
        if ((len==temp.length()) ||(len==temp.length()-1)) result=result.concat("整");  
        if (len==temp.length()-2) result=result.concat("零分");  
        outshu=result;  
        } 

	  
	  			
		Object Recordset1_data4= Recordset2.getObject("djh");
		Object Recordset1_data5= Recordset2.getObject("kdrq");
		
		Object Recordset2_data1= Recordset2.getObject("zdr");
		Object Recordset2_data2= Recordset2.getObject("ywy");
		Object Recordset2_data3= Recordset2.getObject("fhy");
		Object Recordset2_data4= Recordset2.getObject("qsr");

		Object Recordset1_data1= Recordset2.getObject("khmc");
		Object Recordset1_data2= Recordset2.getObject("khdh");
		Object Recordset1_data3= Recordset2.getObject("khdz");

	
	%>


<table width="733" border="0" class="STYLE2">
  <tr>
    <th width="193" scope="col">客户名称</th>
    <th width="225" scope="col"><%=Recordset1_data1%></th>
    <th width="163" scope="col">No:    </th>
    <th width="134" scope="col"><%=Recordset1_data4%></th>
  <tr></tr>
<th scope="col">客户地址电话</th>
    <th scope="col"><%=Recordset1_data2%><%=Recordset1_data3%></th>
    <th scope="col">开单日期</th>
    <th scope="col">
    <%=Recordset1_data5%></th>
  </tr>
</table>



<table width="736" border="1">


  <tr>
    <th width="126" align="center" scope="col">品名</th>
    <th width="110" align="center" scope="col">规格</th>
    <th width="82" align="center" scope="col">批号</th>
    <th width="70" align="center" scope="col">单位</th>
    <th width="102" align="center" scope="col">数量</th>
    <th width="98" align="center" scope="col">单价</th>
	
    <th width="102" align="center" scope="col">小计</th>
  </tr>
  		<%
int ita=10;
  	while(Recordset1.next()){ita--;
  				Object Recordset1_data6= Recordset1.getObject("ph");
		Object Recordset1_data7= Recordset1.getObject("sl");
		Object Recordset1_data8= Recordset1.getObject("je");
		Object Recordset1_data9= Recordset1.getObject("pm");
		Object Recordset1_data10= Recordset1.getObject("gg");
		Object Recordset1_data11= Recordset1.getObject("dw");
		Object Recordset1_data13= Recordset1.getObject("xsdj");
  		
  		%>
  		
  		
  <tr>
    <td align="center"><%=Recordset1_data9%></td>
    <td align="center"><%=Recordset1_data10%></td>
    <td align="center"><%=Recordset1_data6%></td>
    <td align="center"><%=Recordset1_data11%></td>
    <td align="center"><%=Recordset1_data7%></td>
    <td align="center"><%=Recordset1_data13%></td>
    <td align="center"> ¥<%=Recordset1_data8%></td>
  </tr>  <%
  	}
  	  for(;ita>2;ita--){
	  
  	  %>
      
        <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
        <td>&nbsp;</td>
            <td>&nbsp;</td>
                <td>&nbsp;</td>
                    <td>&nbsp;</td>
                        <td>&nbsp;</td>
  </tr> 
      
      <%}%>
  <tr>
    <td colspan="5">金额合计(大写):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=outshu%></td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ¥<%=Recordset3_data%></td>
  </tr>
  <tr>
    <td colspan="7">制单人:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=((Recordset2_data1!=null)?Recordset2_data1:"")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业务员:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=((Recordset2_data2!=null)?Recordset2_data2:"")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发货人:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=((Recordset2_data2!=null)?Recordset2_data2:"")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签收人:&nbsp;&nbsp;&nbsp;&nbsp;<%=((Recordset2_data2!=null)?Recordset2_data2:"")%></td>
  </tr>

</table>
		  
<p>&nbsp;<span class="STYLE2">单据说明:验收如有单货不符,请在十五天内致电本公司,逾期非质量问题恕不退货。</span></p>
		  <p>
		    <%
}else  {
	%>
		
        
        没有输入值
		
		  	  <%}
		  	  %>
                    </p>
</body>
</html>
<%
Recordset1.close();
StatementRecordset1.close();
ConnRecordset1.close();
%>
<%
Recordset2.close();
StatementRecordset2.close();
ConnRecordset2.close();
%>
<%
Recordset3.close();
StatementRecordset3.close();
ConnRecordset3.close();
%>

⌨️ 快捷键说明

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