package com.quickteam.web.action;
import java.util.List;
import com.quickteam.entities.Building;
import com.quickteam.entities.Member;
import com.quickteam.entities.Merchandise;
import com.quickteam.entities.MerchandiseCollection;
import com.quickteam.entities.Region;
import com.quickteam.service.IBuildingService;
import com.quickteam.service.IMemberService;
import com.quickteam.service.IRegionService;
import com.quickteam.utils.Md5Encrypt;
import com.quickteam.web.common.AbstractAction;
public class UserManagementAction extends AbstractAction {
private static final long serialVersionUID = -3053512859967726799L;
private IMemberService memberService;
private IBuildingService buildingService;
private IRegionService regionService;
private List<Region> regionList;
private List<Building> buildingList;
private List<Merchandise> collectedMerchandises;
private Member member;
private String newPwd;
private String oldPwd;
private String changePwdState;
private String changeInformationState;
private MerchandiseCollection merchandiseCollection = new MerchandiseCollection();
private Member loginedMember = null;
private String isCollectMerchandiseSuccess = "";
private String isDeleteCollectedMerchandiseSuccess;
public String execute() {
try {
loginedMember = (Member) getSession().get("loginMember");
if (loginedMember == null)
return "index";
member = memberService.selectMemberById(loginedMember.getId());
regionList = regionService.selectAllRegion();
buildingList = buildingService.selectAllBuildingId();
return SUCCESS;
} catch (Exception e) {
e.printStackTrace();
return ERROR;
}
}
/**
* 修改密码 1为成功!0为失败
*
* @return
*/
public String changePassword() {
try {
member = (Member) getSession().get("loginMember");
if (member.getLoginPwd().equals(Md5Encrypt.encode(oldPwd))) {
member.setLoginPwd(newPwd);
memberService.updateMember(member);
getSession().put("loginMember", member);
changePwdState = "1";
return SUCCESS;
}
changePwdState = "0";
return SUCCESS;
} catch (Exception e) {
changePwdState = "0";
return ERROR;
}
}
/**
* 修改个人信息 1为成功!0为失败
*
* @return
*/
public String changeInformation() {
try {
memberService.updateMember(member);
changeInformationState = "1";
return SUCCESS;
} catch (Exception e) {
changeInformationState = "0";
return ERROR;
}
}
public String deleteCollectedMerchandise() {
try {
if (memberService.deleteCollectedMerchandise(merchandiseCollection)) {
isDeleteCollectedMerchandiseSuccess = "删除成功";
return SUCCESS;
} else {
isDeleteCollectedMerchandiseSuccess = "删除失败";
return ERROR;
}
} catch (Exception e) {
changeInformationState = "0";
return ERROR;
}
}
public String manageCollectedMerchandise() {
try {
page.setPerPageCount(6);
loginedMember = (Member) getSession().get("loginMember");
if (loginedMember != null) {
page.setSumPage(memberService
.selectMerchandisesByMemberIdCount(loginedMember
.getId()));
collectedMerchandises = memberService
.selectMerchandisesByMember(page);
return SUCCESS;
} else {
return "GO TO LOGIN";
}
} catch (Exception e) {
logger.error("manageMerchandise" + e);
return ERROR;
}
}
public String collectMerchandise() {
try {
loginedMember = (Member) getSession().get("loginMember");
if (loginedMember != null) {
merchandiseCollection.setMemberId(loginedMember.getId());
isCollectMerchandiseSuccess = memberService
.collectMerchandise(merchandiseCollection) ? "收藏成功"
: "您已收藏";
return SUCCESS;
} else {
isCollectMerchandiseSuccess = "请登录";
return ERROR;
}
} catch (Exception e) {
isCollectMerchandiseSuccess = "收藏失败";
logger.error("collectMerchandise EEOR" + e);
return ERROR;
}
}
public void setMemberService(IMemberService memberService) {
this.memberService = memberService;
}
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
public void setNewPwd(String newPwd) {
this.newPwd = newPwd;
}
public void setOldPwd(String oldPwd) {
this.oldPwd = oldPwd;
}
public List<Region> getRegionList() {
return regionList;
}
public List<Building> getBuildingList() {
return buildingList;
}
public void setBuildingService(IBuildingService buildingService) {
this.buildingService = buildingService;
}
public void setRegionService(IRegionService regionService) {
this.regionService = regionService;
}
public String getChangePwdState() {
return changePwdState;
}
public String getChangeInformationState() {
return changeInformationState;
}
public void setCollectedMerchandiseId(Integer merchandiseId) {
merchandiseCollection.setMerchandiseId(merchandiseId);
}
public String getIsCollectMerchandiseSuccess() {
return isCollectMerchandiseSuccess;
}
public void setIsCollectMerchandiseSuccess(
String isCollectMerchandiseSuccess) {
this.isCollectMerchandiseSuccess = isCollectMerchandiseSuccess;
}
public List<Merchandise> getCollectedMerchandises() {
return collectedMerchandises;
}
public void setCollectedMerchandises(List<Merchandise> collectedMerchandises) {
this.collectedMerchandises = collectedMerchandises;
}
public String getIsDeleteCollectedMerchandiseSuccess() {
return isDeleteCollectedMerchandiseSuccess;
}
public void setIsDeleteCollectedMerchandiseSuccess(
String isDeleteCollectedMerchandiseSuccess) {
this.isDeleteCollectedMerchandiseSuccess = isDeleteCollectedMerchandiseSuccess;
}
public MerchandiseCollection getMerchandiseCollection() {
return merchandiseCollection;
}
public void setMerchandiseCollection(
MerchandiseCollection merchandiseCollection) {
this.merchandiseCollection = merchandiseCollection;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
首先好东西不用嫌贵...如题。这是我们老师的公司为一个家具企业开发的网站初稿,基本完整,导入Ecipse或者MyEclipse即可直接运行,各种类包已经在WEB-INF/lib下。数据库是基于mysql,数据库源文件也位于代码中sql文件夹中,可以直接测试。有什么不懂的可以问我。大家交流学习。
资源推荐
资源详情
资源评论
收起资源包目录
基于J2EE的家居购物网站(导入eclipse可直接运行,SSI架构) (960个子文件)
UserManagementAction.class 7KB
IndexAction.class 6KB
StyleNavigateAction.class 6KB
RoomDesignServiceImpl.class 6KB
MerchandiseTO.class 6KB
Merchandise.class 5KB
RoomDesignDaoImpl.class 5KB
DesignWorkAction.class 5KB
ProductNavigateAction.class 5KB
MemberServiceImpl.class 5KB
ValidateImageServiceImpl.class 4KB
RoomDesignCollectionAction.class 4KB
ProductNavigateServiceImpl.class 4KB
RoomDesignServiceImplTest.class 4KB
BrandTO.class 4KB
ProductDetailAction.class 4KB
ImageShow.class 4KB
StyleNavigate.class 4KB
BrandDetailAction.class 4KB
MemberAction.class 4KB
RoomDesign.class 3KB
ValidateImgAction.class 3KB
Dealer.class 3KB
QueryAction.class 3KB
BrandDaoImplTest.class 3KB
PromotionAction.class 3KB
Member.class 3KB
RoomComment.class 3KB
MerchandiseDaoImpl.class 3KB
RoomDesignDaoImplTest.class 3KB
MarketServiceImpl.class 3KB
BrandServiceImpl.class 3KB
Brand.class 3KB
Building.class 3KB
Furniture.class 3KB
Manufacturer.class 3KB
MessageAction.class 3KB
BaseDaoImpl.class 3KB
ShowImageAction.class 3KB
MerchandiseComment.class 3KB
RoomDesignComment.class 3KB
MerchandiseCommentTO.class 3KB
RoomDesignCommentTO.class 3KB
MartNavigateAction.class 3KB
MerchandiseCommentAction.class 3KB
RoomDesignCommentAction.class 2KB
News.class 2KB
Message.class 2KB
FurnitureTO.class 2KB
MarketTO.class 2KB
MerchandiseServiceImpl.class 2KB
RightHotAction.class 2KB
BlossomRoomDesignAction.class 2KB
BrandShowAction.class 2KB
AbstractAction.class 2KB
IRoomDesignDao.class 2KB
BuildingDaoImpl.class 2KB
CategoryDaoImpl.class 2KB
KnowledgeAction.class 2KB
RoomCollection.class 2KB
RoomDesignCollectionDaoImpl.class 2KB
MerchandiseCollectionDaoImpl.class 2KB
NewsServiceImpl.class 2KB
RoomDesignCollectionServiceImpl.class 2KB
Activity.class 2KB
Admin.class 2KB
IRoomDesignService.class 2KB
Knowledge.class 2KB
ActivityServiceImpl.class 2KB
NewsDaoImpl.class 2KB
MerchandiseCollection.class 2KB
StyleNavigateDaoImpl.class 2KB
QueryEntity.class 2KB
ActivityDaoImpl.class 2KB
MerchandiseCollectionServiceImpl.class 2KB
Category.class 2KB
BrandDaoImpl.class 2KB
Groupbuy.class 2KB
MerchandiseCollectionServiceImplTest.class 2KB
FurnitureServiceImplTest.class 2KB
AdminLog.class 2KB
BuildingDaoImplTest.class 2KB
FurnitureInfoAction.class 2KB
RoomDesignCollection.class 2KB
BrandServiceImplTest.class 2KB
Page.class 2KB
Region.class 2KB
MemberDaoImpl.class 2KB
ServletBaseAction.class 2KB
Market.class 2KB
Md5Encrypt.class 2KB
MerchandiseCommentServiceImpl.class 1KB
MerchandiseCommentDaoImpl.class 1KB
RoomDesignCommentServiceImpl.class 1KB
RoomDesignCommentDaoImpl.class 1KB
BuildingServiceImplTest.class 1KB
NewsAction.class 1KB
Property.class 1KB
KnowledgeServiceImpl.class 1KB
IMerchandiseDao.class 1KB
共 960 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
ZCajan
- 粉丝: 5
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页