private void Confirm_Button(object sender, RoutedEventArgs e)//Click Generall Button { ClearPassError(); var data = new DataQ(); if (DataQ.CheckLog(loginText.Text, passwordBox.Password)) { Debug.WriteLine("My congratulate"); } else { loginText.BorderBrush = loginText.Foreground = passwordBox.BorderBrush = passwordBox.Foreground = Brushes.IndianRed; } }
private static bool Auth() { auth: Console.Write("Enter login:\t"); var login = Console.ReadLine(); Console.Write("Enter password:\t"); var pass = Console.ReadLine(); var success = DataQ.CheckLog(login, pass); if (success) { return(true); } Console.Write("wrong login or password\n"); goto auth; }
private void AddQ_Click(object sender, EventArgs e) { int number = 0; if (DataQ.Text != null && int.TryParse(DataQ.Text, out number)) { q.Enqueue(number); DataQ.Clear(); textBox1.Clear(); foreach (int i in q) { textBox1.Text = textBox1.Text + Environment.NewLine + i + " "; } } else { DataQ.Text = "Введите число"; } }
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { var data = new DataQ(); try { Debug.Write(@"Connecting to SQL Server ... "); using (var connection = new SqlConnection(data.Builder.ConnectionString)) { connection.Open(); Debug.WriteLine("Done."); } } catch (SqlException exception) { DataQ.DisplaySqlErrors(exception); //Debug.WriteLine(exception); } }