public async Task Create(PrivateCustomerCommandDto.AddCustomer CustomerDto)
        {
            var Response = await Client.PostAsJsonAsync
                           (
                $"PrivateCustomer/Create?CompanyId={CustomerDto.CompanyId}&FirstName={CustomerDto.FirstName}&LastName={CustomerDto.LastName}" +
                $"&CPR={CustomerDto.CPR}&Username={CustomerDto.Username}&Password={CustomerDto.Password}&Text={CustomerDto.Text}" +
                $"&AccountNo={CustomerDto.AccountNo}", CustomerDto
                           );

            if (Response.IsSuccessStatusCode)
            {
                await Js.InvokeVoidAsync("alert", $"Kunden er nu oprettet!");
            }
            else
            {
                await Js.InvokeVoidAsync("alert", $"Noget gik galt! Prøv igen.");
            }
        }
Exemple #2
0
 public Task <IActionResult> PostCustomer(PrivateCustomerCommandDto.AddCustomer request)
 => RequestHandler.HandleCommand(request, Application.Handle, Log);