public virtual ActionResult DeleteIndicatorWarning(
            string order,
            string definition,
            int resultsMatrixId,
            int impactIndicatorId,
            int intervalId,
            bool accessedByAdmin,
            bool isThirInterval)
        {
            ViewData["intervalId"]      = intervalId;
            ViewData["resultsMatrixId"] = resultsMatrixId;
            ViewData["impactId"]        = impactIndicatorId;

            ViewData["accessedByAdmin"] = accessedByAdmin;
            ViewData["isThirInterval"]  = isThirInterval;
            ViewData["isValidated"]     = ClientResultsMatrix.IsValidate(impactIndicatorId);

            ViewData["IndicatorName"] = string.Format("{0} {1}", order, definition);

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

            if (intervalId == ResultsMatrixCodes.ThirdInterval || (accessedByAdmin && isThirInterval))
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = Localization.GetText("TCM.RCMW.RegisterChangesMany.TextMessage");
            }
            else
            {
                ViewData["thirdIntervalDeleteIndicatorMessage"] = string.Empty;
            }

            return(PartialView());
        }
Пример #2
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));
        }