void GridMouseRightClick(object sender, EventArgs e)
        {
            Window     window = win as Window;
            MainChoice main   = new MainChoice(userId, window.Left, window.Top);

            main.WindowState = window.WindowState;
            main.Show();
            window.Close();
        }
Exemplo n.º 2
0
        /// <summary>  runs the main menu for loading a file or quitting</summary>
        public static void MainMenu()
        {
            UtilityNamespace.Menu main = new UtilityNamespace.Menu("Main Menu"); //creates menu for the main menu
            main = main + "Get Name List from file" + "Quit";                    //defines choices in the menu
            MainChoice choice = (MainChoice)main.GetChoice();                    //displays menu and gets the users choice

            while (choice != MainChoice.QUIT)                                    //while choice is not quit keep running
            {
                NameMenu();                                                      //calls menu for user to interact with the NameList
                choice = (MainChoice)main.GetChoice();
            }
        }
Exemplo n.º 3
0
        //виклик методів моделі для перевірки логіну та паролю
        void enterWindow_EnterButtonClick(object sender, System.EventArgs e)
        {
            Window window = win as Window;

            if (model.Validate(win.LoginText, win.PasswordText))
            {
                int result = model.CheckUser(win.LoginText, win.PasswordText);
                if (result > 0)
                {
                    MainChoice newWin = new MainChoice(result, window.Left, window.Top);
                    newWin.Show();
                    window.Close();
                }
                else
                {
                    win.SendMessage("Не правильный логин или пароль");
                }
            }
            else
            {
                win.SendMessage("Логин и пароль должны содержать минимум 5 символов");
            }
        }