Example #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            AdminBooks ab = new AdminBooks();

            ab.Show();
            this.Close();
        }
Example #2
0
        private void CancelBtn_Click(object sender, RoutedEventArgs e)//nupp "Cancel"
        {
            //tagasi "AdminBooks" aknasse
            AdminBooks ab = new AdminBooks();

            ab.Show();
            this.Close();
        }
Example #3
0
 private void CancelBtn_Click(object sender, RoutedEventArgs e)//paneb aknat kinni
 {
     if (TValues.edit_type.Equals("user"))
     {
         UserControlPanel i = new UserControlPanel();
         i.Show();
         this.Close();
     }
     else if (TValues.edit_type.Equals("book"))
     {
         AdminBooks i = new AdminBooks();
         i.Show();
         this.Close();
     }
 }
Example #4
0
        private void SignUpbutton_Click(object sender, RoutedEventArgs e)//systeemi sisse logimine ja kasutaja tyypi m44ramine
        {
            Boolean msgbox = false;

            //fields have to be filled
            if (!string.IsNullOrWhiteSpace(EmailTxtbox.Text) && !string.IsNullOrWhiteSpace(PasswordBox.Password.ToString()))
            {
                foreach (User u in db.User.ToList())
                {
                    if (u.E_mail.Equals(EmailTxtbox.Text) && u.Password.Equals(PasswordBox.Password.ToString()))
                    {
                        userid = u.UserId;
                        if (u.Type == 0)
                        {
                            msgbox = false;
                            AdminBooks admin = new AdminBooks();
                            admin.Show();
                            this.Close();
                            break;
                        }
                        else if (u.Type == 1)
                        {
                            msgbox = false;
                            UserBooks user = new UserBooks();
                            user.Show();
                            this.Close();
                            break;
                        }
                    }
                    else
                    {
                        msgbox = true;
                    }
                }
            }
            else
            {
                MessageBox.Show("All fields have to be filled.", "Empty field",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            if (msgbox == true)
            {
                MessageBox.Show("Wrong e-mail or password.", "Error",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }