예제 #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 void LoadDISB95(PMIOperation pmiOperation, string operationNumber, bool isLive)
        {
            var pmi         = _clientPMIDetails.GetCurrentPMIEscalarBenchmark(operationNumber, pmiOperation, isLive);
            var transformed = new
            {
                MaxLevel = pmi.PmiEscalarBenchmark.ListPMIEscalar
                           .Where(x => x.PmiTypeId == pmi.MasterDISB95)
                           .Select(x => x.MaxLevel)
                           .FirstOrDefault(),
                AlertLevel = pmi.PmiEscalarBenchmark.ListPMIEscalar
                             .Where(x => x.PmiTypeId == pmi.MasterDISB95)
                             .Select(x => x.AlertLevel)
                             .FirstOrDefault(),
                ProblemLevel = pmi.PmiEscalarBenchmark.ListPMIEscalar
                               .Where(x => x.PmiTypeId == pmi.MasterDISB95)
                               .Select(x => x.ProblemLevel)
                               .FirstOrDefault(),
                Disbursement95 = pmi.Disbur95,
            };

            ViewBag.Disb95 = transformed;
        }