public virtual ActionResult DeleteDisaggregation(int resultsMatrixId, int impactDisaggregationId) { int code = 0; try { OutcomeDisaggregationModel indicatorModel = ClientResultsMatrix.FindOneOutcomeDisaggregationModel(new OutcomeDisaggregationSpecification() { OutcomeDisaggregationId = impactDisaggregationId }); if (indicatorModel != null) { ClientResultsMatrix.DeleteDissagregation(indicatorModel); code = 504; } else { code = 496; } } catch (Exception) { code = 496; } var resultsMatrix = ClientResultsMatrix.FindOneModel(new ResultsMatrixSpecification() { ResultsMatrixId = resultsMatrixId }); return(RedirectToAction("Edit", "Outcomes", new { operationId = resultsMatrix.OperationId, resultsMatrixId = resultsMatrixId, code = code })); }
public virtual ActionResult DeleteDisaggregation(int resultsMatrixId, int impactDisaggregationId) { // Define Ajax response int code = 0; try { // Retrieve ImpactIndicator OutcomeDisaggregationModel indicatorModel = ClientResultsMatrix.FindOneOutcomeDisaggregationModel(new OutcomeDisaggregationSpecification() { OutcomeDisaggregationId = impactDisaggregationId }); if (indicatorModel != null) { ClientResultsMatrix.DeleteDissagregation(indicatorModel); code = 504; } else { code = 496; } } catch (Exception) { code = 496; } _cacheData.Remove(_outcomeIndicatorCacheName, System.Web.Caching.CacheItemRemovedReason.Removed); _cacheData.Remove(_outcomesCacheName, System.Web.Caching.CacheItemRemovedReason.DependencyChanged); var resultsMatrix = ClientResultsMatrix.FindOneModel(new ResultsMatrixSpecification() { ResultsMatrixId = resultsMatrixId }); return(RedirectToAction("Edit", "Outcomes", new { operationId = resultsMatrix.OperationId, resultsMatrixId = resultsMatrixId, code = code })); }