diff --git a/DBADashDB/dbo/Stored Procedures/DDLSnapshots_Get.sql b/DBADashDB/dbo/Stored Procedures/DDLSnapshots_Get.sql index b82b975b..17bd931c 100644 --- a/DBADashDB/dbo/Stored Procedures/DDLSnapshots_Get.sql +++ b/DBADashDB/dbo/Stored Procedures/DDLSnapshots_Get.sql @@ -5,7 +5,8 @@ @PageNumber INT=1 ) AS -SELECT I.InstanceGroupName, +SELECT I.InstanceID, + I.InstanceGroupName, ss.DatabaseID, ss.SnapshotDate, ss.ValidatedDate, diff --git a/DBADashGUI/Messaging/CollectionMessaging.cs b/DBADashGUI/Messaging/CollectionMessaging.cs index 83a05a06..02a557e0 100644 --- a/DBADashGUI/Messaging/CollectionMessaging.cs +++ b/DBADashGUI/Messaging/CollectionMessaging.cs @@ -45,19 +45,19 @@ public static async Task TriggerCollection(string connectionID, string type, int } public static async Task TriggerCollection(string connectionID, List types, int collectAgentID, int importAgentID, - ISetStatus control) + ISetStatus control,string db=null) { if (PendingRequests >= PendingRequestsThreshold) { control.SetStatus("Too many pending requests", null, DashColors.Fail); return; } - + var key = db == null ? connectionID : connectionID + "\\" + db; foreach (var type in types) { - if (IsRecentlyTriggered(connectionID, type) && !RecentlyTriggeredExcludedList.Exists(ct => Enum.GetName(ct) == type)) + if (IsRecentlyTriggered(key, type) && !RecentlyTriggeredExcludedList.Exists(ct => Enum.GetName(ct) == type)) { - control.SetStatus($"Collection {type} already triggered recently for {connectionID}", null, DashColors.Fail); + control.SetStatus($"Collection {type} already triggered recently for {key}", null, DashColors.Fail); return; } else if (type is "QueryText" or "QueryPlans") @@ -68,10 +68,12 @@ public static async Task TriggerCollection(string connectionID, List typ } var typesString = string.Join(", ", types.Select(s => s.ToString())); - var messageBase = $"{typesString} collection for {connectionID}: "; + var messageBase = $"{typesString} collection for {key}: "; + + var collectAgent = DBADashAgent.GetDBADashAgent(Common.ConnectionString, collectAgentID); var importAgent = DBADashAgent.GetDBADashAgent(Common.ConnectionString, importAgentID); - var x = new CollectionMessage(types, connectionID) { CollectAgent = collectAgent, ImportAgent = importAgent }; + var x = new CollectionMessage(types, connectionID) { CollectAgent = collectAgent, ImportAgent = importAgent, DatabaseName = db}; var payload = x.Serialize(); var messageGroup = Guid.NewGuid(); @@ -79,13 +81,13 @@ public static async Task TriggerCollection(string connectionID, List typ control.SetStatus(messageBase + "SENT", "", DashColors.Information); foreach (var type in types) { - UpdateLastTriggeredTime(connectionID, type); + UpdateLastTriggeredTime(key, type); } IncrementPendingRequests(); await Task.Run(() => ReceiveReply(messageGroup, messageBase, control)); } - public static async Task TriggerCollection(int InstanceID, List types, ISetStatus control) + public static async Task TriggerCollection(int InstanceID, List types, ISetStatus control,string db=null) { var row = CommonData.Instances.AsEnumerable().FirstOrDefault(i => (int)i["InstanceID"] == InstanceID); if (row == null) return; @@ -98,7 +100,7 @@ public static async Task TriggerCollection(int InstanceID, List MessageBox.Show("Messaging is not enabled for this instance", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } - await TriggerCollection(connectionID, types.Select(Enum.GetName).ToList(), collectAgentID, importAgentID, control); + await TriggerCollection(connectionID, types.Select(Enum.GetName).ToList(), collectAgentID, importAgentID, control,db); } public static async Task TriggerCollection(int InstanceID, CollectionType type, ISetStatus control) diff --git a/DBADashGUI/SchemaCompare/SchemaSnapshots.Designer.cs b/DBADashGUI/SchemaCompare/SchemaSnapshots.Designer.cs index 2d4ad466..7d0ab24f 100644 --- a/DBADashGUI/SchemaCompare/SchemaSnapshots.Designer.cs +++ b/DBADashGUI/SchemaCompare/SchemaSnapshots.Designer.cs @@ -34,622 +34,621 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SchemaSnapshots)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - this.splitSnapshotSummary = new System.Windows.Forms.SplitContainer(); - this.gvSnapshots = new System.Windows.Forms.DataGridView(); - this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colDB = new System.Windows.Forms.DataGridViewLinkColumn(); - this.SnapshotDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ValidatedDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ValidForDays = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.DaysSinceValidation = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colCreated = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Modified = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Dropped = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colExport = new System.Windows.Forms.DataGridViewLinkColumn(); - this.toolStrip2 = new System.Windows.Forms.ToolStrip(); - this.tsSummaryBack = new System.Windows.Forms.ToolStripButton(); - this.tsSummaryPageNum = new System.Windows.Forms.ToolStripLabel(); - this.tsSummaryNext = new System.Windows.Forms.ToolStripButton(); - this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel(); - this.tsSummaryPageSize = new System.Windows.Forms.ToolStripComboBox(); - this.gvSnapshotsDetail = new System.Windows.Forms.DataGridView(); - this.colObjectName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colSchemaName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colAction = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colView = new System.Windows.Forms.DataGridViewLinkColumn(); - this.colDiff = new System.Windows.Forms.DataGridViewLinkColumn(); - this.dgvInstanceSummary = new System.Windows.Forms.DataGridView(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.tsRefresh = new System.Windows.Forms.ToolStripButton(); - this.tsBack = new System.Windows.Forms.ToolStripButton(); - this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colInstance = new System.Windows.Forms.DataGridViewLinkColumn(); - this.colLastUpdated = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colLastValidated = new System.Windows.Forms.DataGridViewTextBoxColumn(); - ((System.ComponentModel.ISupportInitialize)(this.splitSnapshotSummary)).BeginInit(); - this.splitSnapshotSummary.Panel1.SuspendLayout(); - this.splitSnapshotSummary.Panel2.SuspendLayout(); - this.splitSnapshotSummary.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.gvSnapshots)).BeginInit(); - this.toolStrip2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.gvSnapshotsDetail)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dgvInstanceSummary)).BeginInit(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); + splitSnapshotSummary = new System.Windows.Forms.SplitContainer(); + gvSnapshots = new System.Windows.Forms.DataGridView(); + toolStrip2 = new System.Windows.Forms.ToolStrip(); + tsSummaryBack = new System.Windows.Forms.ToolStripButton(); + tsSummaryPageNum = new System.Windows.Forms.ToolStripLabel(); + tsSummaryNext = new System.Windows.Forms.ToolStripButton(); + toolStripLabel3 = new System.Windows.Forms.ToolStripLabel(); + tsSummaryPageSize = new System.Windows.Forms.ToolStripComboBox(); + lblStatus = new System.Windows.Forms.ToolStripLabel(); + gvSnapshotsDetail = new System.Windows.Forms.DataGridView(); + colObjectName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colSchemaName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colAction = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colView = new System.Windows.Forms.DataGridViewLinkColumn(); + colDiff = new System.Windows.Forms.DataGridViewLinkColumn(); + dgvInstanceSummary = new System.Windows.Forms.DataGridView(); + colInstance = new System.Windows.Forms.DataGridViewLinkColumn(); + colLastUpdated = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colLastValidated = new System.Windows.Forms.DataGridViewTextBoxColumn(); + toolStrip1 = new System.Windows.Forms.ToolStrip(); + tsRefresh = new System.Windows.Forms.ToolStripButton(); + tsBack = new System.Windows.Forms.ToolStripButton(); + tsTrigger = new System.Windows.Forms.ToolStripButton(); + dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colDB = new System.Windows.Forms.DataGridViewLinkColumn(); + SnapshotDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ValidatedDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ValidForDays = new System.Windows.Forms.DataGridViewTextBoxColumn(); + DaysSinceValidation = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colCreated = new System.Windows.Forms.DataGridViewTextBoxColumn(); + Modified = new System.Windows.Forms.DataGridViewTextBoxColumn(); + Dropped = new System.Windows.Forms.DataGridViewTextBoxColumn(); + colExport = new System.Windows.Forms.DataGridViewLinkColumn(); + colTriggerSnapshot = new System.Windows.Forms.DataGridViewLinkColumn(); + ((System.ComponentModel.ISupportInitialize)splitSnapshotSummary).BeginInit(); + splitSnapshotSummary.Panel1.SuspendLayout(); + splitSnapshotSummary.Panel2.SuspendLayout(); + splitSnapshotSummary.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)gvSnapshots).BeginInit(); + toolStrip2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)gvSnapshotsDetail).BeginInit(); + ((System.ComponentModel.ISupportInitialize)dgvInstanceSummary).BeginInit(); + toolStrip1.SuspendLayout(); + SuspendLayout(); // // splitSnapshotSummary // - this.splitSnapshotSummary.Dock = System.Windows.Forms.DockStyle.Bottom; - this.splitSnapshotSummary.Location = new System.Drawing.Point(0, 255); - this.splitSnapshotSummary.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.splitSnapshotSummary.Name = "splitSnapshotSummary"; - this.splitSnapshotSummary.Orientation = System.Windows.Forms.Orientation.Horizontal; + splitSnapshotSummary.Dock = System.Windows.Forms.DockStyle.Bottom; + splitSnapshotSummary.Location = new System.Drawing.Point(0, 255); + splitSnapshotSummary.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + splitSnapshotSummary.Name = "splitSnapshotSummary"; + splitSnapshotSummary.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitSnapshotSummary.Panel1 // - this.splitSnapshotSummary.Panel1.Controls.Add(this.gvSnapshots); - this.splitSnapshotSummary.Panel1.Controls.Add(this.toolStrip2); + splitSnapshotSummary.Panel1.Controls.Add(gvSnapshots); + splitSnapshotSummary.Panel1.Controls.Add(toolStrip2); // // splitSnapshotSummary.Panel2 // - this.splitSnapshotSummary.Panel2.Controls.Add(this.gvSnapshotsDetail); - this.splitSnapshotSummary.Size = new System.Drawing.Size(2019, 1271); - this.splitSnapshotSummary.SplitterDistance = 776; - this.splitSnapshotSummary.SplitterWidth = 5; - this.splitSnapshotSummary.TabIndex = 1; + splitSnapshotSummary.Panel2.Controls.Add(gvSnapshotsDetail); + splitSnapshotSummary.Size = new System.Drawing.Size(2019, 1271); + splitSnapshotSummary.SplitterDistance = 776; + splitSnapshotSummary.SplitterWidth = 5; + splitSnapshotSummary.TabIndex = 1; // // gvSnapshots // - this.gvSnapshots.AllowUserToAddRows = false; - this.gvSnapshots.AllowUserToDeleteRows = false; - this.gvSnapshots.BackgroundColor = System.Drawing.Color.White; + gvSnapshots.AllowUserToAddRows = false; + gvSnapshots.AllowUserToDeleteRows = false; + gvSnapshots.BackgroundColor = System.Drawing.Color.White; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F); dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gvSnapshots.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.gvSnapshots.ColumnHeadersHeight = 29; - this.gvSnapshots.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dataGridViewTextBoxColumn14, - this.colDB, - this.SnapshotDate, - this.ValidatedDate, - this.ValidForDays, - this.DaysSinceValidation, - this.colCreated, - this.Modified, - this.Dropped, - this.colExport}); + gvSnapshots.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + gvSnapshots.ColumnHeadersHeight = 29; + gvSnapshots.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { dataGridViewTextBoxColumn14, colDB, SnapshotDate, ValidatedDate, ValidForDays, DaysSinceValidation, colCreated, Modified, Dropped, colExport, colTriggerSnapshot }); dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F); dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.gvSnapshots.DefaultCellStyle = dataGridViewCellStyle2; - this.gvSnapshots.Dock = System.Windows.Forms.DockStyle.Fill; - this.gvSnapshots.Location = new System.Drawing.Point(0, 0); - this.gvSnapshots.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gvSnapshots.Name = "gvSnapshots"; - this.gvSnapshots.ReadOnly = true; + gvSnapshots.DefaultCellStyle = dataGridViewCellStyle2; + gvSnapshots.Dock = System.Windows.Forms.DockStyle.Fill; + gvSnapshots.Location = new System.Drawing.Point(0, 0); + gvSnapshots.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + gvSnapshots.Name = "gvSnapshots"; + gvSnapshots.ReadOnly = true; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F); dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gvSnapshots.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; - this.gvSnapshots.RowHeadersVisible = false; - this.gvSnapshots.RowHeadersWidth = 51; - this.gvSnapshots.RowTemplate.Height = 24; - this.gvSnapshots.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gvSnapshots.Size = new System.Drawing.Size(2019, 748); - this.gvSnapshots.TabIndex = 0; - this.gvSnapshots.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.GvSnapshots_CellContentClick); - this.gvSnapshots.SelectionChanged += new System.EventHandler(this.GvSnapshots_SelectionChanged); - // - // dataGridViewTextBoxColumn14 - // - this.dataGridViewTextBoxColumn14.DataPropertyName = "InstanceGroupName"; - this.dataGridViewTextBoxColumn14.HeaderText = "Instance"; - this.dataGridViewTextBoxColumn14.MinimumWidth = 6; - this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14"; - this.dataGridViewTextBoxColumn14.ReadOnly = true; - this.dataGridViewTextBoxColumn14.Width = 125; - // - // colDB - // - this.colDB.DataPropertyName = "DB"; - this.colDB.HeaderText = "DB"; - this.colDB.MinimumWidth = 6; - this.colDB.Name = "colDB"; - this.colDB.ReadOnly = true; - this.colDB.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colDB.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colDB.Width = 56; - // - // SnapshotDate - // - this.SnapshotDate.DataPropertyName = "SnapshotDate"; - this.SnapshotDate.HeaderText = "Snapshot Date"; - this.SnapshotDate.MinimumWidth = 6; - this.SnapshotDate.Name = "SnapshotDate"; - this.SnapshotDate.ReadOnly = true; - this.SnapshotDate.Width = 131; - // - // ValidatedDate - // - this.ValidatedDate.DataPropertyName = "ValidatedDate"; - this.ValidatedDate.HeaderText = "Validated Date"; - this.ValidatedDate.MinimumWidth = 6; - this.ValidatedDate.Name = "ValidatedDate"; - this.ValidatedDate.ReadOnly = true; - this.ValidatedDate.Width = 130; - // - // ValidForDays - // - this.ValidForDays.DataPropertyName = "ValidForDays"; - this.ValidForDays.HeaderText = "Valid For (Days)"; - this.ValidForDays.MinimumWidth = 6; - this.ValidForDays.Name = "ValidForDays"; - this.ValidForDays.ReadOnly = true; - this.ValidForDays.Width = 125; - // - // DaysSinceValidation - // - this.DaysSinceValidation.DataPropertyName = "DaysSinceValidation"; - this.DaysSinceValidation.HeaderText = "Days Since Validation"; - this.DaysSinceValidation.MinimumWidth = 6; - this.DaysSinceValidation.Name = "DaysSinceValidation"; - this.DaysSinceValidation.ReadOnly = true; - this.DaysSinceValidation.Width = 125; - // - // colCreated - // - this.colCreated.DataPropertyName = "Created"; - this.colCreated.HeaderText = "Created"; - this.colCreated.MinimumWidth = 6; - this.colCreated.Name = "colCreated"; - this.colCreated.ReadOnly = true; - this.colCreated.Width = 87; - // - // Modified - // - this.Modified.DataPropertyName = "Modified"; - this.Modified.HeaderText = "Modified"; - this.Modified.MinimumWidth = 6; - this.Modified.Name = "Modified"; - this.Modified.ReadOnly = true; - this.Modified.Width = 90; - // - // Dropped - // - this.Dropped.DataPropertyName = "Dropped"; - this.Dropped.HeaderText = "Dropped"; - this.Dropped.MinimumWidth = 6; - this.Dropped.Name = "Dropped"; - this.Dropped.ReadOnly = true; - this.Dropped.Width = 92; - // - // colExport - // - this.colExport.HeaderText = "Export"; - this.colExport.MinimumWidth = 6; - this.colExport.Name = "colExport"; - this.colExport.ReadOnly = true; - this.colExport.Text = "Export"; - this.colExport.ToolTipText = "Export DB Schema to disk"; - this.colExport.UseColumnTextForLinkValue = true; - this.colExport.Width = 125; + gvSnapshots.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; + gvSnapshots.RowHeadersVisible = false; + gvSnapshots.RowHeadersWidth = 51; + gvSnapshots.RowTemplate.Height = 24; + gvSnapshots.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + gvSnapshots.Size = new System.Drawing.Size(2019, 748); + gvSnapshots.TabIndex = 0; + gvSnapshots.CellContentClick += GvSnapshots_CellContentClick; + gvSnapshots.SelectionChanged += GvSnapshots_SelectionChanged; // // toolStrip2 // - this.toolStrip2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.toolStrip2.ImageScalingSize = new System.Drawing.Size(20, 20); - this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsSummaryBack, - this.tsSummaryPageNum, - this.tsSummaryNext, - this.toolStripLabel3, - this.tsSummaryPageSize}); - this.toolStrip2.Location = new System.Drawing.Point(0, 748); - this.toolStrip2.Name = "toolStrip2"; - this.toolStrip2.Size = new System.Drawing.Size(2019, 28); - this.toolStrip2.TabIndex = 2; - this.toolStrip2.Text = "toolStrip2"; + toolStrip2.Dock = System.Windows.Forms.DockStyle.Bottom; + toolStrip2.ImageScalingSize = new System.Drawing.Size(20, 20); + toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { tsSummaryBack, tsSummaryPageNum, tsSummaryNext, toolStripLabel3, tsSummaryPageSize, lblStatus }); + toolStrip2.Location = new System.Drawing.Point(0, 748); + toolStrip2.Name = "toolStrip2"; + toolStrip2.Size = new System.Drawing.Size(2019, 28); + toolStrip2.TabIndex = 2; + toolStrip2.Text = "toolStrip2"; // // tsSummaryBack // - this.tsSummaryBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tsSummaryBack.Image = ((System.Drawing.Image)(resources.GetObject("tsSummaryBack.Image"))); - this.tsSummaryBack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tsSummaryBack.Name = "tsSummaryBack"; - this.tsSummaryBack.Size = new System.Drawing.Size(29, 25); - this.tsSummaryBack.Text = "Previous"; - this.tsSummaryBack.Click += new System.EventHandler(this.TsSummaryBack_Click); + tsSummaryBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + tsSummaryBack.Image = (System.Drawing.Image)resources.GetObject("tsSummaryBack.Image"); + tsSummaryBack.ImageTransparentColor = System.Drawing.Color.Magenta; + tsSummaryBack.Name = "tsSummaryBack"; + tsSummaryBack.Size = new System.Drawing.Size(29, 25); + tsSummaryBack.Text = "Previous"; + tsSummaryBack.Click += TsSummaryBack_Click; // // tsSummaryPageNum // - this.tsSummaryPageNum.Name = "tsSummaryPageNum"; - this.tsSummaryPageNum.Size = new System.Drawing.Size(53, 25); - this.tsSummaryPageNum.Text = "Page 1"; + tsSummaryPageNum.Name = "tsSummaryPageNum"; + tsSummaryPageNum.Size = new System.Drawing.Size(53, 25); + tsSummaryPageNum.Text = "Page 1"; // // tsSummaryNext // - this.tsSummaryNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tsSummaryNext.Image = ((System.Drawing.Image)(resources.GetObject("tsSummaryNext.Image"))); - this.tsSummaryNext.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tsSummaryNext.Name = "tsSummaryNext"; - this.tsSummaryNext.Size = new System.Drawing.Size(29, 25); - this.tsSummaryNext.Text = "Next"; - this.tsSummaryNext.Click += new System.EventHandler(this.TsSummaryNext_Click); + tsSummaryNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + tsSummaryNext.Image = (System.Drawing.Image)resources.GetObject("tsSummaryNext.Image"); + tsSummaryNext.ImageTransparentColor = System.Drawing.Color.Magenta; + tsSummaryNext.Name = "tsSummaryNext"; + tsSummaryNext.Size = new System.Drawing.Size(29, 25); + tsSummaryNext.Text = "Next"; + tsSummaryNext.Click += TsSummaryNext_Click; // // toolStripLabel3 // - this.toolStripLabel3.Name = "toolStripLabel3"; - this.toolStripLabel3.Size = new System.Drawing.Size(75, 25); - this.toolStripLabel3.Text = "Page Size:"; + toolStripLabel3.Name = "toolStripLabel3"; + toolStripLabel3.Size = new System.Drawing.Size(75, 25); + toolStripLabel3.Text = "Page Size:"; // // tsSummaryPageSize // - this.tsSummaryPageSize.Items.AddRange(new object[] { - "100", - "200", - "500", - "1000", - "5000"}); - this.tsSummaryPageSize.Name = "tsSummaryPageSize"; - this.tsSummaryPageSize.Size = new System.Drawing.Size(121, 28); - this.tsSummaryPageSize.Text = "100"; - this.tsSummaryPageSize.Validated += new System.EventHandler(this.TsSummaryPageSize_Validated); + tsSummaryPageSize.Items.AddRange(new object[] { "100", "200", "500", "1000", "5000" }); + tsSummaryPageSize.Name = "tsSummaryPageSize"; + tsSummaryPageSize.Size = new System.Drawing.Size(121, 28); + tsSummaryPageSize.Text = "100"; + tsSummaryPageSize.Validated += TsSummaryPageSize_Validated; + // + // lblStatus + // + lblStatus.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + lblStatus.Name = "lblStatus"; + lblStatus.Size = new System.Drawing.Size(0, 25); // // gvSnapshotsDetail // - this.gvSnapshotsDetail.AllowUserToAddRows = false; - this.gvSnapshotsDetail.AllowUserToDeleteRows = false; - this.gvSnapshotsDetail.BackgroundColor = System.Drawing.Color.White; + gvSnapshotsDetail.AllowUserToAddRows = false; + gvSnapshotsDetail.AllowUserToDeleteRows = false; + gvSnapshotsDetail.BackgroundColor = System.Drawing.Color.White; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F); dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gvSnapshotsDetail.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; - this.gvSnapshotsDetail.ColumnHeadersHeight = 29; - this.gvSnapshotsDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.colObjectName, - this.colSchemaName, - this.colAction, - this.colView, - this.colDiff}); + gvSnapshotsDetail.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + gvSnapshotsDetail.ColumnHeadersHeight = 29; + gvSnapshotsDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { colObjectName, colSchemaName, colAction, colView, colDiff }); dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F); dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.gvSnapshotsDetail.DefaultCellStyle = dataGridViewCellStyle5; - this.gvSnapshotsDetail.Dock = System.Windows.Forms.DockStyle.Fill; - this.gvSnapshotsDetail.Location = new System.Drawing.Point(0, 0); - this.gvSnapshotsDetail.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gvSnapshotsDetail.Name = "gvSnapshotsDetail"; - this.gvSnapshotsDetail.ReadOnly = true; - this.gvSnapshotsDetail.RowHeadersVisible = false; - this.gvSnapshotsDetail.RowHeadersWidth = 51; - this.gvSnapshotsDetail.RowTemplate.Height = 24; - this.gvSnapshotsDetail.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.gvSnapshotsDetail.Size = new System.Drawing.Size(2019, 490); - this.gvSnapshotsDetail.TabIndex = 0; - this.gvSnapshotsDetail.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.GvSnapshotsDetail_CellContentClick); + gvSnapshotsDetail.DefaultCellStyle = dataGridViewCellStyle5; + gvSnapshotsDetail.Dock = System.Windows.Forms.DockStyle.Fill; + gvSnapshotsDetail.Location = new System.Drawing.Point(0, 0); + gvSnapshotsDetail.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + gvSnapshotsDetail.Name = "gvSnapshotsDetail"; + gvSnapshotsDetail.ReadOnly = true; + gvSnapshotsDetail.RowHeadersVisible = false; + gvSnapshotsDetail.RowHeadersWidth = 51; + gvSnapshotsDetail.RowTemplate.Height = 24; + gvSnapshotsDetail.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + gvSnapshotsDetail.Size = new System.Drawing.Size(2019, 490); + gvSnapshotsDetail.TabIndex = 0; + gvSnapshotsDetail.CellContentClick += GvSnapshotsDetail_CellContentClick; // // colObjectName // - this.colObjectName.DataPropertyName = "ObjectName"; - this.colObjectName.HeaderText = "Object Name"; - this.colObjectName.MinimumWidth = 6; - this.colObjectName.Name = "colObjectName"; - this.colObjectName.ReadOnly = true; - this.colObjectName.Width = 119; + colObjectName.DataPropertyName = "ObjectName"; + colObjectName.HeaderText = "Object Name"; + colObjectName.MinimumWidth = 6; + colObjectName.Name = "colObjectName"; + colObjectName.ReadOnly = true; + colObjectName.Width = 119; // // colSchemaName // - this.colSchemaName.DataPropertyName = "SchemaName"; - this.colSchemaName.HeaderText = "Schema Name"; - this.colSchemaName.MinimumWidth = 6; - this.colSchemaName.Name = "colSchemaName"; - this.colSchemaName.ReadOnly = true; - this.colSchemaName.Width = 129; + colSchemaName.DataPropertyName = "SchemaName"; + colSchemaName.HeaderText = "Schema Name"; + colSchemaName.MinimumWidth = 6; + colSchemaName.Name = "colSchemaName"; + colSchemaName.ReadOnly = true; + colSchemaName.Width = 129; // // colAction // - this.colAction.DataPropertyName = "Action"; - this.colAction.HeaderText = "Action"; - this.colAction.MinimumWidth = 6; - this.colAction.Name = "colAction"; - this.colAction.ReadOnly = true; - this.colAction.Width = 76; + colAction.DataPropertyName = "Action"; + colAction.HeaderText = "Action"; + colAction.MinimumWidth = 6; + colAction.Name = "colAction"; + colAction.ReadOnly = true; + colAction.Width = 76; // // colView // - this.colView.DataPropertyName = "newDDLID"; - this.colView.HeaderText = "View"; - this.colView.MinimumWidth = 6; - this.colView.Name = "colView"; - this.colView.ReadOnly = true; - this.colView.Text = "View"; - this.colView.UseColumnTextForLinkValue = true; - this.colView.Width = 125; + colView.DataPropertyName = "newDDLID"; + colView.HeaderText = "View"; + colView.MinimumWidth = 6; + colView.Name = "colView"; + colView.ReadOnly = true; + colView.Text = "View"; + colView.UseColumnTextForLinkValue = true; + colView.Width = 125; // // colDiff // - this.colDiff.DataPropertyName = "OldDDLID"; - this.colDiff.HeaderText = "Diff"; - this.colDiff.MinimumWidth = 6; - this.colDiff.Name = "colDiff"; - this.colDiff.ReadOnly = true; - this.colDiff.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colDiff.Text = "Diff"; - this.colDiff.UseColumnTextForLinkValue = true; - this.colDiff.Width = 125; + colDiff.DataPropertyName = "OldDDLID"; + colDiff.HeaderText = "Diff"; + colDiff.MinimumWidth = 6; + colDiff.Name = "colDiff"; + colDiff.ReadOnly = true; + colDiff.Resizable = System.Windows.Forms.DataGridViewTriState.True; + colDiff.Text = "Diff"; + colDiff.UseColumnTextForLinkValue = true; + colDiff.Width = 125; // // dgvInstanceSummary // - this.dgvInstanceSummary.AllowUserToAddRows = false; - this.dgvInstanceSummary.AllowUserToDeleteRows = false; - this.dgvInstanceSummary.BackgroundColor = System.Drawing.Color.White; - this.dgvInstanceSummary.ColumnHeadersHeight = 29; - this.dgvInstanceSummary.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.colInstance, - this.colLastUpdated, - this.colLastValidated}); - this.dgvInstanceSummary.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgvInstanceSummary.Location = new System.Drawing.Point(0, 27); - this.dgvInstanceSummary.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.dgvInstanceSummary.Name = "dgvInstanceSummary"; - this.dgvInstanceSummary.ReadOnly = true; - this.dgvInstanceSummary.RowHeadersVisible = false; - this.dgvInstanceSummary.RowHeadersWidth = 51; - this.dgvInstanceSummary.RowTemplate.Height = 24; - this.dgvInstanceSummary.Size = new System.Drawing.Size(2019, 228); - this.dgvInstanceSummary.TabIndex = 3; - this.dgvInstanceSummary.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvInstanceSummary_CellContentClick); + dgvInstanceSummary.AllowUserToAddRows = false; + dgvInstanceSummary.AllowUserToDeleteRows = false; + dgvInstanceSummary.BackgroundColor = System.Drawing.Color.White; + dgvInstanceSummary.ColumnHeadersHeight = 29; + dgvInstanceSummary.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { colInstance, colLastUpdated, colLastValidated }); + dgvInstanceSummary.Dock = System.Windows.Forms.DockStyle.Fill; + dgvInstanceSummary.Location = new System.Drawing.Point(0, 27); + dgvInstanceSummary.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + dgvInstanceSummary.Name = "dgvInstanceSummary"; + dgvInstanceSummary.ReadOnly = true; + dgvInstanceSummary.RowHeadersVisible = false; + dgvInstanceSummary.RowHeadersWidth = 51; + dgvInstanceSummary.RowTemplate.Height = 24; + dgvInstanceSummary.Size = new System.Drawing.Size(2019, 228); + dgvInstanceSummary.TabIndex = 3; + dgvInstanceSummary.CellContentClick += DgvInstanceSummary_CellContentClick; + // + // colInstance + // + colInstance.DataPropertyName = "InstanceGroupName"; + colInstance.HeaderText = "Instance"; + colInstance.MinimumWidth = 6; + colInstance.Name = "colInstance"; + colInstance.ReadOnly = true; + colInstance.Resizable = System.Windows.Forms.DataGridViewTriState.True; + colInstance.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + colInstance.Width = 90; + // + // colLastUpdated + // + colLastUpdated.DataPropertyName = "LastUpdated"; + colLastUpdated.HeaderText = "Last Updated"; + colLastUpdated.MinimumWidth = 6; + colLastUpdated.Name = "colLastUpdated"; + colLastUpdated.ReadOnly = true; + colLastUpdated.Width = 122; + // + // colLastValidated + // + colLastValidated.DataPropertyName = "LastValidated"; + colLastValidated.HeaderText = "Last Validated"; + colLastValidated.MinimumWidth = 6; + colLastValidated.Name = "colLastValidated"; + colLastValidated.ReadOnly = true; + colLastValidated.Width = 127; // // toolStrip1 // - this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsRefresh, - this.tsBack}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(2019, 27); - this.toolStrip1.TabIndex = 4; - this.toolStrip1.Text = "toolStrip1"; + toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { tsRefresh, tsBack, tsTrigger }); + toolStrip1.Location = new System.Drawing.Point(0, 0); + toolStrip1.Name = "toolStrip1"; + toolStrip1.Size = new System.Drawing.Size(2019, 27); + toolStrip1.TabIndex = 4; + toolStrip1.Text = "toolStrip1"; // // tsRefresh // - this.tsRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tsRefresh.Image = global::DBADashGUI.Properties.Resources._112_RefreshArrow_Green_16x16_72; - this.tsRefresh.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tsRefresh.Name = "tsRefresh"; - this.tsRefresh.Size = new System.Drawing.Size(29, 24); - this.tsRefresh.Text = "Refresh"; - this.tsRefresh.Click += new System.EventHandler(this.TsRefresh_Click); + tsRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + tsRefresh.Image = Properties.Resources._112_RefreshArrow_Green_16x16_72; + tsRefresh.ImageTransparentColor = System.Drawing.Color.Magenta; + tsRefresh.Name = "tsRefresh"; + tsRefresh.Size = new System.Drawing.Size(29, 24); + tsRefresh.Text = "Refresh"; + tsRefresh.Click += TsRefresh_Click; // // tsBack // - this.tsBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tsBack.Image = global::DBADashGUI.Properties.Resources.Previous_grey_16x; - this.tsBack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tsBack.Name = "tsBack"; - this.tsBack.Size = new System.Drawing.Size(29, 24); - this.tsBack.Text = "Up level"; - this.tsBack.Click += new System.EventHandler(this.TsBack_Click); + tsBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + tsBack.Image = Properties.Resources.Previous_grey_16x; + tsBack.ImageTransparentColor = System.Drawing.Color.Magenta; + tsBack.Name = "tsBack"; + tsBack.Size = new System.Drawing.Size(29, 24); + tsBack.Text = "Up level"; + tsBack.Click += TsBack_Click; + // + // tsTrigger + // + tsTrigger.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + tsTrigger.Image = Properties.Resources.ProjectSystemModelRefresh_16x; + tsTrigger.ImageTransparentColor = System.Drawing.Color.Magenta; + tsTrigger.Name = "tsTrigger"; + tsTrigger.Size = new System.Drawing.Size(151, 24); + tsTrigger.Text = "Trigger Collection"; + tsTrigger.Visible = false; + tsTrigger.Click += tsTrigger_Click; // // dataGridViewTextBoxColumn1 // - this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.dataGridViewTextBoxColumn1.DataPropertyName = "DB"; - this.dataGridViewTextBoxColumn1.HeaderText = "DB"; - this.dataGridViewTextBoxColumn1.MinimumWidth = 6; - this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; - this.dataGridViewTextBoxColumn1.ReadOnly = true; - this.dataGridViewTextBoxColumn1.Width = 125; + dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + dataGridViewTextBoxColumn1.DataPropertyName = "DB"; + dataGridViewTextBoxColumn1.HeaderText = "DB"; + dataGridViewTextBoxColumn1.MinimumWidth = 6; + dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + dataGridViewTextBoxColumn1.ReadOnly = true; + dataGridViewTextBoxColumn1.Width = 125; // // dataGridViewTextBoxColumn2 // - this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn2.DataPropertyName = "SnapshotDate"; - this.dataGridViewTextBoxColumn2.HeaderText = "Snapshot Date"; - this.dataGridViewTextBoxColumn2.MinimumWidth = 6; - this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; - this.dataGridViewTextBoxColumn2.ReadOnly = true; - this.dataGridViewTextBoxColumn2.Width = 125; + dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn2.DataPropertyName = "SnapshotDate"; + dataGridViewTextBoxColumn2.HeaderText = "Snapshot Date"; + dataGridViewTextBoxColumn2.MinimumWidth = 6; + dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + dataGridViewTextBoxColumn2.ReadOnly = true; + dataGridViewTextBoxColumn2.Width = 125; // // dataGridViewTextBoxColumn3 // - this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn3.DataPropertyName = "ValidatedDate"; - this.dataGridViewTextBoxColumn3.HeaderText = "Validated Date"; - this.dataGridViewTextBoxColumn3.MinimumWidth = 6; - this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; - this.dataGridViewTextBoxColumn3.ReadOnly = true; - this.dataGridViewTextBoxColumn3.Width = 125; + dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn3.DataPropertyName = "ValidatedDate"; + dataGridViewTextBoxColumn3.HeaderText = "Validated Date"; + dataGridViewTextBoxColumn3.MinimumWidth = 6; + dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + dataGridViewTextBoxColumn3.ReadOnly = true; + dataGridViewTextBoxColumn3.Width = 125; // // dataGridViewTextBoxColumn4 // - this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn4.DataPropertyName = "ValidForDays"; - this.dataGridViewTextBoxColumn4.HeaderText = "Valid For (Days)"; - this.dataGridViewTextBoxColumn4.MinimumWidth = 6; - this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; - this.dataGridViewTextBoxColumn4.ReadOnly = true; - this.dataGridViewTextBoxColumn4.Width = 125; + dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn4.DataPropertyName = "ValidForDays"; + dataGridViewTextBoxColumn4.HeaderText = "Valid For (Days)"; + dataGridViewTextBoxColumn4.MinimumWidth = 6; + dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; + dataGridViewTextBoxColumn4.ReadOnly = true; + dataGridViewTextBoxColumn4.Width = 125; // // dataGridViewTextBoxColumn5 // - this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn5.DataPropertyName = "DaysSinceValidation"; - this.dataGridViewTextBoxColumn5.HeaderText = "Days Since Validation"; - this.dataGridViewTextBoxColumn5.MinimumWidth = 6; - this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; - this.dataGridViewTextBoxColumn5.ReadOnly = true; - this.dataGridViewTextBoxColumn5.Width = 125; + dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn5.DataPropertyName = "DaysSinceValidation"; + dataGridViewTextBoxColumn5.HeaderText = "Days Since Validation"; + dataGridViewTextBoxColumn5.MinimumWidth = 6; + dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; + dataGridViewTextBoxColumn5.ReadOnly = true; + dataGridViewTextBoxColumn5.Width = 125; // // dataGridViewTextBoxColumn6 // - this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn6.DataPropertyName = "Created"; - this.dataGridViewTextBoxColumn6.HeaderText = "Created"; - this.dataGridViewTextBoxColumn6.MinimumWidth = 6; - this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; - this.dataGridViewTextBoxColumn6.ReadOnly = true; - this.dataGridViewTextBoxColumn6.Width = 125; + dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn6.DataPropertyName = "Created"; + dataGridViewTextBoxColumn6.HeaderText = "Created"; + dataGridViewTextBoxColumn6.MinimumWidth = 6; + dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; + dataGridViewTextBoxColumn6.ReadOnly = true; + dataGridViewTextBoxColumn6.Width = 125; // // dataGridViewTextBoxColumn7 // - this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn7.DataPropertyName = "Modified"; - this.dataGridViewTextBoxColumn7.HeaderText = "Modified"; - this.dataGridViewTextBoxColumn7.MinimumWidth = 6; - this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; - this.dataGridViewTextBoxColumn7.ReadOnly = true; - this.dataGridViewTextBoxColumn7.Width = 125; + dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn7.DataPropertyName = "Modified"; + dataGridViewTextBoxColumn7.HeaderText = "Modified"; + dataGridViewTextBoxColumn7.MinimumWidth = 6; + dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; + dataGridViewTextBoxColumn7.ReadOnly = true; + dataGridViewTextBoxColumn7.Width = 125; // // dataGridViewTextBoxColumn8 // - this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn8.DataPropertyName = "Dropped"; - this.dataGridViewTextBoxColumn8.HeaderText = "Dropped"; - this.dataGridViewTextBoxColumn8.MinimumWidth = 6; - this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; - this.dataGridViewTextBoxColumn8.ReadOnly = true; - this.dataGridViewTextBoxColumn8.Width = 125; + dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn8.DataPropertyName = "Dropped"; + dataGridViewTextBoxColumn8.HeaderText = "Dropped"; + dataGridViewTextBoxColumn8.MinimumWidth = 6; + dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; + dataGridViewTextBoxColumn8.ReadOnly = true; + dataGridViewTextBoxColumn8.Width = 125; // // dataGridViewTextBoxColumn9 // - this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.dataGridViewTextBoxColumn9.DataPropertyName = "ObjectName"; - this.dataGridViewTextBoxColumn9.HeaderText = "Object Name"; - this.dataGridViewTextBoxColumn9.MinimumWidth = 6; - this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; - this.dataGridViewTextBoxColumn9.ReadOnly = true; - this.dataGridViewTextBoxColumn9.Width = 125; + dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + dataGridViewTextBoxColumn9.DataPropertyName = "ObjectName"; + dataGridViewTextBoxColumn9.HeaderText = "Object Name"; + dataGridViewTextBoxColumn9.MinimumWidth = 6; + dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; + dataGridViewTextBoxColumn9.ReadOnly = true; + dataGridViewTextBoxColumn9.Width = 125; // // dataGridViewTextBoxColumn10 // - this.dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.dataGridViewTextBoxColumn10.DataPropertyName = "SchemaName"; - this.dataGridViewTextBoxColumn10.HeaderText = "Schema Name"; - this.dataGridViewTextBoxColumn10.MinimumWidth = 6; - this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; - this.dataGridViewTextBoxColumn10.ReadOnly = true; - this.dataGridViewTextBoxColumn10.Width = 125; + dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + dataGridViewTextBoxColumn10.DataPropertyName = "SchemaName"; + dataGridViewTextBoxColumn10.HeaderText = "Schema Name"; + dataGridViewTextBoxColumn10.MinimumWidth = 6; + dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; + dataGridViewTextBoxColumn10.ReadOnly = true; + dataGridViewTextBoxColumn10.Width = 125; // // dataGridViewTextBoxColumn11 // - this.dataGridViewTextBoxColumn11.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn11.DataPropertyName = "Action"; - this.dataGridViewTextBoxColumn11.HeaderText = "Action"; - this.dataGridViewTextBoxColumn11.MinimumWidth = 6; - this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; - this.dataGridViewTextBoxColumn11.ReadOnly = true; - this.dataGridViewTextBoxColumn11.Width = 125; + dataGridViewTextBoxColumn11.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn11.DataPropertyName = "Action"; + dataGridViewTextBoxColumn11.HeaderText = "Action"; + dataGridViewTextBoxColumn11.MinimumWidth = 6; + dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; + dataGridViewTextBoxColumn11.ReadOnly = true; + dataGridViewTextBoxColumn11.Width = 125; // // dataGridViewTextBoxColumn12 // - this.dataGridViewTextBoxColumn12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.dataGridViewTextBoxColumn12.DataPropertyName = "SchemaName"; - this.dataGridViewTextBoxColumn12.HeaderText = "Schema Name"; - this.dataGridViewTextBoxColumn12.MinimumWidth = 6; - this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12"; - this.dataGridViewTextBoxColumn12.ReadOnly = true; - this.dataGridViewTextBoxColumn12.Width = 125; + dataGridViewTextBoxColumn12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + dataGridViewTextBoxColumn12.DataPropertyName = "SchemaName"; + dataGridViewTextBoxColumn12.HeaderText = "Schema Name"; + dataGridViewTextBoxColumn12.MinimumWidth = 6; + dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12"; + dataGridViewTextBoxColumn12.ReadOnly = true; + dataGridViewTextBoxColumn12.Width = 125; // // dataGridViewTextBoxColumn13 // - this.dataGridViewTextBoxColumn13.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.dataGridViewTextBoxColumn13.DataPropertyName = "Action"; - this.dataGridViewTextBoxColumn13.HeaderText = "Action"; - this.dataGridViewTextBoxColumn13.MinimumWidth = 6; - this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13"; - this.dataGridViewTextBoxColumn13.ReadOnly = true; - this.dataGridViewTextBoxColumn13.Width = 125; + dataGridViewTextBoxColumn13.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewTextBoxColumn13.DataPropertyName = "Action"; + dataGridViewTextBoxColumn13.HeaderText = "Action"; + dataGridViewTextBoxColumn13.MinimumWidth = 6; + dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13"; + dataGridViewTextBoxColumn13.ReadOnly = true; + dataGridViewTextBoxColumn13.Width = 125; // - // colInstance + // dataGridViewTextBoxColumn14 // - this.colInstance.DataPropertyName = "InstanceGroupName"; - this.colInstance.HeaderText = "Instance"; - this.colInstance.MinimumWidth = 6; - this.colInstance.Name = "colInstance"; - this.colInstance.ReadOnly = true; - this.colInstance.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colInstance.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colInstance.Width = 90; + dataGridViewTextBoxColumn14.DataPropertyName = "InstanceGroupName"; + dataGridViewTextBoxColumn14.HeaderText = "Instance"; + dataGridViewTextBoxColumn14.MinimumWidth = 6; + dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14"; + dataGridViewTextBoxColumn14.ReadOnly = true; + dataGridViewTextBoxColumn14.Width = 125; // - // colLastUpdated + // colDB // - this.colLastUpdated.DataPropertyName = "LastUpdated"; - this.colLastUpdated.HeaderText = "Last Updated"; - this.colLastUpdated.MinimumWidth = 6; - this.colLastUpdated.Name = "colLastUpdated"; - this.colLastUpdated.ReadOnly = true; - this.colLastUpdated.Width = 122; + colDB.DataPropertyName = "DB"; + colDB.HeaderText = "DB"; + colDB.MinimumWidth = 6; + colDB.Name = "colDB"; + colDB.ReadOnly = true; + colDB.Resizable = System.Windows.Forms.DataGridViewTriState.True; + colDB.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + colDB.Width = 56; // - // colLastValidated + // SnapshotDate // - this.colLastValidated.DataPropertyName = "LastValidated"; - this.colLastValidated.HeaderText = "Last Validated"; - this.colLastValidated.MinimumWidth = 6; - this.colLastValidated.Name = "colLastValidated"; - this.colLastValidated.ReadOnly = true; - this.colLastValidated.Width = 127; + SnapshotDate.DataPropertyName = "SnapshotDate"; + SnapshotDate.HeaderText = "Snapshot Date"; + SnapshotDate.MinimumWidth = 6; + SnapshotDate.Name = "SnapshotDate"; + SnapshotDate.ReadOnly = true; + SnapshotDate.Width = 131; + // + // ValidatedDate + // + ValidatedDate.DataPropertyName = "ValidatedDate"; + ValidatedDate.HeaderText = "Validated Date"; + ValidatedDate.MinimumWidth = 6; + ValidatedDate.Name = "ValidatedDate"; + ValidatedDate.ReadOnly = true; + ValidatedDate.Width = 130; + // + // ValidForDays + // + ValidForDays.DataPropertyName = "ValidForDays"; + ValidForDays.HeaderText = "Valid For (Days)"; + ValidForDays.MinimumWidth = 6; + ValidForDays.Name = "ValidForDays"; + ValidForDays.ReadOnly = true; + ValidForDays.Width = 125; + // + // DaysSinceValidation + // + DaysSinceValidation.DataPropertyName = "DaysSinceValidation"; + DaysSinceValidation.HeaderText = "Days Since Validation"; + DaysSinceValidation.MinimumWidth = 6; + DaysSinceValidation.Name = "DaysSinceValidation"; + DaysSinceValidation.ReadOnly = true; + DaysSinceValidation.Width = 125; + // + // colCreated + // + colCreated.DataPropertyName = "Created"; + colCreated.HeaderText = "Created"; + colCreated.MinimumWidth = 6; + colCreated.Name = "colCreated"; + colCreated.ReadOnly = true; + colCreated.Width = 87; + // + // Modified + // + Modified.DataPropertyName = "Modified"; + Modified.HeaderText = "Modified"; + Modified.MinimumWidth = 6; + Modified.Name = "Modified"; + Modified.ReadOnly = true; + Modified.Width = 90; + // + // Dropped + // + Dropped.DataPropertyName = "Dropped"; + Dropped.HeaderText = "Dropped"; + Dropped.MinimumWidth = 6; + Dropped.Name = "Dropped"; + Dropped.ReadOnly = true; + Dropped.Width = 92; + // + // colExport + // + colExport.HeaderText = "Export"; + colExport.MinimumWidth = 6; + colExport.Name = "colExport"; + colExport.ReadOnly = true; + colExport.Text = "Export"; + colExport.ToolTipText = "Export DB Schema to disk"; + colExport.UseColumnTextForLinkValue = true; + colExport.Width = 125; + // + // colTriggerSnapshot + // + colTriggerSnapshot.HeaderText = "Trigger Snapshot"; + colTriggerSnapshot.MinimumWidth = 6; + colTriggerSnapshot.Name = "colTriggerSnapshot"; + colTriggerSnapshot.ReadOnly = true; + colTriggerSnapshot.Text = "Trigger Snapshot"; + colTriggerSnapshot.UseColumnTextForLinkValue = true; + colTriggerSnapshot.Width = 125; // // SchemaSnapshots // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.dgvInstanceSummary); - this.Controls.Add(this.splitSnapshotSummary); - this.Controls.Add(this.toolStrip1); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "SchemaSnapshots"; - this.Size = new System.Drawing.Size(2019, 1526); - this.Load += new System.EventHandler(this.SchemaSnapshots_Load); - this.splitSnapshotSummary.Panel1.ResumeLayout(false); - this.splitSnapshotSummary.Panel1.PerformLayout(); - this.splitSnapshotSummary.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitSnapshotSummary)).EndInit(); - this.splitSnapshotSummary.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.gvSnapshots)).EndInit(); - this.toolStrip2.ResumeLayout(false); - this.toolStrip2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.gvSnapshotsDetail)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dgvInstanceSummary)).EndInit(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Controls.Add(dgvInstanceSummary); + Controls.Add(splitSnapshotSummary); + Controls.Add(toolStrip1); + Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + Name = "SchemaSnapshots"; + Size = new System.Drawing.Size(2019, 1526); + Load += SchemaSnapshots_Load; + splitSnapshotSummary.Panel1.ResumeLayout(false); + splitSnapshotSummary.Panel1.PerformLayout(); + splitSnapshotSummary.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)splitSnapshotSummary).EndInit(); + splitSnapshotSummary.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)gvSnapshots).EndInit(); + toolStrip2.ResumeLayout(false); + toolStrip2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)gvSnapshotsDetail).EndInit(); + ((System.ComponentModel.ISupportInitialize)dgvInstanceSummary).EndInit(); + toolStrip1.ResumeLayout(false); + toolStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -685,6 +684,11 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn colAction; private System.Windows.Forms.DataGridViewLinkColumn colView; private System.Windows.Forms.DataGridViewLinkColumn colDiff; + private System.Windows.Forms.DataGridViewLinkColumn colInstance; + private System.Windows.Forms.DataGridViewTextBoxColumn colLastUpdated; + private System.Windows.Forms.DataGridViewTextBoxColumn colLastValidated; + private System.Windows.Forms.ToolStripButton tsTrigger; + private System.Windows.Forms.ToolStripLabel lblStatus; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14; private System.Windows.Forms.DataGridViewLinkColumn colDB; private System.Windows.Forms.DataGridViewTextBoxColumn SnapshotDate; @@ -695,8 +699,6 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn Modified; private System.Windows.Forms.DataGridViewTextBoxColumn Dropped; private System.Windows.Forms.DataGridViewLinkColumn colExport; - private System.Windows.Forms.DataGridViewLinkColumn colInstance; - private System.Windows.Forms.DataGridViewTextBoxColumn colLastUpdated; - private System.Windows.Forms.DataGridViewTextBoxColumn colLastValidated; + private System.Windows.Forms.DataGridViewLinkColumn colTriggerSnapshot; } } diff --git a/DBADashGUI/SchemaCompare/SchemaSnapshots.cs b/DBADashGUI/SchemaCompare/SchemaSnapshots.cs index 36d2389f..00d9efe6 100644 --- a/DBADashGUI/SchemaCompare/SchemaSnapshots.cs +++ b/DBADashGUI/SchemaCompare/SchemaSnapshots.cs @@ -3,15 +3,20 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Drawing; using System.IO; using System.Linq; +using System.Threading.Tasks; using System.Windows.Forms; +using DBADashGUI.Interface; using DBADashGUI.Theme; using static DBADashGUI.DiffControl; +using DBADash; +using DBADashGUI.Messaging; namespace DBADashGUI.Changes { - public partial class SchemaSnapshots : UserControl, INavigation, ISetContext + public partial class SchemaSnapshots : UserControl, INavigation, ISetContext, ISetStatus { public SchemaSnapshots() { @@ -24,6 +29,7 @@ public SchemaSnapshots() private string InstanceName; private int DatabaseID; private List InstanceIDs; + private DBADashContext CurrentContext; public bool CanNavigateBack { get => tsBack.Enabled; } @@ -87,11 +93,20 @@ public void SetContext(DBADashContext context) InstanceName = context.InstanceName; DatabaseID = context.DatabaseID; InstanceIDs = context.InstanceIDs.ToList(); + lblStatus.Text = ""; + tsTrigger.Visible = context.CanMessage; + CurrentContext = context; + colTriggerSnapshot.Visible = DBADashUser.AllowMessaging; RefreshData(); } public void RefreshData() { + if (this.InvokeRequired) + { + this.Invoke(RefreshData); + return; + } if (InstanceID > 0 || InstanceName is { Length: > 0 }) { LoadSnapshots(); @@ -104,6 +119,11 @@ public void RefreshData() } } + public void SetStatus(string message, string tooltip, Color color) + { + lblStatus.InvokeSetStatus(message, tooltip, color); + } + private DataTable DdlSnapshotInstanceSummary() { using (var cn = new SqlConnection(Common.ConnectionString)) @@ -208,7 +228,7 @@ private void SchemaSnapshots_Load(object sender, EventArgs e) splitSnapshotSummary.Dock = DockStyle.Fill; } - private void GvSnapshots_CellContentClick(object sender, DataGridViewCellEventArgs e) + private async void GvSnapshots_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex == colDB.Index) { @@ -221,6 +241,28 @@ private void GvSnapshots_CellContentClick(object sender, DataGridViewCellEventAr var row = (DataRowView)gvSnapshots.Rows[e.RowIndex].DataBoundItem; Export(row); } + else if (e.RowIndex >= 0 && e.ColumnIndex == colTriggerSnapshot.Index) + { + var row = (DataRowView)gvSnapshots.Rows[e.RowIndex].DataBoundItem; + await TriggerSchemaSnapshot(row); + } + } + + private async Task TriggerSchemaSnapshot(DataRowView row) + { + var _instanceID = (int)row["InstanceID"]; + var db = (string)row["DB"]; + var tempContext = (DBADashContext)CurrentContext.Clone(); + tempContext.InstanceID = _instanceID; + if (tempContext.CanMessage) + { + await CollectionMessaging.TriggerCollection(_instanceID, new List { CollectionType.SchemaSnapshot }, this, db); + } + else + { + SetStatus("Collections can't be triggered for this instance.", "Enable messaging in the service configuration tool to allow communication", DashColors.Warning); + } + } private void Export(DataRowView row) @@ -312,5 +354,19 @@ public bool NavigateBack() return false; } } + + private async void tsTrigger_Click(object sender, EventArgs e) + { + if (InstanceID <=0) + { + lblStatus.Text = "Please select a single instance to trigger a collection"; + } + + if (MessageBox.Show("This collection might take some time to process depending on the number of databases and objects within those databases. Are you sure you want to trigger a collection?", "Trigger Collection", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + await CollectionMessaging.TriggerCollection(InstanceID, CollectionType.SchemaSnapshot, this); + } + } } } \ No newline at end of file diff --git a/DBADashGUI/SchemaCompare/SchemaSnapshots.resx b/DBADashGUI/SchemaCompare/SchemaSnapshots.resx index 215fcbec..4ffa4e13 100644 --- a/DBADashGUI/SchemaCompare/SchemaSnapshots.resx +++ b/DBADashGUI/SchemaCompare/SchemaSnapshots.resx @@ -1,4 +1,64 @@ - + + + @@ -87,6 +147,9 @@ True + + True + 17, 17