private void StartResolve() { if (string.IsNullOrEmpty(UserTextBox.Text)) { MessageBox.Show("You must enter a search term.", "Missing Search Term", MessageBoxButton.OK); UserTextBox.Focus(); return; } try { this.Cursor = Cursors.Wait; PeopleSoapClient ps = new PeopleSoapClient(); ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx"); ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted); ps.SearchPrincipalsAsync(UserTextBox.Text, 50, SPPrincipalType.User); } catch (Exception ex) { MessageBox.Show("There was a problem executing the search; please try again " + "later.", "Search Error", MessageBoxButton.OK); this.Cursor = Cursors.Arrow; } }
private void SendButton_Click(object sender, EventArgs e) { if (connected == true) { if (currentUser == null) { currentUser = UserTextBox.Text; sw.WriteLine(currentUser); } else { try { string message = UserTextBox.Text; Message newMessage = new Message(currentUser, message); messageList.Add(newMessage); sw.WriteLine(currentUser + ": " + message); } catch { ChatRichTextBox.AppendText("Failed to deliver message \n"); } } sw.Flush(); UserTextBox.Clear(); } else { MessageBox.Show("Not connected to server."); } }
private void ServerTextBox_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Enter) { UserTextBox.Select(); } }
public void LoginAccess() { string UserName = UserTextBox.Text; string UserPass = PasswordTextBox.Password; foreach (User u in dbContext.Users) { if (u.UserName == UserName) { if (u.Password == UserPass) { App.Current.Properties["username"] = UserTextBox.Text; App.Current.Properties["IsAdmin"] = u.IsAdmin; window.UserNameLabel.Content = App.Current.Properties["username"].ToString(); window.Effect = null; window.ListViewMenu.SelectedItem = window.ListViewHome; window.IsEnabled = true; window.userIsAdmin = (bool)App.Current.Properties["IsAdmin"]; Close(); } } } UserTextBox.Clear(); PasswordTextBox.Clear(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { ServerTextBox.Text = Properties.Settings.Default.Server; if (ServerTextBox.Text != "") { UserTextBox.Focus(); } }
/// <summary> /// Очищает все TextBox. /// </summary> void ClearTextBox() { TargetAddressTextBox.Clear(); ICAOTypeCodeTextBox.Clear(); RegistrationTextBox.Clear(); TypeAircraftTextBox.Clear(); CountryTextBox.Clear(); ClassTextBox.Clear(); UserTextBox.Clear(); }
private void UserCueText_Click(object sender, EventArgs e) { if (UserTextBox.Text.Trim() == "") { UserCueText.Hide(); } else if (UserTextBox.Text.Trim() != "" && UserCueText.Visible == false) { UserCueText.Hide(); } UserTextBox.Focus(); }
private void FailedAttempt() { CustomMessageBox.Show("Usuario no encontrado. Por favor verifique que sus datos sean correctos."); UserTextBox.Clear(); PasswordTextBox.Clear(); _attempts++; if (_attempts == ALLOWEDATTEMTPS) { _lockedLogin = true; LoginButton.IsEnabled = false; CustomMessageBox.Show("Ah sobre pasado el numero de intentos disponibles, intente mas tarde"); } }
private void SetupFocus() { if (string.IsNullOrEmpty(ViewModel.Username)) { UserTextBox.Focus(FocusState.Programmatic); } else if (string.IsNullOrEmpty(ViewModel.Host)) { HostTextBox.Focus(FocusState.Programmatic); } else { Focus(FocusState.Programmatic); } }
private void UserNotFound() { intentos++; if (intentos <= 3) { MessageBox.Show("Usuario(ID) o Contraseña incorrectos.", "Credenciales Inválidos", MessageBoxButtons.OK, MessageBoxIcon.Error); UserTextBox.Focus(); } else { if (intentos > 3) { MessageBox.Show("Ha excedido el limites de intentos para acceder al sistema", "Sistema Bloqueado", MessageBoxButtons.OK, MessageBoxIcon.Warning); Application.Exit(); } } }
private void SetupFocus() { SshProfileViewModel vm = (SshProfileViewModel)DataContext; if (string.IsNullOrEmpty(vm.Username)) { UserTextBox.Focus(FocusState.Programmatic); } else if (string.IsNullOrEmpty(vm.Host)) { HostTextBox.Focus(FocusState.Programmatic); } else { Focus(FocusState.Programmatic); } }
private void OnUserInviteButtonClicked(object sender, System.Windows.RoutedEventArgs e) { var username = UserTextBox.Text; string factoryString = (string)FactoryDropdown.SelectedItem; int factoryID = HelperFunctions.GetIdFromFactoryString(factoryString); String message = "User " + username + " konnte nicht hinzugefügt werden."; Boolean success = csu.AddMemberToMemberAccess(factoryID, username); if (success) { message = "User " + username + " wurde erfolgreich zu " + factoryString + " hinzugefügt"; } ShowPopUp(message); UserTextBox.Clear(); }
private void AddButton_Click(object sender, RoutedEventArgs e) { if (String.IsNullOrEmpty(ServerTextBox.Text) || String.IsNullOrEmpty(UserTextBox.Text) || String.IsNullOrEmpty(PasswordBox.Password)) { MessageBox.Show("Preencha os dados da Idrac", "Aviso", MessageBoxButton.OK, MessageBoxImage.Information); return; } var server = new Server(ServerTextBox.Text, UserTextBox.Text, PasswordBox.Password); ServersListBox.Items.Add(server); ServerTextBox.Clear(); if (!KeepCheckbox.IsChecked.Value) { UserTextBox.Clear(); PasswordBox.Clear(); } }
private void Button_Click(object sender, RoutedEventArgs e) { SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=myDatabase;Integrated Security=True"); SqlCommand com = new SqlCommand(); int i = 0; try { if ((UserTextBox.Text == string.Empty) || (PassTextBox1.Text == string.Empty)) { MessageBox.Show("Please enter a User Name and a Password", "Error", MessageBoxButton.OK, MessageBoxImage.Error); UserTextBox.Focus(); return; } com = new SqlCommand("SELECT COUNT(*) FROM Table_1 WHERE UserName='******' AND Password='******' AND Active='" + true + "'", con); if (con.State == ConnectionState.Closed) { con.Open(); i = (int)com.ExecuteScalar(); } con.Close(); if (i > 0) { MessageBox.Show("Login Successfull", "", MessageBoxButton.OK, MessageBoxImage.Information); this.Hide(); } else { MessageBox.Show("Incorrect User Name or Password", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } UserTextBox.Text = ""; PassTextBox1.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { i = 0; con.Close(); } }
private async void Authenticate(Client tentativeClient) { ErrorMessage.Text = ""; Client authClient = await ClientAPI.Auth(tentativeClient); if (authClient != null) { // set as active client and change panel ActiveClient = authClient; ChangeActivePanel(MainForm.Panel.Home); } else { ErrorMessage.Text = "Informations de connexion erronées."; UserTextBox.Text = ""; PasswordTextBox.Text = ""; UserTextBox.Focus(); } }
private async void AuthorizeButton_Click(object sender, RoutedEventArgs e) { if (!(DataContext is GfycatPreset preset)) { return; } if (string.IsNullOrWhiteSpace(UserTextBox.Text) || PasswordTextBox.SecurePassword.Length < 1) { StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.Credentials")); return; } try { ThisPanel.IsEnabled = false; StatusBand.Hide(); //When in authenticated mode, the user must authorize the app by using the username and password. if (await Gfycat.GetTokens(preset, UserTextBox.Text, PasswordTextBox.Password)) { StatusBand.Info(LocalizationHelper.Get("S.Options.Upload.Preset.Info.Authorized")); UserTextBox.Clear(); PasswordTextBox.Clear(); return; } StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.AuthError")); UserTextBox.Focus(); } catch (Exception ex) { LogWriter.Log(ex, "Authorizing access - Gfycat"); StatusBand.Error(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.AuthError"), () => new ExceptionViewer(ex).ShowDialog()); UserTextBox.Focus(); } finally { ThisPanel.IsEnabled = true; } }
private void LoginBtn_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=PHONEANDMORE;Integrated Security=True"); conn.Open(); SqlCommand SelectUsername = new SqlCommand("select Type from Creds where UserName = '******'and Password ='******'", conn); SqlDataReader UserReader; UserReader = SelectUsername.ExecuteReader(); if (UserReader.Read() == true) { if (UserReader[0].ToString() == "admin" || UserReader[0].ToString() == "user") { MainMenu ah = new MainMenu(); ah.get(UserTextBox.Text); ah.ShowDialog(); this.Close(); } } else { if (UserTextBox.Text == "Elbeld" && PassTextBox.Text == "stG65gr5") { MainMenu ah = new MainMenu(); ah.get(UserTextBox.Text); ah.ShowDialog(); this.Close(); } else { MessageBox.Show(" incorrect Username or Password, Please check your entries correctly ", "\t\t Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); UserTextBox.Clear(); PassTextBox.Clear(); UserTextBox.Focus(); conn.Close(); UserReader.Close(); } } conn.Close(); }
private void SubmitButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(UserTextBox.Text)) { UserTextBox.Focus(); UserTextBox.BackColor = Color.LightPink; return; } if (string.IsNullOrWhiteSpace(TitleTextBox.Text)) { TitleTextBox.Focus(); TitleTextBox.BackColor = Color.LightPink; return; } if (string.IsNullOrWhiteSpace(DescriptionTextBox.Text)) { DescriptionTextBox.Focus(); DescriptionTextBox.BackColor = Color.LightPink; return; } ReportData rd = new ReportData { Id = ErrorIdTextBox.Text, User = UserTextBox.Text, DateTime = RegistrationDatePicker.Value, Title = TitleTextBox.Text, Description = DescriptionTextBox.Text, Urgent = UrgentCheckBox.Checked, Type = BugRadioButton.Checked ? ReportType.BUG : DocumentationIssueRadioButton.Checked ? ReportType.DOCUMENTATION : PerformanceIssueRadioButton.Checked ? ReportType.PERFORMANCE : ReportType.NOTICE }; Clear(); DescriptionTextBox.Text = System.Text.Json.JsonSerializer.Serialize <ReportData>(rd); }
private bool FieldsValidation() { if (!string.IsNullOrEmpty(UserTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Password)) { Regex rgx = new Regex(@"^[a-zA-Z0-9]+$"); if (rgx.IsMatch(UserTextBox.Text)) { return(true); } else { CustomMessageBox.Show("Campos erróneos. Por favor asegurese de introducir datos alfanumericos en usuario."); UserTextBox.Clear(); PasswordTextBox.Clear(); return(false); } } else { CustomMessageBox.Show("Campos incompletos. Por favor asegurese de no dejar campos vacíos."); return(false); } }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(UserTextBox.Text)) { errorProvider.SetError(UserTextBox, "Este Campo Esta vacio"); UserTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(PassWordTextBox.Text)) { errorProvider.SetError(PassWordTextBox, "Este Campo Esta vacio"); PassWordTextBox.Focus(); paso = false; } if (PassWordTextBox.TextLength < 8) { errorProvider.SetError(PassWordTextBox, "Las contraseñas son mayor o igual a 8 caracteres"); PassWordTextBox.Focus(); paso = false; } return(paso); }
protected void Page_Load(object sender, EventArgs e) { UserTextBox.Focus(); //フォーカスの自働セット this.Form.DefaultButton = LogonButton.UniqueID; //Enterでログオン処理 }
public void Limpar() { UserTextBox.ResetText(); SenhaTextBox.ResetText(); }
private void button1_Click(object sender, EventArgs e) { UserTextBox.Text = ""; PasswordTextBox.Clear(); UserTextBox.Focus(); }
private void ResetButton_Click(object sender, System.EventArgs e) { PassTextBox.Clear(); FirstTextBox.Clear(); LastTextBox.Clear(); ConfirmPassTextBox.Clear(); GmailTextBox.Clear(); UserTextBox.Clear(); }
/// <summary> /// Log In Button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { Connection conn = new Connection(); SqlConnection sqlcon = new SqlConnection(conn.getString()); try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlDataReader myReader = null; SqlCommand sqlcomm = new SqlCommand(conn.getLogInQuery(), sqlcon); sqlcomm.Parameters.AddWithValue("@UserName", UserTextBox.Text.Trim()); sqlcomm.Parameters.AddWithValue("@Pass", passBox.Password); myReader = sqlcomm.ExecuteReader(); Boolean valid = false; while (myReader.Read()) { this.Hide(); SqlCommand urole = new SqlCommand(conn.getRole(), sqlcon); if (myReader.GetString(1) == UserTextBox.Text && myReader.GetString(2) == passBox.Password) { valid = true; if (myReader.GetString(3) == "Admin") { Admin a = new Admin(); a.Show(); } else if (myReader.GetString(3) == "Customer") { Customer cu = new Customer(); cu.Show(); } else if (myReader.GetString(3) == "Bank") { Bank b = new Bank(); b.Show(); } } } if (!valid) { var metroWindow = (Application.Current.MainWindow as MetroWindow); metroWindow.ShowMessageAsync("Warning", "Wrong Username or Password"); } UserTextBox.Clear(); passBox.Clear(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sqlcon.Close(); } }
public Window1() { InitializeComponent(); UserTextBox.Focus(); }