示例#1
0
        public virtual ActionResult Index(
            string operationNumber, bool calculateInMemory = true, bool isLive = false)
        {
            ViewBag.OperationNUmber = operationNumber;

            string cacheName = CacheHelper.GetCacheName(isLive, IDBContext.Current.Operation);

            var pmiOperation = _cacheData.Get <PMIOperation>(cacheName) ??
                               _cacheData.Add(
                cacheName,
                _clientPMIDetails.LoadOperationContext(operationNumber, calculateInMemory, isLive),
                _timeCachingVal);

            IDBContext.Current.ContextPMIOperation = pmiOperation;
            ViewData["OperationNumber"]            = operationNumber;
            ViewBag.Tab = "S1G";

            PMIDetailsModel model = _clientPMIDetails.GetCurrentPMIEscalarBenchmark(
                operationNumber, pmiOperation, isLive);

            model.IsLiveMode = isLive;

            LoadFromApprovalToLegalEffectiveness(model);
            LoadFromApprovalToLegalEffectivenessToEligibility(model);
            LoadNormalClausesPriorToEligibility(model);
            LoadSpecialClausesPriorToEligibility(model);

            //TODO: The entire model should be sent to the view instead of using the viewbag
            return(View(isLive));
        }
        public virtual ActionResult Index(
            string operationNumber, bool calculateInMemory = true, bool isLive = false)
        {
            //check if have data in Output and Component
            ViewBag.OperationType = OperationTypeHelper.GetOperationTypes(operationNumber);

            string cacheName = CacheHelper.GetCacheName(isLive, IDBContext.Current.Operation);

            var pmiOperation = _cacheData.Get <PMIOperation>(cacheName) ??
                               _cacheData.Add(
                cacheName,
                _clientPMIDetails.LoadOperationContext(operationNumber, calculateInMemory, isLive),
                _timeCachingVal);

            IDBContext.Current.ContextPMIOperation = pmiOperation;
            bool HaveData = pmiOperation.HaveDataOutputsAndComponent;

            if (!HaveData)
            {
                return(ShowWarning(operationNumber, 1));
            }

            bool HaveDataOYP = pmiOperation.HaveDataOutputYearPlan;

            if (!HaveDataOYP)
            {
                return(ShowWarning(operationNumber, 2));
            }
            else
            {
                ViewBag.Expected     = pmiOperation.ExpectedExecutionDuration;
                ViewBag.Enviromental = pmiOperation.Enviromental;

                ViewBag.OperationNUmber     = operationNumber;
                ViewData["OperationNumber"] = operationNumber;

                ViewBag.Tab = "S3G";
            }

            LoadAnnualGraphData(operationNumber, pmiOperation);
            LoadPeriodGraphData(pmiOperation, operationNumber);
            var historicalAccumulated = _clientPMIDetails.GetHistoricalAccumulated(operationNumber);

            ViewBag.AccumalteDisbursementsGraphData = GraphicGenerator
                                                      .LoadAccumalteDisbursementsGraphData(
                historicalAccumulated, pmiOperation, operationNumber, calculateInMemory);
            LoadPercentageProgress(pmiOperation, operationNumber);
            LoadPercentageProgressAnnual(pmiOperation, operationNumber);
            LoadDISB95(pmiOperation, operationNumber, isLive);

            //TODO: The entire model should be sent to the view instead of using the viewbag
            return(View(isLive));
        }
        public virtual ActionResult Index(string operationNumber, bool ErrorMessage = false)
        {
            Logger.GetLogger().WriteDebug("PMI", "StageFourController Index");

            ViewBag.NumberOperation = operationNumber;
            ViewBag.OperationNUmber = operationNumber;
            ViewBag.Tab             = "S4G";

            string cacheName = CacheHelper.GetCacheName(false, IDBContext.Current.Operation);

            var pmiOperation = _cacheData.Get <PMIOperation>(cacheName) ??
                               _cacheData.Add(
                cacheName,
                _clientPMIDetails.LoadOperationContext(operationNumber, true, false),
                _timeCachingVal);

            var areTLCompletedButtonsDisabled = false;

            bool.TryParse(
                ConfigurationManager.AppSettings.Get("PMI.PmrCycle.TLCompletedButtons.Disabled"),
                out areTLCompletedButtonsDisabled);

            var validationModel = _clientPMIDetails.GetPMIDetailsModelByStage(
                4, operationNumber, pmiOperation, areTLCompletedButtonsDisabled);

            if (validationModel.ValidationProcess != null)
            {
                validationModel.IsLiveMode = false;

                if (!validationModel.ValidationProcess.HasApprovalDate)
                {
                    return(View("WarningMessage"));
                }
            }

            if (ErrorMessage)
            {
                MessageConfiguration message = MessageHandler.SetMessageSendRequest(
                    MessageSendRequestCode.ErrorAndMessage,
                    false,
                    2,
                    "There is a current workflow creation in progress");

                ViewData["message"] = message;
            }

            return(View(validationModel));
        }
