private async Task UpdateService() { if (ValidateInputs()) { ServiceEditVM serviceEditVM = new ServiceEditVM() { Id = service.Id, Name = TbName.Text, Price = decimal.Parse(TbPrice.Text) }; ls.LblLoading.Text = "Editing"; ls.Show(); bool success = await serviceApi.UpdateService(serviceEditVM); ls.Close(); if (success) { Close(); } else { MessageBox.Show("Fail!"); } } else { MessageBox.Show("All input fields are required and price must be a number!"); } }