public string EditMemberInformation(UpdateMemberInfo memberAfterEdit) { var originMember = MemberRepo.GetMemberByAcc(memberAfterEdit.m_account); if (originMember != null) { var result = MemberRepo.EditMemberInformation(originMember, memberAfterEdit); return(result); } return("查無此會員"); }
public bool ResetPassword(UpdateMemberInfo memberInfo) { var member = MemberRepo.GetMemberByAcc(memberInfo.m_account); if (member != null) { var hash_new_password = HashPassword(memberInfo.new_password); return(MemberRepo.UpdatePassword(member, hash_new_password));; } return(false); }
public IActionResult EditMemberInformation(UpdateMemberInfo memberAfterEdit) { var result = MemberService.EditMemberInformation(memberAfterEdit); if (result == "Update completed!" || result == "查無此會員") { return(Ok(result)); } else { return(BadRequest(result)); } }
public IActionResult ResetPassword(UpdateMemberInfo memberInfo) { var result = MemberService.ResetPassword(memberInfo); if (result == true) { return(Ok("重設密碼成功")); } else { return(BadRequest("重設密碼失敗")); } }
public string EditMemberInformation(Member originMember, UpdateMemberInfo memberAfterEdit) { string result = string.Empty; try { originMember.m_name = memberAfterEdit.m_name; originMember.m_address = memberAfterEdit.m_address; originMember.m_birthday = memberAfterEdit.m_birthday; originMember.m_email = memberAfterEdit.m_email; db.SaveChanges(); result = "Update completed!"; } catch (Exception e) { result = e.Message.ToString(); } return(result); }
public IActionResult SendResetPasswordMail(UpdateMemberInfo resetInfo) { var member = MemberService.GetMemberByAcc(resetInfo.m_account); if (member != null) { bool result = MailService.SendResetPasswordMail(resetInfo.m_email, member.m_account); if (result == true) { return(Ok("寄送重設密碼連結信成功")); } return(BadRequest("寄送重設密碼連結信失敗")); } else { return(BadRequest("帳號不存在")); } }