public CapexItem UpdateCapexItem(CapexItem capexCost) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ICapexItemRepository capexCostRepository = _DataRepositoryFactory.GetDataRepository <ICapexItemRepository>(); CapexItem updatedEntity = null; if (capexCost.CapexItemId == 0) { updatedEntity = capexCostRepository.Add(capexCost); } else { updatedEntity = capexCostRepository.Update(capexCost); } return updatedEntity; })); }
public CapexItem GetCapexItem(int capexCostId) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS }; AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames); ICapexItemRepository capexCostRepository = _DataRepositoryFactory.GetDataRepository <ICapexItemRepository>(); CapexItem capexCostEntity = capexCostRepository.Get(capexCostId); if (capexCostEntity == null) { NotFoundException ex = new NotFoundException(string.Format(" CapexItem with ID of {0} is not in database", capexCostId)); throw new FaultException <NotFoundException>(ex, ex.Message); } return capexCostEntity; })); }
public CapexItem UpdateCapexItem(CapexItem capexItem) { return(Channel.UpdateCapexItem(capexItem)); }