예제 #1
0
        private void SaveAccountInfo()
        {
            bool active;

            active = _consoleView.DisplaySaveAccountInfo(_salesperson, out bool attempted);
            if (active)
            {
                _consoleView.DisplayConfirmSaveAccountInfo();
                _jsonService.WriteJsonFile(_salesperson);
                _salesperson.Logs.Push(DateTime.Now + " ... Account Information Saved!");
            }
        }
예제 #2
0
        private void DisplaySaveAccountInfo()
        {
            bool saveAccountInfo = false;

            saveAccountInfo = _consoleView.DisplaySaveAccountInfo(_salesperson);

            if (saveAccountInfo)
            {
                XmlServices xmlServices = new XmlServices(DataSettings.dataFilePathXml);

                xmlServices.WriteSalespersonToDataFile(_salesperson);

                _consoleView.DisplayConfirmSaveAccountInfo();
            }
        }
        /// <summary>
        /// display save account information
        /// </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);
                XmlServices xmlServices = new XmlServices(DataSettings.dataFilePathXml);

                //csvServices.WriteSalespersonToDataFile(_salesperson);
                xmlServices.WriteSalespersonToDataFile(_salesperson);

                _consoleView.DisplayConfirmSaveAccountInfo();
            }
        }