Exemple #1
0
        private void ButtonBack_Click(object sender, RoutedEventArgs e)
        {
            Admin_Window a = new Admin_Window();

            a.Show();
            this.Close();
        }
Exemple #2
0
        private void Sumbit_Click(object sender, RoutedEventArgs e)
        {
            if ((IDFill.Text == "207590225" || IDFill.Text == "318795093") && PasswordFill.Text == "111111111")//if it is the admin,efrat or talya
            {
                Admin_Window ad = new Admin_Window();
                ad.Show();
                this.Close();
                return;
            }
            try
            {
                if (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem) != null)
                {
                    switch (((ComboBoxItem)ComboBox_of_HostOrGuest.SelectedItem).Content.ToString())
                    {
                    case " אורח ":
                    {
                        MyGuest temp = bl.getMyGuest(bl.FindMyGuest(IDFill.Text));
                        if (temp.Password != PasswordFill.Text)
                        {
                            MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "סיסמתך אינה נכונה");
                            x.ShowDialog();
                        }
                        Guest_Window(temp);
                        break;
                    }

                    case " מארח ":
                    {
                        MyHost temp = bl.getMyHost(bl.FindMyHost(IDFill.Text));
                        if (temp.Password_host != PasswordFill.Text)
                        {
                            MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "סיסמתך אינה נכונה אנא נסה שוב");
                            x.ShowDialog();
                        }
                        else
                        {
                            MyHostWindow hostWindow = new MyHostWindow(temp);
                            hostWindow.Show();
                            Close();
                        }

                        break;
                    }
                    }
                }
                else
                {
                    MessageBox_Project x = new MessageBox_Project(":שִׂים לֵב ", "לא מילאת את כל הפרטים " + "\n" + "אנא מלא שוב את כל הפרטים");
                    x.ShowDialog();

                    Window_Password window = new Window_Password();
                    window.Show();
                }
            }
            catch (ArgumentException exp)
            {
                MessageBox.Show(exp.Message);
            }
        }