C2024-031 Option to Disable reopen closed tabs on PROMS reentry
This commit is contained in:
parent
accc1c622c
commit
23a4edb610
@ -24039,6 +24039,66 @@ GO
|
|||||||
==========================================================================================================
|
==========================================================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
---The following RememberOpenTabs/AlwaysOpenTabs columns were added for Remeber Open Tabs.
|
||||||
|
--- RememberOpenTabs = Do not prompt User when PROMS opens
|
||||||
|
--- AutoOpenTabs = OpenTabs when PROMS opens - Default to On
|
||||||
|
IF NOT EXISTS(SELECT *
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE TABLE_NAME = 'Users'
|
||||||
|
AND COLUMN_NAME = 'RememberOpenTabs')
|
||||||
|
ALTER TABLE Users ADD RememberOpenTabs bit NOT NULL DEFAULT(0);
|
||||||
|
go
|
||||||
|
-- Display the status
|
||||||
|
IF (@@Error = 0) PRINT 'Altered table [Users] Succeeded for RememberOpenTabs'
|
||||||
|
ELSE PRINT 'Altered table [Users] Error on Alter for RememberOpenTabs'
|
||||||
|
go
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT *
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE TABLE_NAME = 'Users'
|
||||||
|
AND COLUMN_NAME = 'AutoOpenTabs')
|
||||||
|
ALTER TABLE Users ADD AutoOpenTabs bit NOT NULL DEFAULT(1);
|
||||||
|
go
|
||||||
|
-- Display the status
|
||||||
|
IF (@@Error = 0) PRINT 'Altered table [Users] Succeeded for AutoOpenTabs'
|
||||||
|
ELSE PRINT 'Altered table [Users] Error on Alter for AutoOpenTabs'
|
||||||
|
go
|
||||||
|
|
||||||
|
/****** Object: StoredProcedure [dbo].[vesp_UpdateUserSettings] Script Date: 10/24/2024 11:29:44 AM ******/
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_UpdateUserSettings]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [vesp_UpdateUserSettings];
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
GO
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
GO
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 10/24/2024
|
||||||
|
-- Description: Update User Settings
|
||||||
|
-- =============================================
|
||||||
|
CREATE PROCEDURE [dbo].[vesp_UpdateUserSettings]
|
||||||
|
|
||||||
|
(
|
||||||
|
@UID varchar(100),
|
||||||
|
@Remember bit = null,
|
||||||
|
@AutoOpen bit = null
|
||||||
|
)
|
||||||
|
WITH EXECUTE AS OWNER
|
||||||
|
AS
|
||||||
|
UPDATE Users SET
|
||||||
|
RememberOpenTabs = ISNULL(@Remember,RememberOpenTabs),
|
||||||
|
AutoOpenTabs = ISNULL(@AutoOpen,AutoOpenTabs)
|
||||||
|
WHERE UserID =@UID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Running vesp_UpdateUserSettings Succeeded'
|
||||||
|
ELSE PRINT 'Running vesp_UpdateUserSettings Failed to Execute'
|
||||||
|
GO
|
||||||
|
|
||||||
/*
|
/*
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
| ADD New Code Before this Block |
|
| ADD New Code Before this Block |
|
||||||
@ -24072,7 +24132,7 @@ BEGIN TRY -- Try Block
|
|||||||
DECLARE @RevDate varchar(255)
|
DECLARE @RevDate varchar(255)
|
||||||
DECLARE @RevDescription varchar(255)
|
DECLARE @RevDescription varchar(255)
|
||||||
|
|
||||||
set @RevDate = '10/03/2024 11:24'
|
set @RevDate = '10/28/2024 11:24'
|
||||||
set @RevDescription = 'Add the ability for PROMS to remember the procedure tabs that were open when you closed PROMS'
|
set @RevDescription = 'Add the ability for PROMS to remember the procedure tabs that were open when you closed PROMS'
|
||||||
|
|
||||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||||
|
@ -163,6 +163,12 @@
|
|||||||
<Compile Include="dlgCheckedOutProcedure.designer.cs">
|
<Compile Include="dlgCheckedOutProcedure.designer.cs">
|
||||||
<DependentUpon>dlgCheckedOutProcedure.cs</DependentUpon>
|
<DependentUpon>dlgCheckedOutProcedure.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="dlgCheckOpenTabs.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="dlgCheckOpenTabs.Designer.cs">
|
||||||
|
<DependentUpon>dlgCheckOpenTabs.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="DlgCloseTabsOrExit.cs">
|
<Compile Include="DlgCloseTabsOrExit.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -324,6 +330,9 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
|
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="dlgCheckOpenTabs.resx">
|
||||||
|
<DependentUpon>dlgCheckOpenTabs.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="DlgCloseTabsOrExit.resx">
|
<EmbeddedResource Include="DlgCloseTabsOrExit.resx">
|
||||||
<DependentUpon>DlgCloseTabsOrExit.cs</DependentUpon>
|
<DependentUpon>DlgCloseTabsOrExit.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
@ -626,4 +635,4 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>cmd /c "$(ProjectDir)FixRev.bat"</PreBuildEvent>
|
<PreBuildEvent>cmd /c "$(ProjectDir)FixRev.bat"</PreBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
116
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.Designer.cs
generated
Normal file
116
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.Designer.cs
generated
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
partial class dlgCheckOpenTabs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.labelX1 = new DevComponents.DotNetBar.LabelX();
|
||||||
|
this.cbRemember = new DevComponents.DotNetBar.Controls.CheckBoxX();
|
||||||
|
this.btnOpenTabs = new DevComponents.DotNetBar.ButtonX();
|
||||||
|
this.btnNoTabs = new DevComponents.DotNetBar.ButtonX();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelX1
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||||
|
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.labelX1.Location = new System.Drawing.Point(23, 2);
|
||||||
|
this.labelX1.Name = "labelX1";
|
||||||
|
this.labelX1.Size = new System.Drawing.Size(363, 78);
|
||||||
|
this.labelX1.TabIndex = 0;
|
||||||
|
this.labelX1.Text = "Would you like for PROMS to reopen the tabs that you had open during your last se" +
|
||||||
|
"ssion?";
|
||||||
|
this.labelX1.WordWrap = true;
|
||||||
|
//
|
||||||
|
// cbRemember
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
this.cbRemember.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||||
|
this.cbRemember.Location = new System.Drawing.Point(23, 75);
|
||||||
|
this.cbRemember.Name = "cbRemember";
|
||||||
|
this.cbRemember.Size = new System.Drawing.Size(376, 47);
|
||||||
|
this.cbRemember.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
|
this.cbRemember.TabIndex = 1;
|
||||||
|
this.cbRemember.Text = "Check this box to not be prompted in the future when opening PROMS. \nNote that th" +
|
||||||
|
"ese settings can be adjusted at any time from the \nOPTIONS menu for PROMS.";
|
||||||
|
//
|
||||||
|
// btnOpenTabs
|
||||||
|
//
|
||||||
|
this.btnOpenTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||||
|
this.btnOpenTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||||
|
this.btnOpenTabs.DialogResult = System.Windows.Forms.DialogResult.Yes;
|
||||||
|
this.btnOpenTabs.Location = new System.Drawing.Point(23, 139);
|
||||||
|
this.btnOpenTabs.Name = "btnOpenTabs";
|
||||||
|
this.btnOpenTabs.Size = new System.Drawing.Size(150, 42);
|
||||||
|
this.btnOpenTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
|
this.btnOpenTabs.TabIndex = 2;
|
||||||
|
this.btnOpenTabs.Text = "Yes, Open Tabs from Last Session";
|
||||||
|
this.btnOpenTabs.Click += new System.EventHandler(this.btnTabs_Click);
|
||||||
|
//
|
||||||
|
// btnNoTabs
|
||||||
|
//
|
||||||
|
this.btnNoTabs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||||
|
this.btnNoTabs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
||||||
|
this.btnNoTabs.DialogResult = System.Windows.Forms.DialogResult.No;
|
||||||
|
this.btnNoTabs.Location = new System.Drawing.Point(216, 139);
|
||||||
|
this.btnNoTabs.Name = "btnNoTabs";
|
||||||
|
this.btnNoTabs.Size = new System.Drawing.Size(150, 42);
|
||||||
|
this.btnNoTabs.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
|
this.btnNoTabs.TabIndex = 3;
|
||||||
|
this.btnNoTabs.Text = "No, Do Not Open Tabs from Previous Session";
|
||||||
|
this.btnNoTabs.Click += new System.EventHandler(this.btnTabs_Click);
|
||||||
|
//
|
||||||
|
// dlgCheckOpenTabs
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(411, 193);
|
||||||
|
this.ControlBox = false;
|
||||||
|
this.Controls.Add(this.btnNoTabs);
|
||||||
|
this.Controls.Add(this.btnOpenTabs);
|
||||||
|
this.Controls.Add(this.cbRemember);
|
||||||
|
this.Controls.Add(this.labelX1);
|
||||||
|
this.Name = "dlgCheckOpenTabs";
|
||||||
|
this.Text = "Open Tabs from Previous Session";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private DevComponents.DotNetBar.LabelX labelX1;
|
||||||
|
private DevComponents.DotNetBar.Controls.CheckBoxX cbRemember;
|
||||||
|
private DevComponents.DotNetBar.ButtonX btnOpenTabs;
|
||||||
|
private DevComponents.DotNetBar.ButtonX btnNoTabs;
|
||||||
|
}
|
||||||
|
}
|
28
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.cs
Normal file
28
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
public partial class dlgCheckOpenTabs : Form
|
||||||
|
{
|
||||||
|
public dlgCheckOpenTabs()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remember { get; set; } = false;
|
||||||
|
|
||||||
|
private void btnTabs_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Remember = this.cbRemember.Checked;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.resx
Normal file
120
PROMS/VEPROMS User Interface/dlgCheckOpenTabs.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
2293
PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs
generated
2293
PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@ using DevComponents.DotNetBar;
|
|||||||
using VEPROMS.Properties;
|
using VEPROMS.Properties;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using DescriptiveEnum;
|
using DescriptiveEnum;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
@ -24,6 +25,9 @@ namespace VEPROMS
|
|||||||
get { return _CanChangeSeparateWindowsSetting; }
|
get { return _CanChangeSeparateWindowsSetting; }
|
||||||
set { _CanChangeSeparateWindowsSetting = value; }
|
set { _CanChangeSeparateWindowsSetting = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private UserSettings _usersettings;
|
||||||
|
|
||||||
public frmSysOptions()
|
public frmSysOptions()
|
||||||
{
|
{
|
||||||
_initializing = true;
|
_initializing = true;
|
||||||
@ -89,6 +93,13 @@ namespace VEPROMS
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CSM - C2024-031 - Getting User Settings
|
||||||
|
//and set checkboxes based on what they are set to
|
||||||
|
_usersettings = new UserSettings(VlnSettings.UserID);
|
||||||
|
cbOTRemember.Checked = _usersettings.UserSetting_OpenTabs_Remember;
|
||||||
|
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked;
|
||||||
|
cbOTAutoOpen.Checked = _usersettings.UserSetting_OpenTabs_AutoOpen || !cbOTRemember.Checked;
|
||||||
|
|
||||||
}
|
}
|
||||||
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
|
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
@ -151,6 +162,15 @@ namespace VEPROMS
|
|||||||
Settings.Default.PropPageStyle = 3;
|
Settings.Default.PropPageStyle = 3;
|
||||||
|
|
||||||
Settings.Default.Save();
|
Settings.Default.Save();
|
||||||
|
//CSM - C2024-031 - Save User Settings
|
||||||
|
//based on what checkboxes are set to
|
||||||
|
bool? OTAuto = null;
|
||||||
|
if (cbOTRemember.Checked)
|
||||||
|
{
|
||||||
|
OTAuto = cbOTAutoOpen.Checked;
|
||||||
|
}
|
||||||
|
_usersettings.SetUserSettings(cbOTRemember.Checked, OTAuto);
|
||||||
|
|
||||||
this.DialogResult = DialogResult.OK;
|
this.DialogResult = DialogResult.OK;
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
@ -324,5 +344,10 @@ namespace VEPROMS
|
|||||||
Settings.Default.UCFImportOpt = 4;
|
Settings.Default.UCFImportOpt = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void cbOTRemember_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbOTRemember.Checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -112,21 +112,20 @@
|
|||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="colorPickerButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="colorPickerButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScQAA
|
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABJxAAAScQHz3HqOAAAAKklE
|
||||||
EnEB89x6jgAAACpJREFUOE9j+P//P0UYQgApcjCKASCaFDxqwKgBIDwcDSAHww0gH/9nAACxLJWH1IMf
|
QVQ4T2P4//8/RRhCAClyMIoBIJoUPGrAqAEgPBwNIAfDDSAf/2cAALEslYfUgx+eAAAAAElFTkSuQmCC
|
||||||
ngAAAABJRU5ErkJggg==
|
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
@ -2355,17 +2355,37 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
// Retrieve edit tab state from database.
|
// Retrieve edit tab state from database.
|
||||||
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
|
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
|
||||||
|
|
||||||
if (DisPlayTabState.Rows.Count > 0)
|
//CSM - C2024-031 - Getting User Settings
|
||||||
|
//and set checkboxes based on what they are set to
|
||||||
|
UserSettings usersettings = new UserSettings(VlnSettings.UserID);
|
||||||
|
|
||||||
|
if (DisPlayTabState.Rows.Count > 0 && (usersettings.UserSetting_OpenTabs_AutoOpen || !usersettings.UserSetting_OpenTabs_Remember))
|
||||||
{
|
{
|
||||||
foreach (DataRow TabState in DisPlayTabState.Rows)
|
//will open tabs by default / ask by default
|
||||||
|
DialogResult result = DialogResult.Yes;
|
||||||
|
if (!usersettings.UserSetting_OpenTabs_Remember)
|
||||||
{
|
{
|
||||||
int _ItemID = (int)TabState["ItemID"];
|
dlgCheckOpenTabs checkOpenTabs = new dlgCheckOpenTabs();
|
||||||
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
|
result = checkOpenTabs.ShowDialog();
|
||||||
// Open procedure in the editor.
|
|
||||||
OpenItem(_Procedure);
|
//if checkbox was checked in form, then update User Settings in database
|
||||||
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
|
if (checkOpenTabs.Remember)
|
||||||
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
|
usersettings.SetUserSettings(true, result == DialogResult.Yes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (result == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (DataRow TabState in DisPlayTabState.Rows)
|
||||||
|
{
|
||||||
|
int _ItemID = (int)TabState["ItemID"];
|
||||||
|
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
|
||||||
|
// Open procedure in the editor.
|
||||||
|
OpenItem(_Procedure);
|
||||||
|
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
|
||||||
|
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
91
PROMS/VEPROMS.CSLA.Library/Minimal/UserSettings.cs
Normal file
91
PROMS/VEPROMS.CSLA.Library/Minimal/UserSettings.cs
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
using System;
|
||||||
|
using Csla.Data;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
|
||||||
|
//CSM - C2024-031 - Minimal Class for Saving / Getting User Settings
|
||||||
|
//For Use with getting / saving if a User wishes to have tabs kept open
|
||||||
|
namespace VEPROMS.CSLA.Library
|
||||||
|
{
|
||||||
|
public class UserSettings
|
||||||
|
{
|
||||||
|
#region Private Properties
|
||||||
|
private readonly string _userid;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
public bool UserSetting_OpenTabs_Remember { get; protected set; } = false;
|
||||||
|
public bool UserSetting_OpenTabs_AutoOpen { get; protected set; } = true;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
public UserSettings(string UserID)
|
||||||
|
{
|
||||||
|
_userid = UserID;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.Text;
|
||||||
|
cm.CommandText = "Select RememberOpenTabs, AutoOpenTabs FROM Users where UserID = @UID";
|
||||||
|
cm.Parameters.AddWithValue("@UID", _userid);
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
|
{
|
||||||
|
if (dr.Read())
|
||||||
|
{
|
||||||
|
UserSetting_OpenTabs_Remember = (bool) dr.GetValue("RememberOpenTabs");
|
||||||
|
UserSetting_OpenTabs_AutoOpen = (bool) dr.GetValue("AutoOpenTabs");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Database.LogException("UserSettings_GetData", ex);
|
||||||
|
throw new DbCslaException("UserSettings_GetData", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Save Properties
|
||||||
|
public void SetUserSettings(bool OpenTabs_Remember, bool? OpenTabs_AutoOpen = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "vesp_UpdateUserSettings";
|
||||||
|
cm.Parameters.AddWithValue("@UID", _userid);
|
||||||
|
UserSetting_OpenTabs_Remember = OpenTabs_Remember;
|
||||||
|
cm.Parameters.AddWithValue("@Remember", OpenTabs_Remember);
|
||||||
|
if (OpenTabs_AutoOpen != null)
|
||||||
|
{
|
||||||
|
UserSetting_OpenTabs_AutoOpen = (bool) OpenTabs_AutoOpen;
|
||||||
|
cm.Parameters.AddWithValue("@AutoOpen", OpenTabs_AutoOpen);
|
||||||
|
}
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
|
||||||
|
cm.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Database.LogException("UserSettings_SetUserSettings", ex);
|
||||||
|
throw new DbCslaException("UserSettings_SetUserSettings", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -380,6 +380,7 @@
|
|||||||
<Compile Include="Generated\ZContentInfo.cs" />
|
<Compile Include="Generated\ZContentInfo.cs" />
|
||||||
<Compile Include="Generated\ZTransition.cs" />
|
<Compile Include="Generated\ZTransition.cs" />
|
||||||
<Compile Include="Generated\ZTransitionInfo.cs" />
|
<Compile Include="Generated\ZTransitionInfo.cs" />
|
||||||
|
<Compile Include="Minimal\UserSettings.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="VEObjects\VEDrillDown.cs" />
|
<Compile Include="VEObjects\VEDrillDown.cs" />
|
||||||
<Compile Include="VEObjects\VETreeNode.cs" />
|
<Compile Include="VEObjects\VETreeNode.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user