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); } }
protected StepViewModel(IDialogService dialogService, ISettings settings) { _dialogService = dialogService; _settings = settings; //TODO remove IDS ShowId = false; Validator = new ValidationHelper(); ModelStore = new VMStore(); }
public MainWindowViewModel() { _apiService = new APIService(); _updateService = new UpdateService(); _statsRepository = new StatsRepository(_apiService); _vmStore = new VMStore(); _vmStore.Add <SearchViewModel>((parameter) => new SearchViewModel(_updateService, this, parameter)); _vmStore.Add <DataViewModel>((parameter) => new DataViewModel(_statsRepository, this, parameter)); _vmStore.Add <MatchDetailsViewModel>((parameter) => new MatchDetailsViewModel(_statsRepository, this, parameter)); _vmStore.Add <LobbyViewModel>((parameter) => new LobbyViewModel(_statsRepository, this, parameter)); _vmStore.Add <TeamAnalyzeViewModel>((parameter) => new TeamAnalyzeViewModel(_statsRepository, this, parameter)); Navigate(ViewTypes.Search); }
public override void LoadFromStore(VMStore modelStore) { try { Enrollment = JsonConvert.DeserializeObject <ClientEnrollmentDTO>(modelStore.Store); ClientId = Enrollment.ClientId; SelectedIdentifierType = IdentifierTypes.FirstOrDefault(x => x.Id == Enrollment.IdentifierTypeId); Identifier = Enrollment.Identifier; RegistrationDate = Enrollment.RegistrationDate; Id = Enrollment.Id; practiceId = Enrollment.PracticeId; } catch (Exception e) { Mvx.Error(e.Message); } }
public override void LoadFromStore(VMStore modelStore) { try { Demographic = JsonConvert.DeserializeObject<ClientDemographicDTO>(modelStore.Store); Downloaded = Demographic.Downloaded; PersonId = Demographic.PersonId; FirstName = Demographic.FirstName; MiddleName = Demographic.MiddleName; LastName = Demographic.LastName; NickName = Demographic.NickName; SelectedGender = GenderOptions.FirstOrDefault(x => x.Value == Demographic.Gender); Age = Demographic.Age; if (!string.IsNullOrWhiteSpace(Demographic.AgeUnit)) SelectedAgeUnit = AgeUnitOptions.FirstOrDefault(x => x.Value == Demographic.AgeUnit); BirthDate = Demographic.BirthDate; } catch (Exception e) { Mvx.Error(e.Message); } }
public override void LoadFromStore(VMStore modelStore) { try { ContactAddress = JsonConvert.DeserializeObject <ClientContactAddressDTO>(modelStore.Store); PersonId = ContactAddress.PersonId; Downloaded = ContactAddress.Downloaded; Telephone = ContactAddress.Phone; Landmark = ContactAddress.Landmark; ContactId = ContactAddress.ContactId; AddressId = ContactAddress.AddressId; SelectedCounty = Counties.FirstOrDefault(x => x.Id == 0); SelectedSubCounty = SubCounties.FirstOrDefault(x => x.Id == 0); SelectedWard = Wards.FirstOrDefault(x => x.Id == 0); if (ContactAddress.CountyId.HasValue && ContactAddress.CountyId.Value > 0) { SelectedCounty = Counties.FirstOrDefault(x => x.Id == ContactAddress.CountyId); GetSubCounties(); } if (ContactAddress.SubCountyId.HasValue && ContactAddress.SubCountyId.Value > 0) { SelectedSubCounty = SubCounties.FirstOrDefault(x => x.Id == ContactAddress.SubCountyId); GetWards(); } if (ContactAddress.WardId.HasValue && ContactAddress.WardId.Value > 0) { SelectedWard = Wards.FirstOrDefault(x => x.Id == ContactAddress.WardId); } } catch (Exception e) { Mvx.Error(e.Message); } }
public virtual void LoadFromStore(VMStore modelStore) { }