public void UpdateModel(Models.Program program, Person currentPerson)
        {
            var programPeopleToCommit = PersonIDList != null?PersonIDList.Select(x => new ProgramPerson(program.ProgramID, x)).ToList() : new List <ProgramPerson>();

            program.ProgramPeople.Merge(programPeopleToCommit,
                                        HttpRequestStorage.DatabaseEntities.ProgramPeople.Local,
                                        (x, y) => x.ProgramID == y.ProgramID && x.PersonID == y.PersonID);
        }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static GrantAllocationChangeLog CreateNewBlank(GrantAllocation grantAllocation, Person changePerson)
 {
     return(new GrantAllocationChangeLog(grantAllocation, changePerson, default(DateTime)));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static ProjectPerson CreateNewBlank(Project project, Person person, ProjectPersonRelationshipType projectPersonRelationshipType)
 {
     return(new ProjectPerson(project, person, projectPersonRelationshipType));
 }
        public static List <HtmlString> GetProjectStewardshipAreaHtmlStringList(this ProjectStewardshipAreaType projectStewardshipAreaType, Person person)
        {
            switch (projectStewardshipAreaType.ToEnum)
            {
            case ProjectStewardshipAreaTypeEnum.ProjectStewardingOrganizations:
                return(person.PersonStewardOrganizations.OrderBy(x => x.Organization.GetDisplayName()).ToList().Select(x => x.Organization.GetDisplayNameAsUrl()).ToList());

            case ProjectStewardshipAreaTypeEnum.TaxonomyBranches:
                return(person.PersonStewardTaxonomyBranches.OrderBy(x => x.TaxonomyBranch.TaxonomyBranchSortOrder).ThenBy(x => x.TaxonomyBranch.TaxonomyBranchName).Select(x => x.TaxonomyBranch.GetDisplayNameAsUrl()).ToList());

            case ProjectStewardshipAreaTypeEnum.GeospatialAreas:
                return(person.PersonStewardGeospatialAreas.OrderBy(x => x.GeospatialArea.GeospatialAreaShortName).ToList().Select(x => x.GeospatialArea.GetDisplayNameAsUrl()).ToList());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }