// back options window public void pressGoBack(object sender, RoutedEventArgs e) { playlistOptions options = new playlistOptions(); this.Close(); options.Show(); }
public void pressBackToOptions(object sender, RoutedEventArgs e) { foreach (Window window in Application.Current.Windows.OfType <createPlaylist>()) { ((createPlaylist)window).Close(); } playlistOptions options = new playlistOptions(); this.Close(); options.Show(); }
/// <summary> /// Handles the Click event of the Submit Button. /// </summary> public void clickSubmit(object sender, RoutedEventArgs e) { // checks fields are not empty if (emailText.Text == "" || passwordText.Text == "") { this.message.Text = "fill all fileds please"; return; } DataBaseHandler dbhandler = DataBaseHandler.Instance; // check If User Exist And Password Right int ans = dbhandler.checkIfUserExistAndPasswordRight(emailText.Text, passwordText.Text); // if ans == 1 means that user exist and we can login if (ans == 1) { User currentUser = User.Instance; currentUser.Email = emailText.Text; currentUser.Id = dbhandler.getUserIdByEmail(emailText.Text); foreach (Window window in Application.Current.Windows.OfType <Home>()) { ((Home)window).Close(); } playlistOptions options = new playlistOptions(); this.Close(); options.Show(); } else { emailText.Text = ""; passwordText.Text = ""; this.message.Text = "wrong email or password"; } }