private void LoginWindow_btn_OK_Click(object sender, RoutedEventArgs e) { //DAL dal = new DAL(); if (bll.IsSuchUserNameInDB(Login_field.Text)) { // var data = Encoding.ASCII.GetBytes(Password_field.Password); if (bll.IsValidPassword(Login_field.Text, Password_field.Password)) { //login = bll.GetLoginWithName(Login_field.Text); IsSuccsesfullLogin = true; LoginName = Login_field.Text; LoginStatusName = bll.GetLoginStatusOfUser(LoginName); if (LoginStatusName == "user") { string[] userAddress = bll.GetCityStreetAndNumberOfUser(LoginName); City = userAddress[0]; Street = userAddress[1]; Number = userAddress[2]; } this.Close(); } else { MessageBox.Show("Wrong login or password"); IsSuccsesfullLogin = false; } } else { MessageBox.Show("Wrong login or password"); IsSuccsesfullLogin = false; } }