public ActionResult Index()
        {


            if (Session[SessionKeys.MemberInfo] != null)
                return RedirectToAction(RouteKeys.MemberProfile);

            var returnModel = new RegistrationLoginViewModel()
            {
                LoginViewModel = new MemberLoginViewModel(),
                RegistrationViewModel = new MemberRegisterViewModel()
            };

            ViewBag.PageTitle = "Membership";

            return  View(RouteKeys.Register, returnModel);
        }
        public ActionResult Login(RegistrationLoginViewModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                var memberLogin = new MemberLogin
                {
                    NickName = model.LoginViewModel.NickName,
                    Password = model.LoginViewModel.Password
                };
                var member = _memberBusiness.MemberLogin(memberLogin);

                if (member.Success)
                {
                    Response.CacheControl = "no-cache";
                    Response.AddHeader("Pragma", "no-cache");
                    Response.Expires = -1;

                    DoLogin(member.Object, model.LoginViewModel.IsRemember);


                    model.Url = string.Format("/{0}/{1}?login=true",
                        RouteKeys.MemberController, RouteKeys.MemberProfile);
                        return Json(model); 
                    
                }
                else
                {
                    ModelState.AddModelError("error", member.Message);
                }
            }
           
            var returnModel = new RegistrationLoginViewModel()
            {
                LoginViewModel = model.LoginViewModel,
                RegistrationViewModel = new MemberRegisterViewModel(),
                Error = Errors(GetModelErrors())
            };
            return Json(returnModel);
        }
        public ActionResult Register(MemberRegisterViewModel member, string returnUrl = "")
        {
            var returnModel = new RegistrationLoginViewModel()
            {
                LoginViewModel = new MemberLoginViewModel(),
                RegistrationViewModel = member,
                Error = Errors(GetModelErrors())
            };
            if (ModelState.IsValid)
            {

                ResultSet<Member> resultMember = _memberBusiness.AddMember(member);

                if (!resultMember.Success)
                {
                    ModelState.AddModelError("Error", resultMember.Message);
                } 
            }



            returnModel.Error = Errors(GetModelErrors()); 
            return Json(returnModel);
        }