private void butLocks_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select at least one connection."); return; } List <CentralConnection> listSelectedConns = new List <CentralConnection>(); for (int i = 0; i < gridMain.SelectedIndices.Length; i++) { if (((CentralConnection)gridMain.Rows[gridMain.SelectedIndices[i]].Tag).ConnectionStatus != "OK") { continue; } listSelectedConns.Add((CentralConnection)gridMain.Rows[gridMain.SelectedIndices[i]].Tag); } MsgBoxCopyPaste MsgBoxCopyPaste = new MsgBoxCopyPaste(CentralSyncHelper.SyncLocks(listSelectedConns)); MsgBoxCopyPaste.ShowDialog(); FillGrid(); }
private void butSyncLocks_Click(object sender, EventArgs e) { FormCentralConnections FormCC = new FormCentralConnections(); FormCC.LabelText.Text = Lans.g("CentralSecurity", "Sync will create or update the Central Management users, passwords, and user groups to all selected databases."); FormCC.Text = Lans.g("CentralSecurity", "Sync Security"); foreach (CentralConnection conn in ListConns) { FormCC.ListConns.Add(conn.Copy()); } List <CentralConnection> listSelectedConns = new List <CentralConnection>(); if (FormCC.ShowDialog() == DialogResult.OK) { listSelectedConns = FormCC.ListConns; } else { return; } MsgBoxCopyPaste MsgBoxCopyPaste = new MsgBoxCopyPaste(CentralSyncHelper.SyncLocks(listSelectedConns)); MsgBoxCopyPaste.ShowDialog(); }