Example #1
0
        public virtual ActionResult UpdateDetail(CustomEditOutcomeIndicatorModel updatedModel)
        {
            var indicatorModel = ClientResultsMatrix.FindOneOutcomeIndicatorModel(
                new OutcomeIndicatorSpecification
            {
                OutcomeIndicatorId = updatedModel.impactIndicator.OutcomeIndicatorId
            });
            var impactModel = ClientResultsMatrix.FindOneOutcomeModel(
                new OutcomeSpecification
            {
                OutcomeId = indicatorModel.OutcomeId
            });

            updatedModel.impactIndicator.AccessedByAdministrator = IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR);
            updatedModel.impactIndicator.IsThirdInterval         = updatedModel.IsThirdInterval;
            updatedModel.impactIndicator.IntervalId = updatedModel.IntervalId;

            ClientResultsMatrix.UpdateImpactIndicator(
                updatedModel.impactIndicator, IDBContext.Current.UserName);

            _cacheData.Remove(_outcomeIndicatorCacheName, System.Web.Caching.CacheItemRemovedReason.Removed);

            return(RedirectToAction(
                       "Detail",
                       "OutcomeIndicator",
                       new
            {
                resultsMatrixId = impactModel.ResultsMatrixId,
                impactId = impactModel.OutcomeId,
                impactIndicatorId = updatedModel.impactIndicator.OutcomeIndicatorId
            }));
        }
        public virtual ActionResult UpdateDetail(CustomEditImpactIndicatoModel updatedModel)
        {
            var indicatorModel = ClientResultsMatrix.FindOneImpactIndicatorModel(
                new ImpactIndicatorSpecification()
            {
                ImpactIndicatorId = updatedModel.impactIndicator.ImpactIndicatorId
            });
            var impactModel = ClientResultsMatrix.FindOneImpactModel(
                new ImpactSpecification()
            {
                ImpactId = indicatorModel.ImpactId
            });

            updatedModel.impactIndicator.IntervalId = updatedModel.IntervalId;
            updatedModel.impactIndicator.AccessedByAdministrator = updatedModel.AccessedByAdministrator;
            updatedModel.impactIndicator.IsThirdInterval         = updatedModel.IsThirdInterval;
            ClientResultsMatrix.UpdateImpactIndicator(
                updatedModel.impactIndicator, IDBContext.Current.UserName);
            _cacheData.Remove(
                _impactsIndicatorCacheName, System.Web.Caching.CacheItemRemovedReason.Removed);

            return(RedirectToAction(
                       "Detail",
                       "ImpactIndicator",
                       new
            {
                resultsMatrixId = impactModel.ResultsMatrixId,
                impactId = impactModel.ImpactId,
                impactIndicatorId = updatedModel.impactIndicator.ImpactIndicatorId
            }));
        }