Ejemplo n.º 1
0
        private void SendDataToStorage(int operation, IInputOutputData inputDataOperation, Storage storage)
        {
            DateTime date;
            decimal  money;

            Console.WriteLine("Введите дату в формате: YYYY/MM/DD");
            while (!TryParseMydate(Console.ReadLine(), out date))
            {
                Console.WriteLine("Введите дату в формате: YYYY/MM/DD");
            }
            if (operation == 1)
            {
                Console.Write("Введите сумму поступления:");
            }
            else
            {
                Console.Write("Введите сумму расхода:");
            }
            while (!decimal.TryParse(Console.ReadLine(), out money) || money < 0)
            {
                if (operation == 1)
                {
                    Console.Write("Введите корректно данные!\nВведите сумму поступления:");
                }
                else
                {
                    Console.Write("Введите корректно данные!\nВведите сумму расхода:");
                }
            }
            inputDataOperation.Input(date, money, storage);
        }
Ejemplo n.º 2
0
 public UserInterface()
 {
     this.storage       = new Storage();
     this.expense       = new Expense();
     this.income        = new Income();
     this.visualisation = new VisualisationData();
     this.service       = new AnaliseServices();
 }