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 })); } }
public async Task <IActionResult> Post([FromBody] TaxWriteModel model, CancellationToken cancellationToken) { return(new OkObjectResult(await _taxService.Create(model, cancellationToken))); }
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); }