Example #1
0
        /// <summary>
        /// Get data
        /// </summary>
        void GetData(Bundle savedInstanceState)
        {
            // try to get the run row guid from memory - potential set by activityresult
            if (_runNumber == null)
            {
                // try to get it from saved state, and finally from arguments
                _runNumber = savedInstanceState != null?
                             savedInstanceState.GetString(BundleArguments.RunNumber) : Arguments.GetString(BundleArguments.RunNumber);
            }

            // if the row run guid doesn't exist create a new run
            _run = _runNumber == null?RunService.CreateRun(_repository) : _repository.Find <Run>(_runNumber);

            // set the run row guid for persisting
            _runNumber = _run.RunNumber;

            _calls = _repository.Calls
                     .Where(x => x.RunNumber == _runNumber && !x.Removed)
                     .OrderBy(x => x.Sequence)
                     .ToList();
        }