public string UpdatePwd(int clubCardID, string oldpwd, string newPwd) { IClubCardData carddal = new ClubCardData(); string restr; var result = Mapper.Map <ClubCardPO, ClubCardVO>(carddal.GetCardByID(clubCardID, 0)); if (result == null) { restr = "当前会员卡不存在"; } else { if (result.ClubCardPwd == StringHelper.MD5Encrypt(oldpwd)) { try { result.ClubCardPwd = StringHelper.MD5Encrypt(newPwd); carddal.UpdateClubCard(Mapper.Map <ClubCardVO, ClubCardPO>(result)); restr = null; } catch (Exception ex) { LogHandler.Error(ex.ToString()); restr = "出现错误,密码重置失败"; } } else { restr = "原始密码不正确"; } } return(restr); }
public Model.VO.ClubCardVO GetClubCardByCustID(int id) { IClubCardData cardData = new ClubCardData(); return(Mapper.Map <ClubCardPO, ClubCardVO>(cardData.GetCardByID(id, 1))); }