public override void LoadFromStore(VMStore modelStore) { try { Profile = JsonConvert.DeserializeObject <ClientProfileDTO>(modelStore.Store); Downloaded = Profile.Downloaded; ClientId = Profile.ClientId; SelectedMaritalStatus = MaritalStatus.FirstOrDefault(x => x.Id == Profile.MaritalStatus); SelectedKeyPop = KeyPops.FirstOrDefault(x => x.Id == Profile.KeyPop); OtherKeyPop = Profile.OtherKeyPop; SelectedEducation = Educations.FirstOrDefault(x => x.ItemId == Profile.Education); SelectedCompletion = Completions.FirstOrDefault(x => x.ItemId == Profile.Completion); SelectedOccupation = Occupations.FirstOrDefault(x => x.ItemId == Profile.Occupation); if (null != Profile.RelTypeId && !string.IsNullOrWhiteSpace(Profile.RelTypeId)) { SelectedRelationshipType = RelationshipTypes.FirstOrDefault(x => x.Description.ToLower() == Profile.RelTypeId.ToLower()); } } catch (Exception e) { Mvx.Error(e.Message); } }
public override void Start() { base.Start(); MaritalStatus = _lookupService.GetMaritalStatuses(true).ToList(); KeyPops = _lookupService.GetKeyPops(true).ToList(); Educations = _lookupService.GetCategoryItems("Education", true, "[Select Education]").ToList(); Completions = _lookupService.GetCategoryItems("Completion", true, "[Select Completion]").ToList(); Occupations = _lookupService.GetCategoryItems("Occupation", true, "[Select Occupation]").ToList(); try { SelectedMaritalStatus = MaritalStatus.FirstOrDefault(x => x.Id == ""); SelectedKeyPop = KeyPops.FirstOrDefault(x => x.Id == ""); SelectedEducation = Educations.FirstOrDefault(x => x.Id == Guid.Empty); SelectedCompletion = Completions.FirstOrDefault(x => x.Id == Guid.Empty); SelectedOccupation = Occupations.FirstOrDefault(x => x.Id == Guid.Empty); } catch {} }