Exemple #1
0
        public Client(string name, Bancomat b)
        {
            Name  = name;
            _bank = b;

            _bank.Withdrawn        += _bank_Withdrawn;
            _bank.Not_enough_money += _try_Withdrawn;
        }
Exemple #2
0
        public Collector(int id, Bancomat b)
        {
            ID_Collector = id;
            _bank        = b;

            _bank.Balance_Zero     += _The_ATM_needs_attention;
            _bank.Min_Balance      += _The_ATM_needs_attention;
            _bank.Not_enough_money += _The_ATM_needs_attention;
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Inbox box = new Inbox();

            box.Folder_processed();
            box.Folder_Errors();


            Bancomat  account = new Bancomat(456, "str.Lubarskogo, 65");
            Collector collect = new Collector(1, account);

            account.Put_money(1000);


            do
            {
                Console.WriteLine("\t===================================");
                Console.WriteLine("\t|                                 | ");
                Console.WriteLine("\t| Input you name:                 |");
                Console.WriteLine("\t|                                 | ");
                Console.Write("\t|\t ");
                string Name = Console.ReadLine();
                Console.WriteLine("\t|                                 | ");

                Client     client = new Client(Name, account);
                Management manag  = new Management("Tom", account, client);

                Console.WriteLine("\t| How much you want to withdraw?  |");
                Console.WriteLine("\t|                                 | ");
                Console.Write("\t|\t ");

                int summ = Int32.Parse(Console.ReadLine());
                Console.WriteLine("\t|                                 | ");


                Request req = new Request();
                req.ClientName = client.Name;
                req.Sum        = summ;

                File.WriteAllText(@"FileWatcher\Request.json", JsonConvert.SerializeObject(req));

                if (box.FileWatcher() == true)
                {
                    account.Withdraw(req);
                    box.Move_File_Folder_processed();
                    Console.WriteLine($"\t|   Get you {req.Sum}$                   |");
                }
                Console.WriteLine("\t===================================\n\n");
            }while (Console.ReadKey().Key != ConsoleKey.Escape);


            Console.ReadLine();
        }
Exemple #4
0
        public Management(string name, Bancomat b, Client c)
        {
            Name    = name;
            _bank   = b;
            _client = c;

            _bank.Adding           += _Operations_with_ATM;
            _bank.Balance_Zero     += _Operations_with_ATM;
            _bank.Withdrawn        += _Operations_with_ATM;
            _bank.Min_Balance      += _Operations_with_ATM;
            _bank.Not_enough_money += _Operations_with_ATM;
        }