Beispiel #1
0
 public Qualifications CreateQualificationsFor(Person person)
 {
     if (person.Qualifications != null)
         throw new InvalidOperationException("Person already has a Qualifications object attached");
     var qual = new Qualifications
     {
         Person = person,
     };
     person.Qualifications = qual;
     person.Validate();
     return qual;
 }
 private PersonnelRecordViewModel GeneratePersonnelRecordViewModel(Person person, bool editingMyRecord)
 {
     var viewModel = new PersonnelRecordViewModel();
     Mapper.Map<Person, PersonnelRecordViewModel>(person, viewModel);
     viewModel.EditingMyRecord = editingMyRecord;
     viewModel.SetHirePositions(flightProgramsRepository.GetAllPositions(), person.HirePosition);
     return viewModel;
 }
Beispiel #3
0
 public Person CreatePersonFor(User user)
 {
     if (user.Person != null)
         throw new InvalidOperationException("User already has a Person object attached");
     var person = new Person
     {
         User = user,
     };
     user.Person = person;
     user.Validate();
     return person;
 }