diff --git a/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs b/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs index 1786e97c..ac31fad0 100644 --- a/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs +++ b/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs @@ -63,18 +63,21 @@ namespace VEPROMS lstFrom.Items.Remove(item); } SetButtonsEditable(); + btnUpdate.Enabled = true; } // Move all items to lstSelected. private void btnSelectAll_Click(object sender, EventArgs e) { MoveAllItems(lstUnselected, lstSelected); + btnUpdate.Enabled = true; } // Move all items to lstUnselected. private void btnDeselectAll_Click(object sender, EventArgs e) { MoveAllItems(lstSelected, lstUnselected); + btnUpdate.Enabled = true; } // Move all items from one ListBox to another. @@ -83,6 +86,7 @@ namespace VEPROMS lstTo.Items.AddRange(lstFrom.Items); lstFrom.Items.Clear(); SetButtonsEditable(); + btnUpdate.Enabled = true; } // Enable and disable buttons. @@ -93,8 +97,10 @@ namespace VEPROMS // Save selected list to DB. private void btnUpdate_Click(object sender, EventArgs e) { - DataTable dt2 = coverToTable(); - VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID); + saveChanges(); + //DataTable dt2 = coverToTable(); + //VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID); + //btnUpdate.Enabled = false; } public class AnnotataionItem { @@ -154,7 +160,19 @@ namespace VEPROMS private void btnCancel_Click_1(object sender, EventArgs e) { - this.Close(); + string message = "Changes have not yet been saved. Do you want to save the changes prior to closing?"; + string title = "Save Annotation Selections"; + MessageBoxButtons buttons = MessageBoxButtons.YesNo; + DialogResult result = MessageBox.Show(message, title, buttons); + if (result == DialogResult.Yes) + { + saveChanges(); + this.Close(); + } + else + { + this.Close(); + } } private DataTable coverToTable() @@ -169,6 +187,12 @@ namespace VEPROMS } return dt; } + private void saveChanges() + { + DataTable dt2 = coverToTable(); + VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID); + btnUpdate.Enabled = false; + } } } diff --git a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj b/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj index 34aae1a6..d9859e1a 100644 --- a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj +++ b/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj @@ -229,6 +229,12 @@ DlgPrintProcedure.cs + + Form + + + dlgSaveAnnotationSelections.cs + Form @@ -368,6 +374,9 @@ DlgPrintProcedure.cs Designer + + dlgSaveAnnotationSelections.cs + dlgSetChangeBarStartDate.cs diff --git a/PROMS/VEPROMS User Interface/dlgAnnotationsSelect.Designer.cs b/PROMS/VEPROMS User Interface/dlgAnnotationsSelect.Designer.cs index 22a5f7c5..ec7a1f11 100644 --- a/PROMS/VEPROMS User Interface/dlgAnnotationsSelect.Designer.cs +++ b/PROMS/VEPROMS User Interface/dlgAnnotationsSelect.Designer.cs @@ -158,7 +158,7 @@ namespace VEPROMS this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(100, 35); this.btnCancel.TabIndex = 9; - this.btnCancel.Text = "Cancel"; + this.btnCancel.Text = "Close"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click_1); // @@ -203,7 +203,7 @@ namespace VEPROMS this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Name = "dlgAnnotationsSelect"; - this.Text = "Select Annotation Types"; + this.Text = "Filter Annotation Types"; this.Load += new System.EventHandler(this.DlgAnnotationsSelect_Load); this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); diff --git a/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.Designer.cs b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.Designer.cs new file mode 100644 index 00000000..a6438b26 --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.Designer.cs @@ -0,0 +1,47 @@ + +namespace VEPROMS +{ + partial class dlgSaveAnnotationSelections + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // dlgSaveAnnotationSelections + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(634, 351); + this.Name = "dlgSaveAnnotationSelections"; + this.Text = "Save Annotation Selections"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.cs b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.cs new file mode 100644 index 00000000..1714cf15 --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.cs @@ -0,0 +1,20 @@ +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 dlgSaveAnnotationSelections : Form + { + public dlgSaveAnnotationSelections() + { + InitializeComponent(); + } + } +} diff --git a/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.resx b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/PROMS/VEPROMS User Interface/dlgSaveAnnotationSelections.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file