Exemple #1
0
        private PartialViewResult ViewEditPersonOrganizations(EditPersonOrganizationsViewModel viewModel)
        {
            var allOrganizations = HttpRequestStorage.DatabaseEntities.Organizations.GetActiveOrganizations().Select(x => new OrganizationSimple(x)).ToList();
            var viewData         = new EditPersonOrganizationsViewData(allOrganizations);

            return(RazorPartialView <EditPersonOrganizations, EditPersonOrganizationsViewData, EditPersonOrganizationsViewModel>(viewData, viewModel));
        }
Exemple #2
0
        public PartialViewResult EditPersonOrganizationPrimaryContacts(PersonPrimaryKey personPrimaryKey)
        {
            var person          = personPrimaryKey.EntityObject;
            var organizationIDs = person.OrganizationsWhereYouAreThePrimaryContactPerson.Select(org => org.OrganizationID).ToList();
            var viewModel       = new EditPersonOrganizationsViewModel(organizationIDs);

            return(ViewEditPersonOrganizations(viewModel));
        }
Exemple #3
0
        public ActionResult EditPersonOrganizationPrimaryContacts(PersonPrimaryKey personPrimaryKey, EditPersonOrganizationsViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEditPersonOrganizations(viewModel));
            }
            var person = personPrimaryKey.EntityObject;

            viewModel.UpdateModel(person, HttpRequestStorage.DatabaseEntities.Organizations.ToList());
            return(new ModalDialogFormJsonResult());
        }