private async void InsertCampaignButton_Click(object sender, EventArgs e) { if (CheckNulls(InsertCampaign)) { DisableControls(InsertCampaign); Campaign c = new Campaign() { ID = int.Parse(CampaignID.Text), Budget = long.Parse(CampaignBudget.Text), Date = CampaignDate.Value, Description = CampaignDescription.Text, Name = CampaignName.Text, Location = CampaignLocation.Text }; Employee manager = managers[CampaignManager.SelectedIndex]; await Task.Run(() => { cms.InsertCampaign(c); cms.SetCampaignManager(c, manager); cms.TerminateConnection(); }); EnableControls(InsertCampaign); Close(); } }