private void btn_Ok_Click(object sender, EventArgs e) { if (txt_ProjectName.Text != "" && lbox_SelectedEmployees.Items.Count != 0) { ICommands icommands = (ICommands)commands; ProjectID = icommands.AddProject(txt_ProjectName.Text, ProjectID); foreach (var item in lbox_SelectedEmployees.Items) { EmployeesID = icommands.EmployeesID(item.ToString(), EmployeesID); EmployeesId.Add(EmployeesID); } foreach (var item in EmployeesId) { icommands.AddProjectEmployees(item, ProjectID); } Transition = true; ButtonName = txt_ProjectName.Text; this.Close(); } }