private void btnAddResponsibility_Click(object sender, EventArgs e) { Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); }); T.Start(); int FactoryID = 0; int DepartmentID = 0; int UserID = 0; int PositionID = 0; if (cmbFactory.SelectedItem != null) { FactoryID = Convert.ToInt32(cmbFactory.SelectedValue); } if (cmbDepartments.SelectedItem != null) { DepartmentID = Convert.ToInt32(cmbDepartments.SelectedValue); } if (cmbUsers.SelectedItem != null) { UserID = Convert.ToInt32(cmbUsers.SelectedValue); } if (cmbPositions.SelectedItem != null) { PositionID = Convert.ToInt32(cmbPositions.SelectedValue); } int StaffListID = UsersResponsibilities.GetStaffListID(FactoryID, DepartmentID, UserID, PositionID); FunctionsManagementForm FunctionsManagementForm = new FunctionsManagementForm(ref AdminFunctionsEdit, StaffListID, UserID); TopForm = FunctionsManagementForm; FunctionsManagementForm.ShowDialog(); FunctionsManagementForm.Close(); FunctionsManagementForm.Dispose(); UsersResponsibilities.UpdateUsersResponsibilities(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } }