コード例 #1
0
        public virtual ActionResult PruebaLink()
        {
            var outcomeResponse = _linkPredefinedIndicatorService.GetLinkIndicatorModel(LinkIndicatorTypeEnum.Outcomes, true, "Outcome");

            ViewBag.Outcome = outcomeResponse.Filter;

            var resultMatrixResponse = _linkPredefinedIndicatorService.GetLinkIndicatorModel(LinkIndicatorTypeEnum.ResultMatrix, true, "Result");

            ViewBag.Result = resultMatrixResponse.Filter;
            return(View());
        }
コード例 #2
0
        public virtual ActionResult Edit(
            int operationId,
            int resultsMatrixId,
            int code         = 0,
            int filter       = 0,
            int newIndicator = -1)
        {
            var operationModel = _clientResultsMatrix
                                 .FindOneOperationModel(new OperationSpecification()
            {
                OperationId = operationId
            });

            operationModel.AccessedByAdministrator =
                IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);

            if (code != 0)
            {
                _cacheData.Remove(
                    _impactsCacheName, System.Web.Caching.CacheItemRemovedReason.Removed);
            }

            var resultModel = _cacheData.Get <ResultsMatrixModel>(_impactsCacheName) ??
                              _cacheData.Add(_impactsCacheName,
                                             _clientResultsMatrix.GetResultsMatrixModel(operationModel),
                                             _timeCachingVal);

            resultModel.AccessedByAdministrator = operationModel.AccessedByAdministrator;

            PutResultMatrixEopInCache(_resultMatrixEOPCacheName, resultModel);

            ViewData["listBoxYearsPlan"] = GetYearPlans(resultModel.Operation.OperationId);
            ViewData["filter"]           = filter;
            ViewData["currentYearsPlan"] = resultModel.Impacts.Count() > 0 ?
                                           resultModel.Impacts.FirstOrDefault().GetMaxIndicatorYearPlanRows() : null;

            if (code != 0)
            {
                MessageConfiguration message = MessageHandler.setMessageRMImpacts(code, false, 1);
                ViewData["message"] = message;
            }

            var modelIndicators = _linkPredefinedIndicatorService
                                  .GetLinkIndicatorModel(
                LinkIndicatorTypeEnum.Impacts,
                false,
                LinkIndicatorTypeEnum.Impacts.ToString(),
                true);

            ViewBag.ModelIndicators = modelIndicators.Filter;

            return(View(resultModel));
        }
コード例 #3
0
        public virtual ActionResult Edit(string operationNumber)
        {
            var predefModel = _linkPredefinedIndicatorService
                              .GetLinkIndicatorModel(LinkIndicatorTypeEnum.Outcomes,
                                                     false,
                                                     "Outcomes",
                                                     true).Filter;

            predefModel.FieldAccessList = _viewModelMapperHelper.GetFieldAccessModelList(operationNumber, PAGE_CHART);
            ViewBag.LinkIndicatorModel  = predefModel;
            LockRegister(operationNumber, TCMGlobalValues.TCM_OUTCOMES_EDIT);

            return(View());
        }
コード例 #4
0
        public virtual ActionResult Index(
            string operationNumber,
            bool isMilestonesEnabled      = false,
            bool isDisaggregationsEnabled = false,
            bool unlock = false)
        {
            var predefModel = _linkPredefinedIndicatorService
                              .GetLinkIndicatorModel(LinkIndicatorTypeEnum.Outputs,
                                                     false,
                                                     "Outputs",
                                                     true).Filter;

            ViewBag.LinkIndicatorModel = predefModel;

            var rspnse = _tcmUniverseService.GetParentOperation(operationNumber);

            if (unlock)
            {
                UnlockRegister(operationNumber, TCMGlobalValues.URL_PHYSICAL_PROGRESS);
            }

            if (!rspnse.IsValid)
            {
                throw new Exception(rspnse.ErrorMessage);
            }

            var model = _componentService.GetResultsMatrix(
                rspnse.OperationNumber,
                Localization.CurrentLanguage,
                isMilestonesEnabled,
                isDisaggregationsEnabled,
                false).Components;

            model.FieldAccessList = _viewModelMapperHelper.GetFieldAccessModelList(operationNumber, PAGE_CHART);
            model.PhysicalProgress.FieldAccessList = model.FieldAccessList;
            model.MappingProgress.FieldAccessList  = model.FieldAccessList;

            return(View(model));
        }
コード例 #5
0
        public virtual ActionResult Edit(
            int operationId,
            int resultsMatrixId,
            int code         = 0,
            int filter       = 0,
            int newIndicator = -1)
        {
            var operationModel = _clientResultsMatrix
                                 .FindOneOperationModel(new OperationSpecification()
            {
                OperationId = operationId
            });

            var accessedByAdministrator =
                IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);

            Logger.GetLogger().WriteMessage(
                "Outcomes", "I've just read permissions and, accessAdmin = " + accessedByAdministrator);

            operationModel.AccessedByAdministrator = accessedByAdministrator;

            if (code != 0)
            {
                _cacheData.Remove(
                    _outcomesCacheName, System.Web.Caching.CacheItemRemovedReason.Removed);
            }

            var resultModel = _cacheData.Get <ResultsMatrixModel>(_outcomesCacheName) ??
                              _cacheData.Add <ResultsMatrixModel>(_outcomesCacheName,
                                                                  _clientResultsMatrix.GetResultsMatrixModel(operationModel),
                                                                  _timeCachingVal);

            resultModel.AccessedByAdministrator = accessedByAdministrator;

            Logger.GetLogger().WriteMessage(
                "Outcomes", "After reading the cache, accessAdmin = " + resultModel.AccessedByAdministrator);

            ViewData["listBoxYearsPlan"] = GetYearPlans(resultModel.Operation.OperationId);
            ViewData["filter"]           = filter;
            ViewData["newIndicator"]     = newIndicator;

            ViewData["currentYearsPlan"] = resultModel.Outcomes.Count() > 0 ?
                                           resultModel.Outcomes.FirstOrDefault().GetMaxIndicatorYearPlanRows() : null;

            if (code != 0)
            {
                MessageConfiguration message = MessageHandler.setMessageRMOutcomes(code, false, 1);
                ViewData["message"] = message;
            }

            var modelIndicators = _linkPredefinedIndicatorService
                                  .GetLinkIndicatorModel(
                LinkIndicatorTypeEnum.Outcomes,
                false,
                LinkIndicatorTypeEnum.Outcomes.ToString(),
                true);

            ViewBag.ModelIndicators = modelIndicators.Filter;

            return(View(resultModel));
        }