/// <summary> /// save account info and trvael log /// </summary> private void DisplaySaveAccountInfo() { bool maxAttemptsExceeded = false; bool saveAccountInfo = false; saveAccountInfo = _consoleView.DisplaySaveAccountInfo(_salesperson, out maxAttemptsExceeded); if (saveAccountInfo && !maxAttemptsExceeded) { CsvServices csvServices = new CsvServices(DataSettings.dataFilePathCsv); csvServices.WriteSalespersonToDataFile(_salesperson); _consoleView.DisplayConfirmSaveAccountInfo(); } }
/// <summary> /// load account info and trvael log /// </summary> private void DisplayLoadAccountInfo() { bool maxAttemptsExceeded = false; bool loadAccountInfo = false; if (_salesperson.AccountID == null) { loadAccountInfo = _consoleView.DisplayLoadAccountInfo(out maxAttemptsExceeded); } else { loadAccountInfo = _consoleView.DisplayLoadAccountInfo(_salesperson, out maxAttemptsExceeded); } if (loadAccountInfo && !maxAttemptsExceeded) { CsvServices csvServices = new CsvServices(DataSettings.dataFilePathCsv); _salesperson = csvServices.ReadSalespersonFromDataFile(); _consoleView.DisplayConfirmLoadAccountInfo(_salesperson); } }