예제 #1
0
        public ProposedViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = FieldDefinitionEnum.Proposal.ToType().GetFieldDefinitionLabelPluralized();

            HasProposeProjectPermissions = new ProjectCreateFeature().HasPermissionByFirmaSession(currentFirmaSession);
            ProposeNewProjectUrl         = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));

            GridSpec = new ProposalsGridSpec(currentFirmaSession)
            {
                ObjectNameSingular = $"{FieldDefinitionEnum.Proposal.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Proposal.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            if (new ProjectCreateNewFeature().HasPermissionByFirmaSession(currentFirmaSession))
            {
                GridSpec.CustomExcelDownloadUrl =
                    SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.ProposalsExcelDownload());
            }
            if (new ProjectCreateFeature().HasPermissionByFirmaSession(currentFirmaSession))
            {
                GridSpec.CreateEntityActionPhrase    = "Propose a New Project";
                GridSpec.CreateEntityModalDialogForm = null;
            }
            GridName    = "proposalsGrid";
            GridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.ProposedGridJsonData());
        }
        public MyOrganizationsProjectsViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession, firmaPage)
        {
            //TODO: It shouldn't be possible to reach this if Person.Organization is null...
            var currentPerson = currentFirmaSession.Person;
            var organizationNamePossessive = currentPerson.Organization.GetOrganizationNamePossessive();

            PageTitle = $"{organizationNamePossessive} {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}";
            var projectDetails = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID);

            ProjectCustomDefaultGridSpec = new ProjectCustomGridSpec(currentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, currentFirmaSession.Tenant)
            {
                ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            ProjectCustomDefaultGridName    = "myOrganizationsProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.MyOrganizationProjectsCustomGridDefaultJsonData());

            ProposalsGridName = "myOrganizationsProposalsGrid";
            ProposalsGridSpec = new ProposalsGridSpec(currentFirmaSession)
            {
                ObjectNameSingular  = $"{organizationNamePossessive} {FieldDefinitionEnum.Proposal.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{organizationNamePossessive} {FieldDefinitionEnum.Proposal.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ProposalsGridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.MyOrganizationsProposalsGridJsonData());

            ProposeNewProjectUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(tc => tc.InstructionsProposal(null));
        }
예제 #3
0
        public MyOrganizationsProjectsViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            //TODO: It shouldn't be possible to reach this if Person.Organization is null...
            var organizationNamePossessive = currentPerson.Organization.OrganizationNamePossessive;

            PageTitle = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";

            ProjectsGridName = "myOrganizationsProjectListGrid";
            ProjectsGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ProjectsGridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.MyOrganizationsProjectsGridJsonData());

            ProposalsGridName   = "myOrganizationsProposalsGrid";
            ProposalsesGridSpec = new ProposalsGridSpec(currentPerson)
            {
                ObjectNameSingular  = $"{organizationNamePossessive} {Models.FieldDefinition.Application.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{organizationNamePossessive} {Models.FieldDefinition.Application.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ProposalsGridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.MyOrganizationsProposalsGridJsonData());

            ProposeNewProjectUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(tc => tc.InstructionsProposal(null));
        }