public ActionResult Edit(MemberModel model) { var member = MemberModeMapper.Map(model); MemberHandler.Update(member); return(RedirectToAction("Index")); }
public ActionResult Register(MemberModel model) { var member = MemberModeMapper.Map(model); var error = MemberHandler.AddMember(member); if (error == ErrorCode.ErrorWhileMemberRegistrationEmailEmpty) { ViewBag.RegstrationError = "Email address can't be empty."; return(View("Login")); } if (error == ErrorCode.ErrorWhileMemberRegistrationPasswordEmpty) { ViewBag.RegstrationError = "Password can't be empty."; return(View("Login")); } if (error == ErrorCode.ErrorWhileMemberRegistrationEmailAlreadyExist) { ViewBag.RegstrationError = "Email address already registerd."; return(View("Login")); } Session[Constants.AppUserKeyName] = PublicUser.GetCurrentUser(member); return(RedirectToAction("Index", "Home", new { area = "" })); }
public ViewResult Edit() { var user = (PublicUser)Session[Constants.AppUserKeyName]; var member = MemberHandler.GetMember(user.MemberId); var memberModel = MemberModeMapper.Map(member); return(View(memberModel)); }