Exemplo n.º 1
0
        public void LoadPersonalData()
        {
            PersonModelBase person;

            if (_parameters.UseExplorer)
            {
                person = _localStorageService.GetPerson(_controls.Name);
            }
            else
            {
                var dbPerson = _databaseService.GetPersonalData(_controls.Name);

                if (dbPerson == null)
                {
                    return;
                }

                person = new PersonModelBase
                {
                    Id      = dbPerson.Id,
                    Name    = dbPerson.Name,
                    Age     = (int)dbPerson.Age,
                    Address = dbPerson.Address,
                    Details = dbPerson.Details
                };
            }

            _controls.Age     = person.Age.ToString();
            _controls.Address = person.Address;
            _controls.Details = person.Details;
        }