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 })); }
public virtual ActionResult EditDetail(int impactIndicatorId) { ImpactIndicatorModel indicatorModel = ClientResultsMatrix.FindOneImpactIndicatorModel(new ImpactIndicatorSpecification() { ImpactIndicatorId = impactIndicatorId }); ImpactModel impactModel = ClientResultsMatrix.FindOneImpactModel(new ImpactSpecification() { ImpactId = indicatorModel.ImpactId }); bool isLinked = (indicatorModel.PredefinedIndicator == null) ? false : true; // Start third interval validation var operationNumber = ClientResultsMatrix.FindOneModel(new IDB.MW.Domain.Contracts.Specifications.ResultsMatrixSpecification() { ResultsMatrixId = impactModel.ResultsMatrixId }).Operation.OperationNumber; // Check if the administrator is accessing var accessedByAdministrator = true; var resultsMatrix = ClientResultsMatrix.GetResultsMatrixModel(new OperationModel() { OperationNumber = operationNumber, AccessedByAdministrator = accessedByAdministrator }); // End third interval validation CustomEditImpactIndicatoModel editImpactIndicatoModel = new CustomEditImpactIndicatoModel { impact = impactModel, impactIndicator = indicatorModel, IsLinkedToPredefinedIndicator = isLinked, IntervalId = resultsMatrix.Interval.IntervalId, AccessedByAdministrator = accessedByAdministrator, IsThirdInterval = resultsMatrix.IsThirdInterval, OperationNumber = operationNumber }; return(View(editImpactIndicatoModel)); }