Exemple #1
0
 public IActionResult Create([FromBody] Tax tax)
 {
     try
     {
         EnsureHasPermission((int)MenuFeatureEnum.ManageOrganisactionSetting);
         tax.OrganisationId = taxService.OrganisationId;
         taxService.Create(tax);
         return(Ok());
     }catch (Exception ex)
     {
         return(BadRequest(new Error {
             ErrorText = ex.Message
         }));
     }
 }
Exemple #2
0
 public async Task <IActionResult> Post([FromBody] TaxWriteModel model, CancellationToken cancellationToken)
 {
     return(new OkObjectResult(await _taxService.Create(model, cancellationToken)));
 }
Exemple #3
0
        public async Task CanSaveTaxesWithCorrectPeriods(int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay)
        {
            var tax = GetTax(new DateTime(startYear, startMonth, startDay), new DateTime(endYear, endMonth, endDay));

            await _service.Create(tax, CancellationToken.None);
        }