package std.cdrp.beans.sysinfo;
import std.cdrp.beans.*;
import java.sql.*;
import java.io.*;
public class QuestString {
private int curPage;// 当前页数
private int maxPage;// 最大页数
private int maxRowCount;// 总记录数(即从数据库中查出的所有记录)
private int pageSize = 2;// 每页要显示的记录数
private DBResult db;// 记录集对象
private String httpFile;// 当前地址栏的文件,即具体的JSP文件
private String cif;// 选择的查询字段
private String ccif;// 选择的查询条件运算符
private String qvalue;// 查询关键字
private String countSql = null;// 用来存储select count (*) ……语句
private String topSql = null;// 用来存储 select top 2……语句
private String nowPage = null;// 初始化当前页curPage变量,即获当前页的具体页号
private String str_parameter;// 在做翻页的时传递的除pages以外的其他参数
private String andor;// 查询的与/或条件
private String sdate;// 查询起始时间,即从什么日期开始查询
private String edate;// 查询结束时间,即到什么日期结束
private String orderby;// 排序条件,即按什么排序
private String paixu;// 排序方法,即升序或降序
public QuestString() {
db = new DBResult();
}
public int getCurPage() {
return curPage;
}
public void setCurPage(int curPage) {
this.curPage = curPage;
}
public int getMaxPage() {
return maxPage;
}
public void setMaxPage(int maxPage) {
this.maxPage = maxPage;
}
public int getMaxRowCount() {
return maxRowCount;
}
public void setMaxRowCount(int maxRowCount) {
this.maxRowCount = maxRowCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public String getHttpFile() {
return httpFile;
}
public void setHttpFile(String httpFile) {
this.httpFile = httpFile;
}
public String getCcif() {
return ccif;
}
public void setCcif(String ccif) {
this.ccif = ccif;
}
public String getCif() {
return cif;
}
public void setCif(String cif) {
this.cif = cif;
}
public String getQValue() {
return qvalue;
}
public void setQValue(String qValue) {
this.qvalue = qValue;
}
public String getStr_parameter() {
return str_parameter;
}
public void setStr_parameter(String str_parameter) {
this.str_parameter = str_parameter;
}
public String getAndor() {
return andor;
}
public void setAndor(String andor) {
this.andor = andor;
}
public String getSdate() {
return sdate;
}
public void setSdate(String sdate) {
this.sdate = sdate;
}
public String getEdate() {
return edate;
}
public void setEdate(String edate) {
this.edate = edate;
}
public String getOrderby() {
return orderby;
}
public void setOrderby(String orderby) {
this.orderby = orderby;
}
public String getPaixu() {
return paixu;
}
public void setPaixu(String paixu) {
this.paixu = paixu;
}
/**
* 通过参数传递来设置Bean中的属性
*/
public void setQuerySql(String httpfile, String pages, String strCount) {
this.nowPage = pages;// 将表单提交过来的参数pages(第几页)的值传递给变量nowPage保存
this.httpFile = httpfile;// 用来动态设置处理表单请求的JSP文件
this.countSql = strCount;// 用来设置执行select count(*)……的SQL语句
try {
querySql(countSql);// 调用querySql方法,并将参数countSql传递到该方法中
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 执行SQL语句,获得分页显示时的各个属性
*/
public void querySql(String countSql) throws SQLException {
// 在setQuerySql方法中已经设置了nowPage的值,其值就是pages
if (this.nowPage == null) {// 如果nowPage的值为空,也就是传递pages的值为空
this.curPage = 1;// 那么就将当前页的值设为1;
} else {
this.curPage = Integer.parseInt(this.nowPage);
if (this.curPage < 1) {// 如果当前页小于1,那么就将当前页的值设为1
this.curPage = 1;
}
}
ResultSet rsCount = db.getResult(countSql);// 执行SQL语句获得记录总数
if (rsCount.next()) {
this.maxRowCount = rsCount.getInt(1);// 获取记录总数,即所要查询记录的总行数
}
// 获取总页数,即如果当总记录数除以每页显示的记录的余数为0时,总页数就等于两数整除的结果
// 如果余数不等于0,那么总页数就等于两数整除的结果加1
this.maxPage = (this.maxRowCount % this.pageSize == 0) ? (this.maxRowCount / this.pageSize)
: (this.maxRowCount / this.pageSize + 1);
if (this.curPage > this.maxPage) {// 如果当前页大于总页数,则当前页等于总页数
this.curPage = this.maxPage;// 那么当前页就是最大页
}
rsCount.close();// 关闭总记录数的结集
}
/**
* 一个字符串,用来动态的给出一个表单 该表单用来进行分页和统统页面间的跳转
*/
public String pageFooter() {
// 创建一个表单
String str = "<form action=" + this.httpFile
+ " name=formBean methord=post>";
int prev = this.curPage - 1;// 向前翻页,即当前页减1
int next = this.curPage + 1;// 向后翻页,即当前页加1
str = str + "<font style='font-size: 10pt'>总计<font color='red'>"
+ this.getMaxRowCount() + "</font>条记录,"
+ "【共<font color='red'>" + this.getMaxPage() + "</font>页】";
str = str + "【 <font color='red'>" + this.pageSize
+ "</font>条/页】 当前第<font color='red'>" + this.getCurPage()
+ "</font>页 ";
if (this.curPage > 1)
str = str + " <A href=" + this.httpFile + "?pages=1"
+ str_parameter + ">首页</A> ";
else
str = str + " 首页 ";
if (this.curPage > 1)
str = str + " <A href=" + this.httpFile + "?pages=" + prev
+ str_parameter + ">上一页</A> ";
else
str = str + " 上一页 ";
if (this.curPage < this.maxPage)
str = str + " <A href=" + this.httpFile + "?pages=" + next
+ str_parameter + ">下一页</A> ";
else
str = str + " 下一页 ";
if (this.maxPage > 1 && this.curPage != this.maxPage)
str = str + " <A href=" + this.httpFile + "?pages=" + this.maxPage
+ str_parameter + ">尾页</A>";
else
str = str + " 尾页</font>";
// 在页面跳转间设置隐藏表单,来保存不同的请求
str = str + "转到<input type ='text' name='pages' size='2'>页"
+ "<input type='hidden' name='ccif' value='" + this.ccif
+ "'><input type ='hidden' name='cif' value='" + this.cif
+ "'><input type ='hidden' name='qvalue' value='" + this.qvalue
+ "'><input type ='hidden' name='andor' value='" + this.andor
+ "'><input type ='hidden' name='sdate' value='" + this.sdate
+ "'><input type ='hidden' name='edate' value='" + this.edate
+ "'><input type ='hidden' name='orderby' value='"
+ this.orderby + "'><input type ='hidden' name='paixu' value='"
+ this.paixu
+ "'><input type='submit' name='sumbmit' value='go'></form>";
return str;
}
/**
* 根据不同条件来获取不同的查询前N条的SQL语句
*/
public String getString(String table) {
if (ccif.equals("=")) {
String strSql = "select top " + this.pageSize * this.curPage
+ " * from " + table + " where" + " " + cif + "=" + "'"
+ qvalue + "'";
return strSql;
} else if (ccif.equals("LIKE")) {
String strSql = "select top " + this.pageSize * this.curPage
+ " * from " + table + " where" + " " + cif + " " + "like"
+ " " + "'%" + qvalue + "%'";
return strSql;
} else if (ccif.equals("ALL")) {
String strSql = "select top " + this.pageSize * this.curPage
+ " * from " + table;
return strSql;
} else if (ccif.equals("<")) {
String strSql = "select top " + this.pageSize * this.curPage
+ " * from " + table + " where " + cif + " < '" + qvalue
+ "'";
return strSql;
}
return null;
}
/**
* 根据不同条件来获得不同的计算记录总数的SQL语句
*/
public String getCount(String table) {
if (ccif.equals("=")) {
String strSql = "select count(*) from " + table + " where" + " "
+ cif + "=" + "'" + qvalue + "'";
return strSql;
} else if (ccif.equals("LIKE")) {
String strSql = "select count(*) from " + table + " where" + " "
+ cif + " " + "like" + " " + "'%" + qvalue + "%'";
没有合适的资源?快使用搜索试试~ 我知道了~
JSP进销存管理系统(MVC)
共376个文件
gif:107个
jsp:64个
class:54个
1星 需积分: 13 53 下载量 53 浏览量
2008-08-03
18:45:31
上传
评论 5
收藏 8.27MB RAR 举报
温馨提示
JSP进销存管理系统(MVC),可以在基础功能上添加自己需要的
资源推荐
资源详情
资源评论
收起资源包目录
JSP进销存管理系统(MVC) (376个子文件)
aa.bmp 838B
QuestString.class 10KB
CadreSaleOP.class 6KB
CheckBuy.class 5KB
DBUtils.class 5KB
BackSaleOP.class 4KB
Lists.class 4KB
SuppOP.class 4KB
CadreSaleOrderMap.class 4KB
Fin_backOP.class 4KB
CadreSaleMap.class 4KB
Fin_saleOP.class 4KB
SupplierMap.class 4KB
CadreSale.class 4KB
BackSale.class 3KB
ImpStockMap.class 3KB
Custome.class 3KB
CustomerMap.class 3KB
Fin_sale.class 3KB
Fin_back.class 3KB
ProductMap.class 3KB
Produc.class 3KB
SysinfoServlet.class 3KB
CustOP.class 3KB
Balance.class 3KB
Product_Clas.class 3KB
MyPagesMap.class 3KB
OrderCadre.class 3KB
CadreSale.class 3KB
CheckUser.class 3KB
GetDate.class 3KB
Buy_Order.class 2KB
CadreSale1.class 2KB
Buy.class 2KB
BackSaleSE.class 2KB
Pages.class 2KB
Customer.class 2KB
ImpStock.class 2KB
CadreSaleDetail.class 2KB
Supplier.class 2KB
Prod_Clas.class 2KB
Supp.class 2KB
Fin_sale1.class 2KB
Fin_back1.class 2KB
Balan.class 2KB
Cust.class 2KB
Prod.class 2KB
Product.class 2KB
Login.class 2KB
User.class 2KB
BackSaleDetalil.class 1KB
DBResult.class 1KB
Buy_Order_Detail.class 1KB
Cur_Balances.class 1KB
Product_Class.class 986B
.classpath 3KB
org.eclipse.wst.common.component 436B
style.css 4KB
silverStyle.css 3KB
BlueStyle.css 3KB
classicStyle.css 3KB
style.css 2KB
global.css 1KB
global.css 1KB
global.css 1KB
customer.css 1KB
customer.css 1KB
customer.css 1KB
default.css 677B
default.css 677B
default.css 677B
top.gif 56KB
main_bg.gif 7KB
khinfo.gif 6KB
modifyprice.gif 6KB
sprk.gif 6KB
spxx.gif 5KB
user.gif 5KB
Imgmenu1_1.gif 4KB
Imgmenu1_2.gif 4KB
quest.gif 4KB
Imgmenu7_1.gif 4KB
Imgmenu7_2.gif 4KB
Imgmenu4_1.gif 4KB
Imgmenu4_2.gif 4KB
Imgmenu3_2.gif 4KB
Imgmenu3_1.gif 4KB
Imgmenu5_1.gif 4KB
Imgmenu5_2.gif 4KB
index_r2_c2.gif 2KB
t_6.gif 2KB
t_5.gif 2KB
t_4.gif 2KB
phone.gif 2KB
zy.gif 2KB
index_r2_c1.gif 2KB
index_r2_c5.gif 2KB
index_r1_c2.gif 2KB
TitlebarRight_Head.gif 2KB
TitlebarRight.gif 2KB
共 376 条
- 1
- 2
- 3
- 4
资源评论
- wuxiaoqing_346267252019-03-31没有数据库
linuxzzj
- 粉丝: 4
- 资源: 59
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于matlab实现对表面肌电信号进行归一化处理,并对归一化后的图形显示 .rar
- 基于matlab实现单级倒立摆的 T-S 模型 包括 LMI 程序源码
- 图书管理系统(struts+hibernate+spring+ext).rar
- 基于matlab实现此压缩包包含语音信号处理中的语音变声代码加音频.rar
- STM32使用PWM驱动舵机并通过OLED显示
- 基于matlab实现车辆路径规划;遗传算法;matlab代码.rar
- 图书管理系统(struts+hibernate+spring)130225.rar
- 基于matlab实现采用标量衍射理论,实现菲涅尔衍射和夫琅禾费衍射,对光波的波前传播和数字全息的应用有帮助.rar
- JavaScript版去除链表重复元素
- 微信小程序项目-功德木鱼(带设置面板-自定义文字、可选字体颜色、可选木鱼样式)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功