Exemple #1
0
        public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Evaluation evaluation) : base(currentFirmaSession)
        {
            Evaluation = evaluation;
            PageTitle  = evaluation.EvaluationName;

            UserHasEvaluationManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);
            IndexUrl = SitkaRoute <EvaluationController> .BuildUrlFromExpression(x => x.Index());

            EditEvaluationUrl = evaluation.GetEditUrl();

            EvaluationCriteriaGridSpec = new EvaluationCriteriaGridSpec(currentFirmaSession)
            {
                ObjectNameSingular = FieldDefinitionEnum.Evaluation.ToType().GetFieldDefinitionLabel(), ObjectNamePlural = FieldDefinitionEnum.Evaluation.ToType().GetFieldDefinitionLabelPluralized(), SaveFiltersInCookie = true
            };
            EvaluationCriteriaGridName    = "evaluationCriteriaGrid";
            EvaluationCriteriaGridDataUrl = SitkaRoute <EvaluationController> .BuildUrlFromExpression(tc => tc.EvaluationCriteriaGridJsonData(evaluation.EvaluationID));

            NewEvaluationCriteriaUrl = SitkaRoute <EvaluationController> .BuildUrlFromExpression(tc => tc.NewEvaluationCriteria(evaluation));

            AddProjectEvaluationUrl = SitkaRoute <EvaluationController> .BuildUrlFromExpression(ec => ec.AddProjectEvaluation(evaluation));

            EvaluationPortfolioGridSpec = new EvaluationPortfolioGridSpec(currentFirmaSession, evaluation)
            {
                ObjectNameSingular = FieldDefinitionEnum.EvaluationPortfolio.ToType().GetFieldDefinitionLabel(), ObjectNamePlural = FieldDefinitionEnum.EvaluationPortfolio.ToType().GetFieldDefinitionLabelPluralized(), SaveFiltersInCookie = true
            };
            EvaluationPortfolioGridName    = "evaluationPortfolioGrid";
            EvaluationPortfolioGridDataUrl = SitkaRoute <EvaluationController> .BuildUrlFromExpression(tc => tc.EvaluationPortfolioGridJsonData(evaluation.EvaluationID));
        }
Exemple #2
0
 public void UpdateModel(ProjectFirmaModels.Models.Evaluation evaluation, FirmaSession currentFirmaSession)
 {
     evaluation.EvaluationName         = EvaluationName;
     evaluation.EvaluationDefinition   = EvaluationDefinition;
     evaluation.EvaluationStartDate    = EvaluationStartDate;
     evaluation.EvaluationEndDate      = EvaluationEndDate;
     evaluation.EvaluationStatusID     = EvaluationStatusID;
     evaluation.EvaluationVisibilityID = EvaluationVisibilityID;
 }
Exemple #3
0
 public EditViewModel(ProjectFirmaModels.Models.Evaluation evaluation)
 {
     EvaluationID           = evaluation.EvaluationID;
     EvaluationName         = evaluation.EvaluationName;
     EvaluationDefinition   = evaluation.EvaluationDefinition;
     EvaluationStartDate    = evaluation.EvaluationStartDate;
     EvaluationEndDate      = evaluation.EvaluationEndDate;
     EvaluationStatusID     = evaluation.EvaluationStatusID;
     EvaluationVisibilityID = evaluation.EvaluationVisibilityID;
 }
        public EvaluationPortfolioGridSpec(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Evaluation evaluation)
        {
            Add(string.Empty, pe => MakeDeleteIconAndLinkBootstrapIfAvailable(currentFirmaSession, pe), 30, DhtmlxGridColumnFilterType.None);
            Add(string.Empty, pe => MakeEditIconAndLinkBootstrapIfAvailable(currentFirmaSession, pe), 30, DhtmlxGridColumnFilterType.None);

            Add(FieldDefinitionEnum.ProjectName.ToType().ToGridHeaderString(), a => a.Project.GetDisplayNameAsUrl(), 280, DhtmlxGridColumnFilterType.Text);
            Add(FieldDefinitionEnum.ProjectStage.ToType().ToGridHeaderString(), a => a.Project.ProjectStage.ProjectStageDisplayName, 90, DhtmlxGridColumnFilterType.SelectFilterStrict);
            foreach (var evaluationCriteriaColumn in evaluation.EvaluationCriterias)
            {
                Add(evaluationCriteriaColumn.EvaluationCriteriaName, a => GetCriteriaValueIfAvailable(a, evaluationCriteriaColumn), 75, DhtmlxGridColumnFilterType.SelectFilterStrict);
            }
            Add("Comments", a => a.Comments, 150, DhtmlxGridColumnFilterType.Text);
        }
Exemple #5
0
        public void UpdateModel(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Evaluation evaluation)
        {
            if (ProjectIDs == null || !ProjectIDs.Any())
            {
                return;
            }
            foreach (var projectID in ProjectIDs)
            {
                var project = HttpRequestStorage.DatabaseEntities.Projects.Single(x => x.ProjectID == projectID);
                if (project == null)
                {
                    //bad projectID from front-end
                    continue;
                }

                // get or create a new one
                var projectEvaluation = ProjectEvaluationModelExtensions.GetOrCreateProjectEvaluation(evaluation, project);
                HttpRequestStorage.DatabaseEntities.AllProjectEvaluations.Add(projectEvaluation);
            }
            HttpRequestStorage.DatabaseEntities.SaveChanges(currentFirmaSession);
        }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static ProjectEvaluation CreateNewBlank(Project project, Evaluation evaluation)
 {
     return(new ProjectEvaluation(project, evaluation));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static EvaluationCriteria CreateNewBlank(Evaluation evaluation)
 {
     return(new EvaluationCriteria(evaluation, default(string), default(string)));
 }
Exemple #8
0
 public AddProjectEvaluationViewModel(ProjectFirmaModels.Models.Evaluation evaluation)
 {
     EvaluationID = evaluation.EvaluationID;
     ProjectIDs   = evaluation.ProjectEvaluations.Select(x => x.ProjectID).ToList();
 }
Exemple #9
0
 public AddProjectEvaluationViewData(FirmaSession currentFirmaSession, AddProjectEvaluationViewDataForAngular viewDataForAngular, ProjectFirmaModels.Models.Evaluation evaluation, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
 {
     Evaluation         = evaluation;
     ViewDataForAngular = viewDataForAngular;
 }