Example #1
0
        public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(PersonPrimaryKey personPrimaryKey)
        {
            var person                   = personPrimaryKey.EntityObject;
            var gridSpec                 = new Views.Project.UserProjectGridSpec(CurrentFirmaSession, person);
            var projectPersons           = person.GetProjectsWhereYouAreAContact();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectPersons, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Example #2
0
        public ViewResult Detail(PersonPrimaryKey personPrimaryKey)
        {
            ShowWarningAboutInactivatedUserForOrganizationPrimaryContact(personPrimaryKey.EntityObject);

            var person = personPrimaryKey.EntityObject;
            var userNotificationGridSpec    = new UserNotificationGridSpec();
            var userNotificationGridDataUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(
                    x => x.UserNotificationsGridJsonData(personPrimaryKey));

            var basicProjectInfoGridSpec = new Views.Project.UserProjectGridSpec(CurrentFirmaSession, person)
            {
                ObjectNameSingular =
                    $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} where {person.GetFullNameFirstLast()} is a Contact",
                ObjectNamePlural =
                    $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} where {person.GetFullNameFirstLast()} is a Contact",
                SaveFiltersInCookie = true
            };
            const string basicProjectInfoGridName    = "userProjectListGrid";
            var          basicProjectInfoGridDataUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(person));

            var activateInactivateUrl =
                SitkaRoute <UserController> .BuildUrlFromExpression(x => x.ActivateInactivatePerson(person));

            var actionItemsGridSpec    = new ActionItemsUserGridSpec(CurrentFirmaSession);
            var actionItemsGridName    = "actionItems";
            var actionItemsGridDataUrl = SitkaRoute <ActionItemController> .BuildUrlFromExpression(c => c.ActionItemsUserGridJsonData(person));

            var viewData = new DetailViewData(this.CurrentFirmaSession,
                                              person,
                                              basicProjectInfoGridSpec,
                                              basicProjectInfoGridName,
                                              basicProjectInfoGridDataUrl,
                                              userNotificationGridSpec,
                                              "userNotifications",
                                              userNotificationGridDataUrl,
                                              activateInactivateUrl,
                                              actionItemsGridSpec,
                                              actionItemsGridName,
                                              actionItemsGridDataUrl);

            return(RazorView <Detail, DetailViewData>(viewData));
        }