Ejemplo n.º 1
0
        public ViewResult Detail(PersonPrimaryKey personPrimaryKey)
        {
            var person = personPrimaryKey.EntityObject;
            var userNotificationGridSpec    = new UserNotificationGridSpec();
            var userNotificationGridDataUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.UserNotificationsGridJsonData(personPrimaryKey));

            var basicProjectInfoGridSpec = new Views.Project.ProjectInfoForUserDetailGridSpec(CurrentPerson, person)
            {
                ObjectNameSingular  = $"{FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            const string basicProjectInfoGridName            = "userProjectListGrid";
            var          projectInfoForUserDetailGridDataUrl = SitkaRoute <UserController> .BuildUrlFromExpression(tc => tc.ProjectInfoForUserDetailGridJsonData(person));

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

            var agreements = GetAgreementsByPerson(person);
            var viewData   = new DetailViewData(CurrentPerson,
                                                person,
                                                basicProjectInfoGridSpec,
                                                basicProjectInfoGridName,
                                                projectInfoForUserDetailGridDataUrl,
                                                userNotificationGridSpec,
                                                "userNotifications",
                                                userNotificationGridDataUrl,
                                                activateInactivateUrl,
                                                agreements.Any(x => x.AgreementFileResourceID.HasValue));

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Ejemplo n.º 2
0
        public GridJsonNetJObjectResult <Notification> UserNotificationsGridJsonData(PersonPrimaryKey personPrimaryKey)
        {
            var person                   = personPrimaryKey.EntityObject;
            var gridSpec                 = new UserNotificationGridSpec();
            var notifications            = person.Notifications.OrderByDescending(x => x.NotificationDate).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Notification>(notifications, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Ejemplo n.º 3
0
        public ViewResult Detail(PersonPrimaryKey personPrimaryKey)
        {
            var person = personPrimaryKey.EntityObject;
            var userNotificationGridSpec    = new UserNotificationGridSpec();
            var userNotificationGridDataUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.UserNotificationsGridJsonData(personPrimaryKey));

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

            var viewData = new DetailViewData(CurrentPerson,
                                              person,
                                              userNotificationGridSpec,
                                              "userNotifications",
                                              userNotificationGridDataUrl,
                                              activateInactivateUrl);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
Ejemplo n.º 4
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));
        }