public void AddScheduledTax(Municipality municipality, DateTime start, TaxTypes type, int taxPercentage)
        {
            var taxPeriod = _taxPeriodFactory.CreateTaxPeriod(start, type, taxPercentage);

            municipality.AddTaxPeriod(taxPeriod);
            _municipalityRepository.Update(municipality, new CancellationToken());
        }
Example #2
0
        /// <summary>
        /// The Save
        /// </summary>
        /// <param name="entity">The entity<see cref="Municipality"/></param>
        /// <returns>The <see cref="ServiceResult"/></returns>
        public ServiceResult Save(Municipality entity)
        {
            try
            {
                if (entity.Identifier == 0)
                {
                    _repository.Add(entity);
                }
                else
                {
                    _repository.Update(entity);
                }

                return(new ServiceResult(true));
            }
            catch (Exception ex)
            {
                return(new ServiceResult(false)
                {
                    Error = ex.ToString()
                });
            }
        }
Example #3
0
 public Task <MunicipalityReadModel> Update(Guid id, MunicipalityWriteModel model, CancellationToken cancellationToken) =>
 _municipalityRepository.Update(id, model, cancellationToken);