コード例 #1
0
        /// <summary>
        /// display load account information
        /// </summary>
        private void DisplayLoadAccountInfo()
        {
            bool maxAttemptsExceeded = false;
            bool loadAccountInfo     = false;

            //
            // note: rather than pass null value, method is overloaded
            //
            if (_salesperson.AccountID != "")
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo(_salesperson, out maxAttemptsExceeded);
            }
            else
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo(out maxAttemptsExceeded);
            }

            if (loadAccountInfo && !maxAttemptsExceeded)
            {
                //CsvServices csvServices = new CsvServices(DataSettings.dataFilePathCsv);
                XmlServices xmlServices = new XmlServices(DataSettings.dataFilePathXml);

                //_salesperson = csvServices.ReadSalespersonFromDataFile();
                _salesperson = xmlServices.ReadSalespersonFromDataFile();

                _consoleView.DisplayConfirmLoadAccountInfo(_salesperson);
            }
        }
コード例 #2
0
        private void DisplayLoadAccountInfo()
        {
            bool loadAccountInfo = false;

            if (_salesperson.AccountID != "")
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo();
            }
            else
            {
                loadAccountInfo = _consoleView.DisplayLoadAccountInfo();
            }
            if (loadAccountInfo)
            {
                XmlServices xmlServices = new XmlServices(DataSettings.dataFilePathXml);

                _salesperson = xmlServices.ReadSalespersonFromDataFile();

                _consoleView.DisplayConfirmLoadAccountInfo(_salesperson);
            }
        }
コード例 #3
0
        private void DisplayLoadAccountInfo()
        {
            bool maxAttemptsExceeded = false;
            bool loadAccountInfo     = false;

            /*if (_salesperson.AccountID != "")
             * {
             *  loadAccountInfo = _consoleView.DisplayLoadAccountInfo(_salesperson, out maxAttemptsExceeded);
             * }
             * else
             * {
             *  loadAccountInfo = _consoleView.DisplayLoadAccountInfo(out maxAttemptsExceeded);
             * }
             * if (loadAccountInfo && maxAttemptsExceeded)
             */
            XmlServices xmlServices = new XmlServices(DataSettings.dataFilePathXml);

            xmlServices.ReadSalespersonFromDataFile();

            _consoleView.DisplayConfirmLoadAccountInfo(_salesperson);
        }