コード例 #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
ファイル: Controller.cs プロジェクト: Skormie/TheSalesTracker
        private void ReadAccountInfo()
        {
            bool active;

            active = _consoleView.DisplayLoadAccountInfo(out bool attempted, _jsonService.ReadJsonFile());
            if (active)
            {
                _salesperson = _jsonService.ReadJsonFile();
                _consoleView.DisplayConfirmLoadAccountInfo(_salesperson);
                _salesperson.Logs.Push(DateTime.Now + " ... Account Information Loaded!");
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
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);
        }