public Manage(int i) { dataSet = new DataSet(); cms = new CMS(DataAccessMode.Connected); cms.InitializeConnection(); InitializeComponent(); switch (i) { case 1: CampaignDonorsItems.Visible = true; break; case 2: CampaignsReceipeintItems.Visible = true; break; case 3: MainSubCategory.Visible = true; break; case 4: DepartmentEmployees.Visible = true; break; default: CampaignsVolunteersBeneficiers.Visible = true; break; } }
private async void InsertCampaign_VisibleChanged(object sender, EventArgs e) { if (InsertCampaign.Visible) { CampaignManager.Enabled = false; await Task.Run(() => { cms.InitializeConnection(); managers = cms.GetAllEmployees(); }); foreach (var manager in managers) { CampaignManager.Items.Add(manager.Name); } CampaignManager.Enabled = true; } }