private void enterToSystem_Click(object sender, RoutedEventArgs e) { try { BE.Mother temp = null; temp = bl.searchMother(this.idBox.Text); if (temp == null) { throw(new Exception("no exist")); } if (temp.Password != this.passwordBox.Password) { throw (new Exception("Incorrect password")); } existMother exstMom = new existMother(temp); exstMom.Show(); this.idBox.Clear(); this.passwordBox.Clear(); } catch (Exception p) { MessageBox.Show(p.Message); } }