Example #1
0
        static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("No arguments passed. ");
                Console.WriteLine("Usage Example 1: Dishes.exe morning, 1, 2, 3 ");
                Console.WriteLine("Usage Example 2: Dishes.exe night, 1, 2, 3, 4 ");
                return(-1);
            }

            try
            {
                string                inputOptions  = string.Join("", args);
                List <string>         optionsList   = inputOptions.Split(',').ToList();
                ProcessMenuConsole    consoleOutput = new ProcessMenuConsole();
                FactoryCreatorConsole createConsole = new FactoryCreatorConsole();
                ProcessMenuConsole    menuConsole   = (ProcessMenuConsole)createConsole.FactoryMethod();
                MenuRunner            menuRunner    = new MenuRunner();
                menuRunner.RunMenu(menuConsole, optionsList);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception occurred Message: {0} InnerException: {1} StackTrace: {2}", ex.Message, ex.InnerException, ex.StackTrace);
            }

            return(0);
        }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        MenuRunner playerScript = player.GetComponent <MenuRunner>();

        rb          = GetComponent <Rigidbody2D>();
        rb.velocity = new Vector2(playerScript.movingSpeed, 0);
    }
Example #3
0
        private void authication_Click(object sender, EventArgs e)
        {
            string          connection = "Database=prakt;" + "Data Source=127.0.0.1;" + "User Id=root;" + "Password="******"SELECT COUNT(*) ,RoleId,Password,Email,FirstName,LastName " +
                    "FROM user " + "WHERE Email LIKE'" + loginuse.Text + "'" +
                    " AND " +
                    "Password LIKE '" + password.Text + "';", connect);
                int    countuser = 0;
                string role      = "";
                string firsname  = "";
                string lasname   = "";
                string login     = "";

                MySqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    countuser = reader.GetInt32(0);
                    role      = reader.GetString("RoleId");
                    login     = reader.GetString("Email");
                    firsname  = reader.GetString("FirstName");
                    lasname   = reader.GetString("LastName");
                }
                reader.Close();
                if (countuser != 0)
                {
                    if (role == "R")
                    {
                        MenuRunner form = new MenuRunner(firsname, lasname);
                        form.Show();
                        this.Hide();
                    }
                    if (role == "A")
                    {
                        Admin form = new Admin(firsname, lasname);
                        form.Show();
                        this.Hide();
                    }
                    if (role == "C")
                    {
                        Coordinatormenu form = new Coordinatormenu(firsname, lasname);
                        form.Show();
                        this.Hide();
                    }
                }
                connect.Close();
            }
            catch (Exception ex)
            {
                label1.Text = "Введён неправильный логин или пароль";
            }
        }