public CapexCost UpdateCapexCost(CapexCost capexCost)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ICapexCostRepository capexCostRepository = _DataRepositoryFactory.GetDataRepository <ICapexCostRepository>();

                CapexCost updatedEntity = null;

                if (capexCost.CapexCostId == 0)
                {
                    updatedEntity = capexCostRepository.Add(capexCost);
                }
                else
                {
                    updatedEntity = capexCostRepository.Update(capexCost);
                }

                return updatedEntity;
            }));
        }
        public CapexCost GetCapexCost(int capexCostId)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                var groupNames = new List <string>()
                {
                    BudgetModuleDefinition.GROUP_ADMINISTRATOR, BudgetModuleDefinition.GROUP_BUSINESS
                };
                AllowAccessToOperation(BudgetModuleDefinition.SOLUTION_NAME, groupNames);

                ICapexCostRepository capexCostRepository = _DataRepositoryFactory.GetDataRepository <ICapexCostRepository>();

                CapexCost capexCostEntity = capexCostRepository.Get(capexCostId);
                if (capexCostEntity == null)
                {
                    NotFoundException ex = new NotFoundException(string.Format(" CapexCost with ID of {0} is not in database", capexCostId));
                    throw new FaultException <NotFoundException>(ex, ex.Message);
                }

                return capexCostEntity;
            }));
        }
 public CapexCost UpdateCapexCost(CapexCost capexCost)
 {
     return(Channel.UpdateCapexCost(capexCost));
 }