示例#4
0
        public virtual ActionResult Header(
            string operationNumber, int stage, bool calculateInMemory = true, bool isLive = false)
        {
            string cacheName = CacheHelper.GetCacheName(isLive, IDBContext.Current.Operation);

            var pmiOperation = _cacheData.Get <PMIOperation>(cacheName) ??
                               _cacheData.Add(
                cacheName,
                _clientPMIDetails.LoadOperationContext(operationNumber, calculateInMemory, isLive),
                _timeCachingVal);

            ViewBag.firstDisbursement = pmiOperation.YearOfDisbursement;
            int stageTitle = pmiOperation.StageValue;

            var classification = pmiOperation.SyntethicIndicatorState;
            var pmrCycleName   = pmiOperation.PmrCycleName;

            var operationTypes = OperationTypeHelper.GetOperationTypes(operationNumber);

            if (operationTypes.Contains(OperationType.PDL) ||
                operationTypes.Contains(OperationType.PBL) ||
                operationTypes.Contains(OperationType.PBP) ||
                operationTypes.Contains(OperationType.HIB) ||
                string.IsNullOrEmpty(classification))
            {
                classification = "N/A";
            }

            var basicPmiDetails = new BasicPMIDetailsModel
            {
                OperationId            = pmiOperation.OperationId,
                OperationNumber        = operationNumber,
                OperationTypes         = operationTypes,
                LastStageValueAchieved = pmiOperation.StageValue,
                StageNumber            = stage,
                Stage = stageTitle == 1 ?
                        Localization.GetText("From Approval to Eligibility") :
                        stageTitle == 2 ? Localization.GetText("After Eligibility") :
                        stageTitle == 3 ? Localization.GetText("After Operation Reaches 95% of total Disbursements") :
                        Localization.GetText("Validation process status"),
                SyntheticIndicator          = (double)pmiOperation.SyntheticIndicator,
                LastValidatedClassification = pmiOperation.LastValidationClass,
                Classification  = classification,
                CycleName       = pmrCycleName,
                CycleId         = pmiOperation.PmrCycleId,
                CycleYear       = pmiOperation.CycleYear,
                CycleTypeCode   = pmiOperation.CycleTypeCode,
                IsLiveMode      = isLive,
                IsModelComplete = pmiOperation.IsModelComplete
            };

            HttpContext.Items["classification"] = basicPmiDetails.Classification;

            return(PartialView("IndexSharedHeader", basicPmiDetails));
        }
示例#5
0
        public void PutResultMatrixEopInCache(string _resultMatrixEOPCacheName, ResultsMatrixModel model)
        {
            ResultMatrixEOPModel resultMatrixEopInCache = _cacheDataResultMatrixEop
                                                          .Get <ResultMatrixEOPModel>(_resultMatrixEOPCacheName);

            if (resultMatrixEopInCache != null && model.EndProjectYear != resultMatrixEopInCache.EopYear)
            {
                _cacheDataResultMatrixEop.Add <ResultMatrixEOPModel>(
                    _resultMatrixEOPCacheName,
                    _clientResultsMatrix.GetResultMatrixEOP(model.EndProjectYear, resultMatrixEopInCache),
                    _timeCachingVal);
            }
            else
            {
                _cacheDataResultMatrixEop.Add <ResultMatrixEOPModel>(
                    _resultMatrixEOPCacheName,
                    _clientResultsMatrix.GetNewResultMatrixEOP(model.EndProjectYear, model.ResultsMatrixId),
                    _timeCachingVal);
            }
        }
