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); }
public UserInterface() { this.storage = new Storage(); this.expense = new Expense(); this.income = new Income(); this.visualisation = new VisualisationData(); this.service = new AnaliseServices(); }