Exemplo n.º 1
0
        private void lblNewUser_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            switch (MyWinState)
            {
            case "GuestRequest":
            case "מתארח/נופש":
            {
                GuestRequestWin f = new GuestRequestWin(null, "add", MyLan);
                f.Show();
                this.Close();
                break;
            }

            case "Hoster":
            case "מארח":
            {
                HostWin f = new HostWin(null, "add", MyLan);
                f.Show();
                this.Close();
                break;
            }

            case "WebsiteOwner":
            case "מנהל אתר":
            {
                MessageBox.Show("You can't add new website owner!!!", "Pay Attention!!!", MessageBoxButton.OK, MessageBoxImage.Information);
                break;
            }

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void btnEnter_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                switch (MyWinState)
                {
                case "GuestRequest":
                case "מתארח/נופש":
                {
                    GuestRequest gr = BL.BLFactory.getBL().getGRByUserName(txtUserName.Text);
                    if (gr == null)
                    {
                        MessageBox.Show("The Guest Does Not Exist!", "WARNNING!!!", MessageBoxButton.OK, MessageBoxImage.Stop);
                    }
                    if (passwordBox.Password == gr.Password)
                    {
                        GuestRequestWin f = new GuestRequestWin(gr, "show", MyLan);
                        f.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("The password or the user-name is not corrent!", "WARNNING!!!", MessageBoxButton.OK, MessageBoxImage.Stop);
                    }

                    break;
                }

                case "Hoster":
                case "מארח":
                {
                    Host h = BL.BLFactory.getBL().getHostByUserName(txtUserName.Text);
                    if (h != null && passwordBox.Password == h.Password)
                    {
                        HostWin f = new HostWin(h, "show", MyLan);
                        f.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("The password or the user-name is not corrent!", "WARNNING!!!", MessageBoxButton.OK, MessageBoxImage.Stop);
                    }

                    break;
                }

                case "WebsiteOwner":
                case "מנהל אתר":
                {
                    if (txtUserName.Text == MyUserName && passwordBox.Password == MyPassword)
                    {
                        OwnerWin f = new OwnerWin(MyLan);
                        f.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("The password or the user-name is not corrent!", "WARNNING!!!", MessageBoxButton.OK, MessageBoxImage.Stop);
                    }
                    break;
                }

                default:
                    break;
                }
            }
            catch (MyException ex)
            {
                MessageBox.Show(ex.Message, "WARNNING!!!", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
        }