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

📄 do_join_w.jsp

📁 饲料公司销售管理系统是基于建立完善的饲料公司销售方面管理控制模型的基础上
💻 JSP
字号:
<html>
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>添加商品</title>
</head>
<jsp:useBean id="db" scope="page" class="sale.dbBean" />
<body>

<p align="center"><font size="6" color="#000080">添加商品</font></p>
<hr>
<%
String id=new String();
id=(String)session.getAttribute("id");
if(id==null)
	{
		response.sendRedirect("index.htm");
	}
%>
<%
String name=new String(request.getParameter("name").getBytes("8859_1"),"gb2312");
String spec=new String(request.getParameter("spec").getBytes("8859_1"),"gb2312");
String price=new String(request.getParameter("price"));
String c_id=new String(request.getParameter("c_id"));

String sql=new String();
String url=new String();

ResultSet rs=null;
String errorcode="";

	sql="select * from commodity where id='"+c_id+"'";
	rs=db.executeQuery(sql);
	if(rs.next())
	{
		rs.close();
		%>
		<p align="center">该商品编号已经存在</p>
		<p align="center"><a href="join_w.jsp"><font color="#000080">请重新输入</font></a></p>
		<%
	}
	else
	{
		sql="insert into commodity(id,name,spec,price) values('"+c_id+"','"+name+"','"+spec+"','"+price+"')";
		db.executeInsert(sql);	
		%>	
		<p align="center">您已经成功添加该商品!</p>
		<div align="center">
			
			<table border="0" width="60%">
							  <tr>
			    <td width="50%">
			      <p align="center">商品编号</td>
			    <td width="50%">
			    <%=c_id%>
			    </td>
			  </tr>
			<tr>
			  <tr>
			    <td width="50%">
			      <p align="center">商品名称</td>
			    <td width="50%">
			    <%=name%>
			    </td>
			  </tr>
			<tr>
	<td width="50%">
			      <p align="center"> 商品规格</td>
			    <td width="50%">
			    <%=spec%>
			    </td>
			   </tr>
			  <tr>
			    <td width="50%">
			      <p align="center">商品单价</td>
			    <td width="50%">
			    <%=price%>
			    </td>
			  </tr>
			  

	
			 </table>
			 </div>
			<p align="center"><a href="commodity.jsp"><font color="#000080">返回</font></a> 
		<%		
	}

%>	



</body>
</html>

⌨️ 快捷键说明

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