I'm newbie to this stack overflow so this is my first question.
I've made a return statement so if this validation return 1, it will open a new window, otherwise, it won't be opened. Here is my code :
private int UserPassValidation()
{
if (txtUserName.Equals("admin") && txtPassword.Equals("admin"))
{
return 1;
}
return 0;
}
private void LOGIN_BUTTON_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (UserPassValidation() == 1)
{
try
{
WindowView objWindowView = new WindowView();
objWindowView.ShowDialog();
}
catch (System.Data.EntityException)
{
MessageBox.Show("Entity Exception", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
else
{
MessageBox.Show("...");
}
}
So, there is a "Username and password validation" and sign in button. And then, I insert "admin" on txtusername and admin on txtpassword too.
Then, when i click sign in button, it won't be opened. I don't know why, but it's supposed to be opened.