public PolicyChangeLog() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); // hook the toolbar labels to the grids so the heading can be used for printing _grid_ChangeLog.Tag = _label_ChangeLog; // hook the grids to the toolbars so they can be used for button processing _headerStrip_ChangeLog.Tag = _grid_ChangeLog; // Hookup all application images _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // set all grids to start in the same initial display mode _grid_ChangeLog.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; // Initialize the grids initDataSources(); // Hide the focus rectangles on tabs and grids _grid_ChangeLog.DrawFilter = new HideFocusRectangleDrawFilter(); }
public AuditedServers() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); // hook the toolbar labels to the grids so the heading can be used for printing _grid_Servers.Tag = _label_AuditedServers; _grid_Databases.Tag = _label_Databases; // hook the grids to the toolbars so they can be used for button processing _headerStrip_Servers.Tag = _grid_Servers; _headerStrip_Databases.Tag = _grid_Databases; _toolStripButton_ServersColumnChooser.Image = _toolStripButton_DatabasesColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_ServersGroupBy.Image = _toolStripButton_DatabasesGroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_ServersSave.Image = _toolStripButton_DatabasesSave.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_ServersPrint.Image = _toolStripButton_DatabasesPrint.Image = AppIcons.AppImage16(AppIcons.Enum.Print); _cmsi_Server_exploreUserPermissions.Image = AppIcons.AppImage16(AppIcons.Enum.UserPermissions); _cmsi_Server_exploreSnapshot.Image = AppIcons.AppImage16(AppIcons.Enum.ObjectExplorer); _cmsi_Server_properties.Image = AppIcons.AppImage16(AppIcons.Enum.Properties); _cmsi_Server_refresh.Image = AppIcons.AppImage16(AppIcons.Enum.Refresh); _cmsi_Server_registerSQLServer.Image = AppIcons.AppImage16(AppIcons.Enum.AuditSQLServer); _cmsi_Server_removeSQLServer.Image = AppIcons.AppImage16(AppIcons.Enum.Remove); _cmsi_Server_collectDataSnapshot.Image = AppIcons.AppImage16(AppIcons.Enum.CollectDataSnapshot); _cmsi_Server_configureDataCollection.Image = AppIcons.AppImage16(AppIcons.Enum.ConfigureAuditSettingsSM); // load value lists for grid display ValueList severityValueList = new ValueList(); severityValueList.Key = ValueListYesNo; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; _grid_Databases.DisplayLayout.ValueLists.Add(severityValueList); ValueListItem listItem; severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(true, "Yes"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); severityValueList.ValueListItems.Add(listItem); // Initialize the grids initDataSources(); _grid_Servers.DisplayLayout.FilterDropDownButtonImage = AppIcons.AppImage16(AppIcons.Enum.GridFilter); _grid_Servers.DrawFilter = new Utility.HideFocusRectangleDrawFilter(); _grid_Servers.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; _grid_Databases.DrawFilter = new Utility.HideFocusRectangleDrawFilter(); _grid_Databases.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; }
internal controlConfigurePolicyVulnerabilities(ConfigurePolicyControlType state) { // SQLsecure 3.1 (Anshul Aggarwal) - Represents current state of control - 'Configure Security Check' or 'Export/Import Policy'. m_ControlType = state; InitializeComponent(); ultraTabControl1.DrawFilter = new HideFocusRectangleDrawFilter(); _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // load value lists for grid display ValueListItem listItem; ValueList severityValueList = new ValueList(); severityValueList.Key = Utility.Constants.POLICY_METRIC_VALUE_LIST_SERVERITY; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(severityValueList); severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(Utility.Policy.Severity.Ok, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Ok)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Low, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Medium, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.High, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Undetermined, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Undetermined)); listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); ValueList enabledValueList = new ValueList(); enabledValueList.Key = Utility.Constants.POLICY_METRIC_VALUE_LIST_ENABLED; enabledValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(enabledValueList); listItem = new ValueListItem(true, "Yes"); enabledValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); enabledValueList.ValueListItems.Add(listItem); // SQLsecure 3.1 (Anshul Aggarwal) - Change control state based on current control usage type. RefreshState(); }
public DbPrincipalPermissionsGrid() { InitializeComponent(); // Set the button images. _mi_ShowGroupByBox.Image = _tsbtn_GroupByBox.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _mi_Print.Image = _tsbtn_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); _mi_SaveToExcel.Image = _tsbtn_SaveAs.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _mi_ColumnChooser.Image = _tsbtn_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); // Hide the progress controls. _progressBar.Visible = false; _lbl_Status.Visible = false; // Setup the print document format. _ultraGridPrintDocument.DefaultPageSettings.Landscape = true; _ultraGridPrintDocument.DefaultPageSettings.Color = false; }
public Snapshots() : base() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); m_dt_snapshots.Columns.Add(colIcon, typeof(Image)); m_dt_snapshots.Columns.Add(colId, typeof(int)); m_dt_snapshots.Columns.Add(colStartDate, typeof(DateTime)); m_dt_snapshots.Columns.Add(colStartTime, typeof(DateTime)); //m_dt_snapshots.Columns.Add(colAutomated, typeof(Image)); m_dt_snapshots.Columns.Add(colStatus, typeof(String)); m_dt_snapshots.Columns.Add(colComments, typeof(String)); m_dt_snapshots.Columns.Add(colBaseline, typeof(String)); m_dt_snapshots.Columns.Add(colBaselineComments, typeof(String)); m_dt_snapshots.Columns.Add(colObjects, typeof(int)); m_dt_snapshots.Columns.Add(colPermissions, typeof(int)); m_dt_snapshots.Columns.Add(colLogins, typeof(int)); m_dt_snapshots.Columns.Add(colWindowsGroupMembers, typeof(int)); m_dt_snapshots.Columns.Add(colSnapshot, typeof(object)); _toolStripButton_GridColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GridGroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_GridSave.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_GridPrint.Image = AppIcons.AppImage16(AppIcons.Enum.Print); _cmsi_Snapshot_exploreUserPermissions.Image = AppIcons.AppImage16(AppIcons.Enum.UserPermissions); _cmsi_Snapshot_exploreSnapshot.Image = AppIcons.AppImage16(AppIcons.Enum.ObjectExplorer); _cmsi_Snapshot_baselineSnapshot.Image = AppIcons.AppImage16(AppIcons.Enum.MarkAsBaseline); _cmsi_Snapshot_deleteSnapshot.Image = AppIcons.AppImage16(AppIcons.Enum.Remove); //_cmsi_Snapshot_GroupByBox.Image - uses a checked value/image instead of app image _cmsi_Snapshot_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _cmsi_Snapshot_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); _cmsi_Snapshot_refresh.Image = AppIcons.AppImage16(AppIcons.Enum.Refresh); _cmsi_Snapshot_properties.Image = AppIcons.AppImage16(AppIcons.Enum.Properties); _label_Snapshot.Text = HeaderSnapshots; _grid.DisplayLayout.FilterDropDownButtonImage = AppIcons.AppImage16(AppIcons.Enum.GridFilter); _grid.DrawFilter = new Utility.HideFocusRectangleDrawFilter(); _grid.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; }
public PolicySummary() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); // hook the toolbar labels to the grids so the heading can be used for printing _grid_Servers.Tag = _label_Servers; // hook the grids to the toolbars so they can be used for button processing _headerStrip_Servers.Tag = _grid_Servers; // Hookup all application images _toolStripButton_ServersSave.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_ServersPrint.Image = AppIcons.AppImage16(AppIcons.Enum.Print); initDataSource(); // Hide the focus rectangles on tabs and grids _grid_Servers.DrawFilter = new HideFocusRectangleDrawFilter(); }
protected void showCollect() { Debug.Assert((_grid_Servers.ActiveRow != null), "No selected server row in grid"); if (_grid_Servers.ActiveRow != null) { string server = _grid_Servers.ActiveRow.Cells[colServer].Text; try { Forms.Form_StartSnapshotJobAndShowProgress.Process(server); this._grid_Servers.BeginUpdate(); _grid_Servers.ActiveRow.Cells[colIcon].Value = AppIcons.AppImage16(AppIcons.Enum.ServerInProgress); _grid_Servers.ActiveRow.Cells[colCollectionStatus].Value = @"Running"; this._grid_Servers.EndUpdate(); } catch (Exception ex) { Utility.MsgBox.ShowError(Utility.ErrorMsgs.SQLsecureDataCollection, Utility.ErrorMsgs.CantRunDataCollection, ex); } } }
public ControlImportExportPolicyVulnerabilities() { InitializeComponent(); // Hide all radio buttons for single selection group box radioButton1.Visible = false; radioButton2.Visible = false; radioButton3.Visible = false; radioButton4.Visible = false; radioButton5.Visible = false; radioButton6.Visible = false; radioButton7.Visible = false; radioButton8.Visible = false; // Hide single selectin group box groupBox_TriggerSingle.Visible = false; // Hide all checkboxes for multiple selection group box checkBox1.Visible = false; checkBox2.Visible = false; checkBox3.Visible = false; checkBox4.Visible = false; checkBox5.Visible = false; checkBox6.Visible = false; checkBox7.Visible = false; checkBox8.Visible = false; // Hide multiple selection group box groupBox_CriteriaMultiple.Visible = false; // Hide User Entered Multiple Selection group box groupBox_CriteriaUserEnterMultiple.Visible = false; // Hide User Entered Single Selection group box groupBox_CriteriaUserEnterSingle.Visible = false; // Hide Enabled Disabled Only group box groupBox_TriggerDisabledEnabledOnly.Visible = false; radioButton_SeverityCritical.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High); radioButton_SeverityMedium.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium); radioButton_SeverityLow.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low); _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // load value lists for grid display ValueListItem listItem; ValueList severityValueList = new ValueList(); severityValueList.Key = valueListSeverity; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(severityValueList); severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(Utility.Policy.Severity.Ok, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Ok)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Low, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Medium, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.High, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Undetermined, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Undetermined)); listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); ValueList enabledValueList = new ValueList(); enabledValueList.Key = valueListEnabled; enabledValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(enabledValueList); listItem = new ValueListItem(true, "Yes"); enabledValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); enabledValueList.ValueListItems.Add(listItem); }
public PolicyUsers() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); _ultraTabControl_Users.ImageList = AppIcons.AppImageList16(); // hook the toolbar labels to the grids so the heading can be used for printing _grid_Users.Tag = _label_Users; // hook the grids to the toolbars so they can be used for button processing _headerStrip_Users.Tag = _grid_Users; // Hookup all application images _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // set all grids to start in the same initial display mode _grid_Users.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; // load value lists for grid display ValueList severityValueList = new ValueList(); severityValueList.Key = ValueListYesNo; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; _grid_Users.DisplayLayout.ValueLists.Add(severityValueList); ValueListItem listItem; severityValueList.ValueListItems.Clear(); listItem = new ValueListItem("Y", "Yes"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem("N", "No"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(string.Empty, "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(" ", "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(null, "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(DBNull.Value, "N/A"); severityValueList.ValueListItems.Add(listItem); // Initialize the tabs _ultraTabControl_Users.SuspendLayout(); _ultraTabControl_Users.Tabs.Clear(); //Start-SQLsecure 3.1 (Tushar)--Adding support for Azure SQL Database. string[] userTypes; if (m_serverInstance != null && m_serverInstance.ServerType == ServerType.AzureSQLDatabase) { userTypes = new string[] { tabKey_AzureSQLDatabase, tabKey_Sql, tabKey_All }; } else if (m_serverInstance != null && m_serverInstance.ServerType != ServerType.AzureSQLDatabase) { userTypes = new string[] { tabKey_Windows, tabKey_Sql, tabKey_All }; } else { userTypes = new string[] { tabKey_Windows, tabKey_AzureSQLDatabase, tabKey_Sql, tabKey_All }; } foreach (string usertype in userTypes) { _ultraTabControl_Users.Tabs.Add(usertype, usertype); } //End-SQLsecure 3.1 (Tushar)--Adding support for Azure SQL Database. _ultraTabControl_Users.ResumeLayout(); // Initialize the grids initDataSource(); // Hide the focus rectangles on tabs and grids _ultraTabControl_Users.DrawFilter = new HideFocusRectangleDrawFilter(); _grid_Users.DrawFilter = new HideFocusRectangleDrawFilter(); }
internal controlConfigureMetricCriteria(ConfigurePolicyControlType controlType) { // SQLsecure 3.1 (Anshul Aggarwal) - Represents current state of control - 'Configure Security Check' or 'Export/Import Policy'. m_ControlType = controlType; InitializeComponent(); // Hide all radio buttons for single selection group box radioButton1.Visible = false; radioButton2.Visible = false; radioButton3.Visible = false; radioButton4.Visible = false; radioButton5.Visible = false; radioButton6.Visible = false; radioButton7.Visible = false; radioButton8.Visible = false; // Hide single selectin group box groupBox_TriggerSingle.Visible = groupBox_TriggerSingle.Enabled = false; // Hide all checkboxes for multiple selection group box checkBox1.Visible = false; checkBox2.Visible = false; checkBox3.Visible = false; checkBox4.Visible = false; checkBox5.Visible = false; checkBox6.Visible = false; checkBox7.Visible = false; checkBox8.Visible = false; // Hide multiple selection group box groupBox_CriteriaMultiple.Visible = groupBox_CriteriaMultiple.Enabled = false; // Hide User Entered Multiple Selection group box groupBox_CriteriaUserEnterMultiple.Visible = groupBox_CriteriaUserEnterMultiple.Enabled = false; // Hide User Entered Single Selection group box groupBox_CriteriaUserEnterSingle.Visible = groupBox_CriteriaUserEnterSingle.Enabled = false; // Hide Enabled Disabled Only group box groupBox_TriggerDisabledEnabledOnly.Visible = groupBox_TriggerDisabledEnabledOnly.Enabled = false; radioButton_SeverityCritical.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High); radioButton_SeverityMedium.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium); radioButton_SeverityLow.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low); // load value lists for grid display ValueListItem listItem; ValueList severityValueList = new ValueList(); severityValueList.Key = valueListSeverity; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(Utility.Policy.Severity.Ok, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Ok)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Low, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Medium, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.High, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Undetermined, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Undetermined)); listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); ValueList enabledValueList = new ValueList(); enabledValueList.Key = valueListEnabled; enabledValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; listItem = new ValueListItem(true, "Yes"); enabledValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); enabledValueList.ValueListItems.Add(listItem); // SQLsecure 3.1 (Anshul Aggarwal) - Change control state based on current control usage type. RefreshState(); }
private void updateSystemStatus() { string status = string.Empty; UltraToolTipInfo tooltip; // Set the status. if (m_IsConnected) { // get SQL Server Agent Status if (m_IsAgentOk) { if (Program.gController.isAdmin) { _pictureBox_Agent.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.AgentStarted); _linkLabel_AgentStatus.Text = Utility.ErrorMsgs.SQLServerAgentStarted; tooltip = new UltraToolTipInfo(ToolTip_AgentOK, ToolTipImage.Info, ToolTip_AgentTitle, Infragistics.Win.DefaultableBoolean.False); } else { _pictureBox_Agent.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); _linkLabel_AgentStatus.Text = Utility.ErrorMsgs.SQLServerAgentUnknown; tooltip = new UltraToolTipInfo(ToolTip_AgentUnknown, ToolTipImage.Warning, ToolTip_AgentTitle, Infragistics.Win.DefaultableBoolean.False); } } else { _pictureBox_Agent.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.AgentStopped); _linkLabel_AgentStatus.Text = Utility.ErrorMsgs.SQLServerAgentStopped; tooltip = new UltraToolTipInfo(ToolTip_AgentBad, ToolTipImage.Error, ToolTip_AgentTitle, Infragistics.Win.DefaultableBoolean.False); status += (status.Length == 0 ? string.Empty : "\n") + StatusAttend_Agent; } _linkLabel_AgentStatus.LinkArea = new LinkArea(0, _linkLabel_AgentStatus.Text.Length); _ultraToolTipManager.SetUltraToolTip(_linkLabel_AgentStatus, tooltip); // get License Status if (m_IsLicenseOk) { if (m_IsLicenseNotExpiring) { _pictureBox_License.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_32; _linkLabel_LicenseStatus.Text = Status_LicenseOK; } else { _linkLabel_LicenseStatus.Text = Status_LicenseExpiring; _pictureBox_License.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.warning_32; status += (status.Length == 0 ? string.Empty : "\n") + StatusAttend_License; } } else { _linkLabel_LicenseStatus.Text = Status_LicenseBad; _pictureBox_License.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.error_32; status += (status.Length == 0 ? string.Empty : "\n") + StatusAttend_License; } if (Program.gController.Permissions.hasSecurity(Utility.Security.Functions.ManageLicense)) { _linkLabel_LicenseStatus.LinkArea = new LinkArea(0, _linkLabel_LicenseStatus.Text.Length); } else { _linkLabel_LicenseStatus.LinkArea = new LinkArea(0, 0); } // get Audited Servers Status if (m_AllServersOk) { _pictureBox_Servers.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources._32_SystemOK; _linkLabel_ServersStatus.Text = Status_ServersOK; tooltip = new UltraToolTipInfo(m_ServersWarn == 0 ? ToolTip_ServersOK : String.Format(ToolTip_ServersWarn, m_ServersWarn.ToString()), ToolTipImage.Info, ToolTip_ServersTitle, Infragistics.Win.DefaultableBoolean.False); } else { if (m_ServersError == m_Servers.Count) { _pictureBox_Servers.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources._32_SystemWarn; _linkLabel_ServersStatus.Text = String.Format(Status_ServersBad, m_ServersError.ToString()); tooltip = new UltraToolTipInfo(ToolTip_ServersAllBad, ToolTipImage.Error, ToolTip_ServersTitle, Infragistics.Win.DefaultableBoolean.False); } else { _pictureBox_Servers.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources._32_SystemWarn; _linkLabel_ServersStatus.Text = String.Format(Status_ServersBad, m_ServersError.ToString()); tooltip = new UltraToolTipInfo(m_ServersWarn == 0 ? String.Format(ToolTip_ServersBad, m_ServersWarn.ToString()) : String.Format(ToolTip_ServersWarnBad, m_ServersError.ToString(), m_ServersWarn.ToString()), ToolTipImage.Error, ToolTip_ServersTitle, Infragistics.Win.DefaultableBoolean.False); } status += (status.Length == 0 ? string.Empty : "\n") + StatusAttend_Servers; } _linkLabel_ServersStatus.LinkArea = new LinkArea(0, _linkLabel_ServersStatus.Text.Length); _ultraToolTipManager.SetUltraToolTip(_linkLabel_ServersStatus, tooltip); // Overall repository status if (m_IsAgentOk && m_IsLicenseOk && m_IsLicenseNotExpiring && m_AllServersOk) { _pictureBox_ServerStatus.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.StatusGood); _linkLabel_ServerStatus.Text = SystemNormal; } else { if (m_ServersError == m_Servers.Count) { _pictureBox_ServerStatus.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.StatusError); _linkLabel_ServerStatus.Text = status; } else { _pictureBox_ServerStatus.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.StatusWarning); _linkLabel_ServerStatus.Text = status; } } // Repository Info _lbl_Repository.Text = String.Format(ServerFmt, Program.gController.Repository.Instance, Program.gController.Repository.SQLServerVersionFriendlyLong); _lbl_License.Text = String.Format(LicenseFmt, Program.gController.Repository.GetStrLicensedServers()); _lbl_Size.Text = m_DbSize; _lbl_LastGroomed.Text = m_LastGroomed == null ? "Never" : m_LastGroomed.Value.ToString(Utility.Constants.DATETIME_FORMAT); } else { //_pictureBox_ServerStatus.Image = AppIcons.AppImage48(AppIcons.EnumImageList48.StatusWarning); //_linkLabel_ServerStatus.Text = SystemNotConnected; _lbl_Repository.Text = SystemNotConnected; _lbl_License.Text = _lbl_Size.Text = _lbl_LastGroomed.Text = String.Empty; } }
private void updateData() { logX.loggerX.Info("Load Audited Servers"); // Clear the grid. m_ServersTable.Clear(); // Process each server in the list, if available. m_Servers = Sql.RegisteredServer.LoadRegisteredServers(Program.gController.Repository.ConnectionString); if (m_Servers != null) { Image icon = null; foreach (Sql.RegisteredServer srvr in m_Servers) { // Get the icon image based on the status. if (string.Compare(srvr.CurrentCollectionStatus, Utility.Snapshot.StatusSuccessfulText, true) == 0) { icon = AppIcons.AppImage16(AppIcons.Enum.ServerOK); } else if (string.Compare(srvr.CurrentCollectionStatus, Utility.Snapshot.StatusInProgressText, true) == 0) { icon = AppIcons.AppImage16(AppIcons.Enum.ServerInProgress); } else if (string.Compare(srvr.CurrentCollectionStatus, Utility.Snapshot.StatusWarningText, true) == 0) { icon = AppIcons.AppImage16(AppIcons.Enum.ServerWarn); } else if (string.Compare(srvr.CurrentCollectionStatus, Utility.Snapshot.StatusErrorText, true) == 0) { icon = AppIcons.AppImage16(AppIcons.Enum.ServerError); } else { icon = AppIcons.AppImage16(AppIcons.Enum.Unknown); } // Add the table entry. m_ServersTable.Rows.Add(icon, srvr.ConnectionName, srvr.VersionFriendly, srvr.CurrentCollectionTime, srvr.CurrentCollectionStatus); } } // Update the grid. _grid_Servers.BeginUpdate(); _grid_Servers.SetDataBinding(m_ServersTable, null); if (!m_Initialized) { foreach (UltraGridColumn col in _grid_Servers.DisplayLayout.Bands[0].Columns) { col.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true); } _grid_Servers.DisplayLayout.Bands[0].SortedColumns.Add(colServer, false, false); } if (_grid_Servers.Rows.Count > 0 && _grid_Servers.Selected.Rows.Count == 0) { UltraGridRow row = _grid_Servers.DisplayLayout.Rows.GetAllNonGroupByRows()[0]; row.Selected = true; row.Activate(); } else { m_SelectedServer = string.Empty; updateDatabases(); } _grid_Servers.EndUpdate(); _label_AuditedServers.Text = string.Format(HeaderServersDisplay, _grid_Servers.Rows.Count.ToString()); _panel_AuditedServers.Enabled = Program.gController.Repository.IsValid; m_Initialized = true; }