コード例 #1
0
 void ResetForm()
 {
     CurrentUserName.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentUserName.Clear(); });
     CurrentChatRoom.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentChatRoom.Clear(); });
     CurrentUserName.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentUserName.AppendText("Current User Name: " + SetNameTextBox.Text + "."); });
     CurrentChatRoom.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentChatRoom.AppendText("Current Chat Room: " + ChatRoomName.Text + "."); });
 }
コード例 #2
0
ファイル: UserTility.cs プロジェクト: dochoffiday/shov.in
        public static void LogoutCurrentUser(String redirectUrl)
        {
            if (!CurrentUserName.IsNullOrEmpty())
            {
                HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now;
                FormsAuthentication.SignOut();
            }

            if (!redirectUrl.IsNullOrEmpty())
            {
                HttpContext.Current.Response.Redirect(redirectUrl);
            }
            else
            {
                HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.PathAndQuery);
            }
        }
コード例 #3
0
        public async Task <IActionResult> CreateOrUpdateUser([FromBody] ProfileCRUDDTO profile)
        {
            if (string.IsNullOrEmpty(CurrentUserName))
            {
                return(Unauthorized());
            }

            if (!CurrentUserName.Equals(profile.Mobile))
            {
                return(Unauthorized());
            }

            profile.IdentityUserId = IdentityUserId;

            profile.Username = CurrentUserName;

            var result = await _profileService.CreateOrUpdateUserProfileAsync(profile);

            result.IsDoctor = User.IsInRole("doctor");

            return(Ok(result));
        }
コード例 #4
0
ファイル: UserManager.cs プロジェクト: sotakarjut/frontend
 public bool CanCurrentUserPostNews()
 {
     return(CurrentUserName.Equals("heislenger") || CurrentUserName.Equals("alegre") || !CanBeHacked(CurrentUser));
 }