public ActionResult ChangeName(Member member) { if (memberSQL.CheckForNameCase(member.DisplayName)) { ModelState.AddModelError("changename-error", "That name already exists"); return(RedirectToAction("OwnInfo")); } memberSQL.ChangeName(member.DisplayName, member.ID); Session["member"] = memberSQL.GetMemberByID(member.ID); TempData["msg"] = "name_changed"; return(RedirectToAction("OwnInfo")); }
/// <summary> /// 根据会员ID获取会员 /// </summary> /// <param name="id"></param> /// <returns></returns> public Member GetMember(int memberID) { Member m = null; dal.GetMemberByID(memberID, reader => { if (reader.HasRows) { m = reader.ToEntity <Member>(); } }); return(m); }
public Members GetMember(int memberID) { return(_memberDAL.GetMemberByID(memberID)); }