コード例 #1
0
        public ActionResult Index()
        {
            if (UserSettings == null)
            {
                UserSettings = new User();
            }

            IndexViewModel model = Mapper.Map <User, IndexViewModel>(UserSettings);

            if (Properties.Settings.Default.Mode != FacebookMode.None && model.FacebookUserId == 0)
            {
                model.LogOnRedirectUrl = _facebookClient.GetLogOnUrl();
            }

            return(View(model));
        }
コード例 #2
0
        public ActionResult Index()
        {
            if (UserSettings == null)
            {
                UserSettings = new User();
            }

            IndexViewModel model = Mapper.Map <User, IndexViewModel>(UserSettings);

            if (_facebookMode == FacebookMode.Canvas && model.FacebookUserId == 0)
            {
                model.LogOnRedirectUrl = _facebookClient.GetLogOnUrl();
            }
            else if (_facebookMode == FacebookMode.Mobile && model.FacebookUserId == 0)
            {
                return(RedirectToAction("LogOn", "Account"));
            }

            return(View(model));
        }