Пример #1
0
        public ActionResult Edit(MemberModel model)
        {
            var member = MemberModeMapper.Map(model);

            MemberHandler.Update(member);
            return(RedirectToAction("Index"));
        }
Пример #2
0
        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 = "" }));
        }
Пример #3
0
        public ViewResult Edit()
        {
            var user        = (PublicUser)Session[Constants.AppUserKeyName];
            var member      = MemberHandler.GetMember(user.MemberId);
            var memberModel = MemberModeMapper.Map(member);

            return(View(memberModel));
        }