JavaWeb课程设计 - 图文(5)
(2)客户资料修改
public class ACustomerModify {
//修改一个客户信息
public void doRegister( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
//首先获得要修改的客户详细信息 String sCustomerId = (String)inputData.get(\); String sRealname = (String)inputData.get(\); String sSex = (String)inputData.get(\);
String sBirthday = (String)inputData.get(\); String sPhone = (String)inputData.get(\);
String sCellphone = (String)inputData.get(\); String sAddress = (String)inputData.get(\); String sStartDate = (String)inputData.get(\); String sMemo = (String)inputData.get(\);
//生成一个Customer对象以调用
Customer customer = new Customer(); customer.setCustomerId( sCustomerId ); customer.setRealname( sRealname ); customer.setSex( sSex );
customer.setBirthday( sBirthday );
21
customer.setPhone( sPhone );
customer.setCellphone( sCellphone ); customer.setAddress( sAddress );
customer.setStartDate( sStartDate ); customer.setMemo( sMemo );
//调用对应的logic类 LCustomer lCustomer = (LCustomer)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CUSTOMER);
//添加对应的记录
lCustomer.modifyCustomer( customer );
//然后重新检索,并将页面迁移到一览页面
Vector vCustomers = lCustomer.getAllCustomer();
outputData.put( \, CommonConst.VIEWID_CUSTOMER_LIST); //往值域中设置当前位置信息
mySession.setAttribute(\, vCustomers ); outputData.put( \, new Integer(0) ); return; } }
22
(3)客户资料删除
public class ACustomerDelete {
//到首页
public void doFirst( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
//首页的index一定为0 outputData.put( \, CommonConst.VIEWID_CUSTOMER_DELETE); //往值域中设置当前位置信息
outputData.put( \, new Integer(0) ); return; }
23
//到末页
public void doLast( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
//首先获得全部客户信息,并计算出最后一页的位置 Vector allCustomers = (Vector)mySession.getAttribute(\); int iMax = allCustomers.size();
int iMaxPage = (int)Math.ceil((double)iMax/20); int iIndex = (iMaxPage-1)*20;
//首页的index一定为0 outputData.put( \, CommonConst.VIEWID_CUSTOMER_DELETE); //往值域中设置当前位置信息
outputData.put( \, new Integer(iIndex) ); return; }
//到前页
public void doPrev( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
//首先获得当前页
String sCurPage = (String)inputData.get(\); int iCurPage = (new Integer(sCurPage)).intValue(); int iIndex = (iCurPage-2)*20; outputData.put( \, CommonConst.VIEWID_CUSTOMER_DELETE); //往值域中设置当前位置信息
outputData.put( \, new Integer(iIndex) ); return; }
//到次页
public void doNext( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
24
//首先获得当前页
String sCurPage = (String)inputData.get(\); int iCurPage = (new Integer(sCurPage)).intValue(); int iIndex = iCurPage*20; outputData.put( \, CommonConst.VIEWID_CUSTOMER_DELETE); //往值域中设置当前位置信息
outputData.put( \, new Integer(iIndex) ); return; }
//到首页
public void doSpec( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception {
//首先获得指定页码
String sSpecPage = (String)inputData.get(\); //获得全部客户信息,并计算出最后一页的位置 Vector allCustomers = (Vector)mySession.getAttribute(\); int iMax = allCustomers.size();
int iMaxPage = (int)Math.ceil((double)iMax/20); int iSpec = (new Integer(sSpecPage)).intValue(); //如果指定页大于全部页码,则跳转到第一页 if ( iSpec > iMaxPage ) {
iSpec = 1; }
//指定页
outputData.put( \, CommonConst.VIEWID_CUSTOMER_DELETE); //往值域中设置当前位置信息
outputData.put( \, new Integer((iSpec-1)*20) ); return; }
//修改某条记录
public void doDelete( Hashtable inputData, Hashtable outputData, HttpSession mySession ) throws Exception
25
…… 此处隐藏:1558字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [互联网资料]2022年厦门大学机电工程系824机械设计
- [互联网资料]东南大学2022年硕士研究生拟录取名单公
- [互联网资料]能源调研报告(精选多篇)
- [互联网资料]初三英语下学期 中考英语 语法填空训练
- [互联网资料]2022内蒙古选调生行测常识备考:新事物
- [互联网资料]自驾必备!在新西兰租什么样的车自驾游
- [互联网资料]佛教素食菜谱44页未完
- [互联网资料]盈利能力分析外文翻译
- [互联网资料]2022年南昌航空大学音乐学院736马克思
- [互联网资料]优选外贸跟单实习报告总结(精品版)
- [互联网资料]银行新员工培训总结
- [互联网资料]2_year_visa_new_guidance_190316
- [互联网资料]天津市五校宝坻一中静海一中杨村一中芦
- [互联网资料]2007--2008学年第一学期高三数学宁波市
- [互联网资料]Chromatic framework for vision in ba
- [互联网资料]幼儿园大班上学期美术教案《心愿树》含
- [互联网资料]2022年华中农业大学信息学院820微型计
- [互联网资料]硬盘坏道的表现 __硬盘使用久了
- [互联网资料]江苏省2016年会计从业资格考试《会计基
- [互联网资料]公共场所卫生监督试卷全解
- 高级英语第一册所有修辞方法及例子总结
- 综合交通枢纽规划与城市发展
- 沃尔玛的企业文化案例分析
- 美国Thanksgiving Day 感恩节 介绍
- PEP六年级英语上册Unit6How do you fee
- 最齐全的中国大型商场购物中心名单
- 数据结构实验报告八—哈夫曼编译码
- 杭州市余杭区人民政府(通知)
- 七年级语文成语运用专项训练
- 微观经济学第三章 消费者行为 课后习题
- 对_钱学森之问_的思考
- Excel_三级联动_下拉菜单
- 办公用品需求计划申请表
- 对外汉语教材必须要知道的发展史
- 挑战杯大学生学术科技作品竞赛作品申报
- 举办民办教育培训机构应具备下列条件
- 太阳能路灯项目设计方案
- 2013年八年级上最新人教版新教材Unit3I
- 【历史】 6-4 《近代科学之父牛顿》 课
- 高中生物《第四章 第二节 探讨加酶洗衣




