public static void replaceMember(Member target, Member source) { target.MemberId = source.MemberId; target.MemberName = source.MemberName; target.NickName = source.NickName ; target.Phone = source.Phone ; target.Salary = source.Salary ; }
public ActionResult CheckNickname(Member member) { if (member.NickName.Contains("a")) { return Json(string.Format("{0} is reserved, enter another nickname", member.NickName), JsonRequestBehavior.AllowGet); } else { return Json(true, JsonRequestBehavior.AllowGet); } }
public ActionResult Edit(Member member) { Member m1 = MemberRepository.Members.FirstOrDefault(m => m.MemberId == member.MemberId); MemberRepository.replaceMember(m1, member); return RedirectToAction("Index"); }