コード例 #1
0
        protected void SignInButtonClick(object sender, EventArgs e)
        {
            AuthMultiView.ActiveViewIndex = 1;
            MessageSignInLabel.Text       = string.Empty;
            var response = _customerInfoRepository.SignIn(EmailText.Text, PasswordText.Text);

            if (!response.IsSuccessful)
            {
                MessageSignInLabel.Text = response.Message.First();
                return;
            }

            CacheLayer.Clear(CacheKeys.CustomerInfosCacheKey);

            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, typeof(string), "setSession", string.Format("window.userSession = '{0}'; window.useremail = '{1}';", response.AccessKey, EmailText.Text), true);
            if (!string.IsNullOrEmpty(response.SearchPageUrl) && HttpContext.Current.Session["SearchPage"] == null)
            {
                HttpContext.Current.Session["SearchPage"] = response.SearchPageUrl;
            }

            HttpContext.Current.Session["UserSession"] = response.AccessKey;
        }