Example #1
0
 private void btnSignIn_Click(object sender, RoutedEventArgs e)
 {
     if (Login(txtEmail.Text, psdPassword.Password))
     {
         this.Close();
         PassbookList passBookList = new PassbookList();
         passBookList.Show();
     }
     else
     {
         signIn.ShowDialog();
     }
 }
Example #2
0
 private void btnSignIn_Click(object sender, RoutedEventArgs e)
 {
     if (txtEmail.Text.Length == 0)
     {
         MessageBox.Show("Enter an email");
         txtEmail.Focus();
     }
     else if (!Regex.IsMatch(txtEmail.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"))
     {
         MessageBox.Show("Enter a valid email");
         txtEmail.Select(0, txtEmail.Text.Length);
         txtEmail.Focus();
     }
     else if (psdPassword.Password.Length == 0)
     {
         MessageBox.Show("Enter an Password!");
         psdPassword.Focus();
     }
     //else
     //{
     //    SqlDataAdapter adapter = new SqlDataAdapter();
     //    adapter.SelectCommand = cmd;
     //    DataSet dataSet = new DataSet();
     //    adapter.Fill(dataSet);
     //}
     if (Login(txtEmail.Text, psdPassword.Password))
     {
         this.Close();
         PassbookList passBookList = new PassbookList();
         passBookList.Show();
     }
     else
     {
         MessageBox.Show("Tài khoản sai thông tin đăng nhập !!", "Thông Báo", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }