Exemplo n.º 1
0
        private void DisplaySaveAccountInfo()
        {
            bool maxAtemptsExceeded = false;
            bool saveAccountInfo    = false;

            saveAccountInfo = _consoleView.DisplaySaveAccountInfo(_salesperson, out maxAtemptsExceeded);

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

                xmlServices.WriteSalespersonToDataFile(_salesperson);

                _consoleView.DisplayConfirmSaveAccountInfo();
            }
        }
Exemplo n.º 2
0
        private void DisplayLoadAccountInfo()
        {
            bool maxAtemptsExceeded = false;
            bool loadAccountInfo    = false;

            if (_salesperson.AccountID != "")
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo(_salesperson, out maxAtemptsExceeded);
            }
            else
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo(out maxAtemptsExceeded);
            }

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

                _salesperson = xmlServices.ReadSalespersonFromDataFile();

                _consoleView.DisplayConfirmLoadAccountInfo(_salesperson);
            }
        }
Exemplo n.º 3
0
        public static void SeedDataFile()
        {
            XmlServices xmlService = new XmlServices(DataSettings.dataFilePathXml);

            xmlService.WriteSalespersonToDataFile(InitializeSalesperson());
        }