Example #1
0
        static void Main(string[] args)
        {
            ICommandFactory factory = new StandardCommandFactory();

            ICommand cmd = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();
        }
Example #2
0
        static void Main(string[] args)
        {
            ICommand cmd = new ChangeUserPassowrdCmd(2, "qwerty123", "QWERTY1234");

            ICommandFactory factory = new StandardCommandFactory();


            cmd = factory.CreateCommand(cmd);
            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateCommand(cmd);

            cmd.Execute();
        }