示例#6
0
        public virtual ActionResult Index(string operationNumber)
        {
            string cacheName = CacheHelper.GetCacheName(true, IDBContext.Current.Operation);

            var pmiOperation = _cacheData.Get <PMIOperation>(cacheName) ??
                               _cacheData.Add(
                cacheName,
                _clientPMIDetails.LoadOperationContext(operationNumber, true, true),
                _timeCachingVal);

            string controllerToRedirect = GetControllerNameFromLastestStageAchieved(
                pmiOperation.StageValue);

            return(RedirectToAction(
                       "Index",
                       controllerToRedirect,
                       new
            {
                area = "PMI",
                operationNumber = operationNumber,
                isLive = true
            }));
        }
示例#7
0
        public virtual ActionResult Index(
            string operationNumber,
            int state         = 0,
            int filter        = 0,
            bool showInactive = false)
        {
            SynchronizationHelper.AccessToResources(
                RMIndicatorValues.CANCEL,
                RMIndicatorValues.URL_RM_IMPACTS,
                operationNumber,
                IDBContext.Current.UserLoginName);

            new IDB.Presentation.MVC4.Controllers.CommonDocument().Log(LogType.Debug,
                                                                       "MVC4(IMP_1S) - CALL WCF MODELS EVERNEXT",
                                                                       "FindOneOperationModel -> BEFORE = OPERATION NUMBER:{0} ",
                                                                       operationNumber);

            // Retrieve OperationModel
            var operationModel = _clientResultsMatrix
                                 .FindOneOperationModel(new OperationSpecification()
            {
                OperationNumber = operationNumber
            });

            new IDB.Presentation.MVC4.Controllers.CommonDocument().Log(LogType.Debug,
                                                                       "MVC4(IMP_1E) - CALL WCF MODELS EVERNEXT",
                                                                       "FindOneOperationModel -> AFTER = RESPONSE ",
                                                                       operationModel);

            // Retrieve ResultsMatrix associated to last PMR Cycle
            ResultsMatrixModel resultMatrixModel = null;

            // Get ResultsMatrix associated to last PMR Cycle
            if (operationModel != null)
            {
                operationModel.AccessedByAdministrator =
                    IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);
                ViewBag.isLessTaskFive = PCRHelpers.IsCurrentTaskLessThanFive(
                    ClientGenericRepository, PCRWorkflowStatusRepository);

                new IDB.Presentation.MVC4.Controllers.CommonDocument().Log(LogType.Debug,
                                                                           "MVC4(IMP_2S) - CALL WCF MODELS SERVICE",
                                                                           "GetResultsMatrixModel -> BEFORE = OPERATION NUMBER:{0} ",
                                                                           operationModel);

                if (!showInactive)
                {
                    resultMatrixModel = _cacheData.Get <ResultsMatrixModel>(_impactsCacheName) ??
                                        _cacheData.Add(_impactsCacheName,
                                                       _clientResultsMatrix.GetResultsMatrixModel(operationModel, showInactive),
                                                       _timeCachingVal);
                    resultMatrixModel.AccessedByAdministrator =
                        operationModel.AccessedByAdministrator;
                }
                else
                {
                    resultMatrixModel = _clientResultsMatrix
                                        .GetResultsMatrixModel(operationModel, showInactive);
                }

                resultMatrixModel.showInactiveImpacts = showInactive;
                PutResultMatrixEopInCache(_resultMatrixEOPCacheName, resultMatrixModel);

                new IDB.Presentation.MVC4.Controllers.CommonDocument().Log(LogType.Debug,
                                                                           "MVC4(IMP_2E) - CALL WCF MODELS SERVICE",
                                                                           "GetResultsMatrixModel -> AFTER = RESPONSE: ",
                                                                           resultMatrixModel);
            }

            ViewData["filter"] = filter;

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

            if (resultMatrixModel != null)
            {
                resultMatrixModel.DEMLockReviewProcessData = _demLockModulesService
                                                             .BuildLockReviewProcessDEMDataModel(operationNumber);
            }

            return(View(resultMatrixModel));
        }