Beispiel #1
0
        public virtual ActionResult DeleteIndicatorWarning(int resultsMatrixId, int impactIndicatorId, int intervalId)
        {
            var accessedByAdministrator = IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);

            var resultModel = ClientResultsMatrix.GetLightResultsMatrixModel(new ResultsMatrixModel()
            {
                ResultsMatrixId = resultsMatrixId, AccessedByAdministrator = accessedByAdministrator
            });

            CustomDeleteOutcomeIndicatorModel deletedModel = new CustomDeleteOutcomeIndicatorModel()
            {
                AccessedByAdministrator = accessedByAdministrator,
                ImpactId        = impactIndicatorId,
                IsThirdInterval = resultModel.IsThirdInterval,
                ResultsMatrixId = resultModel.ResultsMatrixId,
                IntervalId      = resultModel.Interval.IntervalId
            };

            ViewData["defaulDeleteIndicatorMessage"] = Localization.GetText("This action cannot be undone, are you sure you wish to continue?");

            if (resultModel.Interval.IntervalId == ResultsMatrixCodes.ThirdInterval || (deletedModel.AccessedByAdministrator && resultModel.IsThirdInterval))
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = Localization.GetText("This change will be registered on the 'Changes to the Matrix' section and you will be required to explain it. Would you like to proceed?");
            }
            else
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = string.Empty;
            }

            return(PartialView(deletedModel));
        }
Beispiel #2
0
        public virtual ActionResult Reassign(int resultsMatrixId, int impactId, int impactIndicatorId)
        {
            // Check if the administrator is accessing
            var accessedByAdministrator = IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);

            // Get results matrix with interval data associated to administrator
            var lightResultModel = ClientResultsMatrix.GetLightResultsMatrixModel(new ResultsMatrixModel()
            {
                ResultsMatrixId = resultsMatrixId, AccessedByAdministrator = accessedByAdministrator
            });

            // Set impact data
            OutcomeModel currentImpact = ClientResultsMatrix.FindOneOutcomeModel(new OutcomeSpecification()
            {
                OutcomeId = impactId
            });

            // Get outcomes
            IDB.MW.Domain.Models.Architecture.ResultMatrix.Outcomes.ResultsMatrixModel resultModel = ClientResultsMatrix.FindOneModel(new ResultsMatrixSpecification()
            {
                ResultsMatrixId = resultsMatrixId
            });

            List <OutcomeModel> outcomes = resultModel.Outcomes;

            // Remove current outcome
            outcomes.RemoveAll(i => i.OutcomeId == impactId);

            // Set reassign model properties
            CustomReassignOutcomeIndicatorModel reassignModel = new CustomReassignOutcomeIndicatorModel()
            {
                Statement               = currentImpact.Statement,
                Definition              = currentImpact.OutcomeIndicators.Where(ii => ii.OutcomeIndicatorId == impactIndicatorId).SingleOrDefault <OutcomeIndicatorModel>().Definition,
                OutcomeIndicatorId      = impactIndicatorId,
                ResultsMatrixId         = lightResultModel.ResultsMatrixId,
                AccessedByAdministrator = accessedByAdministrator,
                IsThirdInterval         = lightResultModel.IsThirdInterval,
                ImpactId   = impactId,
                Outcomes   = outcomes,
                IntervalId = lightResultModel.Interval.IntervalId
            };

            return(PartialView(reassignModel));
        }
Beispiel #3
0
        public virtual ActionResult DeleteIndicatorWarning(
            string order,
            string definition,
            int resultsMatrixId,
            int impactIndicatorId,
            int intervalId)
        {
            // Check if the administrator is accessing
            var accessedByAdministrator = IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);

            // Get results matrix with interval data associated to administrator
            var resultModel = ClientResultsMatrix.GetLightResultsMatrixModel(new ResultsMatrixModel()
            {
                ResultsMatrixId = resultsMatrixId, AccessedByAdministrator = accessedByAdministrator
            });

            CustomDeleteOutcomeIndicatorModel deletedModel = new CustomDeleteOutcomeIndicatorModel()
            {
                AccessedByAdministrator = accessedByAdministrator,
                ImpactId        = impactIndicatorId,
                IsThirdInterval = resultModel.IsThirdInterval,
                ResultsMatrixId = resultModel.ResultsMatrixId,
                IntervalId      = resultModel.Interval.IntervalId,
                IsValidated     = ClientResultsMatrix.IsValidate(impactIndicatorId),
                IndicatorName   = string.Format("{0} {1}", order, definition)
            };

            ViewData["defaulDeleteIndicatorMessage"] = Localization.GetText("TCM.DO.DeleteOutcomeStatement.UndoneActionMessage");

            if (resultModel.Interval.IntervalId == ResultsMatrixCodes.ThirdInterval || (deletedModel.AccessedByAdministrator && resultModel.IsThirdInterval))
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = Localization.GetText("TCM.RCMW.RegisterChangesMany.TextMessage");
            }
            else
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = string.Empty;
            }

            return(PartialView(deletedModel));
        }
Beispiel #4
0
        public virtual ActionResult Detail(int resultsMatrixId, int impactId, int impactIndicatorId)
        {
            OutcomeModel impactModel = ClientResultsMatrix.FindOneOutcomeModel(new OutcomeSpecification()
            {
                OutcomeId = impactId
            });

            var impactIndicatorModel = impactModel.OutcomeIndicators.Where(ii => ii.OutcomeIndicatorId == impactIndicatorId).SingleOrDefault <OutcomeIndicatorModel>();

            var resultModel = ClientResultsMatrix.FindOneModel(new ResultsMatrixSpecification()
            {
                ResultsMatrixId = resultsMatrixId
            });

            impactModel.OutcomeIndicators.Clear();

            impactModel.OutcomeIndicators.Add(impactIndicatorModel);

            ViewData["operationNumber"] = resultModel.Operation.OperationNumber;

            var StateDraftId = ClientConvergenceMasterData.GetMasterDataId("VALIDATION_STAGE", "PMI_DRAFT");
            var isDraft      = false;

            if (resultModel.ValidationStageId == StateDraftId)
            {
                isDraft = true;
            }

            ViewBag.isDraft    = isDraft;
            ViewBag.isEditable = ClientResultsMatrix.GetLightResultsMatrixModel(new ResultsMatrixModel()
            {
                ResultsMatrixId = resultModel.ResultsMatrixId
            }).isEditable;

            return(View(impactModel));
        }