private void executeGetPersonsFromDbCommand(object obj) { PhotoFromDbView view = new PhotoFromDbView(); PhotoFromDbViewModel photoFromDbViewModel = new PhotoFromDbViewModel(view, this.getProxy()); view.ViewModel = photoFromDbViewModel; view.Owner = this.view; view.WindowStartupLocation = WindowStartupLocation.CenterOwner; view.ShowInTaskbar = false; if (view.ShowDialog() == true) { Person person = photoFromDbViewModel.SelectedPerson; this.YearStart = person.DateOfBirth.Year.ToString(); this.YearEnd = this.YearStart; this.nationality = person.NationalityId; UFO.Nationality nationality = new UFO.Nationality(person.NationalityId, person.NationalityName); List <UFO.Nationality> list = new List <UFO.Nationality>(); list.Add(nationality); this.Nationalities = list; Sex sex = new Sex(person.Sex); this.Sex = sex; this.LoadImageFromArray(person.ImageArray, person.FullName); } }
public PhotoFromDbViewModel(PhotoFromDbView view, PhotoSearchServiceClient proxy) { this.view = view; this.proxy = proxy; this.dbWorker = new DbWorker(); //this.birthday = new DateTime(); this.operationDateStart = DateTime.Now.Date; this.operationDateEnd = this.operationDateStart.Add(new TimeSpan(23, 59, 59)); //this.personNames = getPersonNamesList(); //this.personNames.Add("Иванов Петр Петрович"); //this.personNames.Add("Сидоров Иван Евгеньевич"); //this.personNames.Add("Петров Петр Петрович"); }