(1) PreviousResultsDlg with filters, (2) Procedure history can be inspected.
This commit is contained in:
@@ -20,12 +20,19 @@ namespace TBF.UI.Procedures
|
||||
{
|
||||
public partial class ProcedureDlg : Form, IParentOfListViewEx
|
||||
{
|
||||
public enum Mode
|
||||
{
|
||||
Unlocked,
|
||||
Locked,
|
||||
PermanentlyLocked,
|
||||
}
|
||||
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ProcedureDlg));
|
||||
|
||||
/// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi
|
||||
public readonly int Dpi;
|
||||
|
||||
readonly bool openUnlocked;
|
||||
readonly Mode initialMode;
|
||||
|
||||
/// <summary>
|
||||
/// Procedure to be updated by this dialog.
|
||||
@@ -61,7 +68,7 @@ namespace TBF.UI.Procedures
|
||||
{
|
||||
/// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi.
|
||||
Dpi = (int)this.CreateGraphics().DpiX;
|
||||
openUnlocked = false;
|
||||
initialMode = Mode.Locked;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
@@ -111,14 +118,14 @@ namespace TBF.UI.Procedures
|
||||
SelectedTestIx = -1;
|
||||
}
|
||||
|
||||
public ProcedureDlg(Config.Entities.Procedure procedure, IList<string> usedNames, bool openUnlocked = false)
|
||||
public ProcedureDlg(Config.Entities.Procedure procedure, IList<string> usedNames, Mode initialMode)
|
||||
: this()
|
||||
{
|
||||
if (procedure == null) throw new ArgumentNullException("procedure");
|
||||
|
||||
LoadedProcedure = procedure;
|
||||
this.usedNames = usedNames;
|
||||
this.openUnlocked = openUnlocked;
|
||||
this.initialMode = initialMode;
|
||||
|
||||
#if KEMPNO_50 || KRAKOW_50
|
||||
sharedButtons.RequiredGroupMembership = procedure.Protected ? new Users.Entities.GID[] { Users.Entities.GID.WaterMeterAuthority }
|
||||
@@ -127,6 +134,8 @@ namespace TBF.UI.Procedures
|
||||
sharedButtons.RequiredGroupMembership = procedure.Protected ? new Users.Entities.GID[] { Users.Entities.GID.Metrologists }
|
||||
: new Users.Entities.GID[] { Users.Entities.GID.TestingSpecialists, Users.Entities.GID.Metrologists };
|
||||
#endif
|
||||
if (initialMode == Mode.PermanentlyLocked) sharedButtons.DisableUnlock();
|
||||
|
||||
using (NHibernate.ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config))
|
||||
{
|
||||
///
|
||||
@@ -408,7 +417,7 @@ namespace TBF.UI.Procedures
|
||||
}
|
||||
|
||||
/// Optionally unlock this dialog
|
||||
if (openUnlocked)
|
||||
if (initialMode == Mode.Unlocked)
|
||||
{
|
||||
sharedButtons.UnlockButtons();
|
||||
Unlocked(sender, e);
|
||||
@@ -698,6 +707,7 @@ namespace TBF.UI.Procedures
|
||||
{
|
||||
found = true;
|
||||
ListViewItem item = new ListViewItem(p.Name);
|
||||
item.Tag = p;
|
||||
item.SubItems.Add(p.Revision.ToString());
|
||||
item.SubItems.Add(p.LastChgTime.ToString());
|
||||
item.SubItems.Add(p.LastChgUser.ToString());
|
||||
@@ -2828,5 +2838,16 @@ namespace TBF.UI.Procedures
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void historyListViewEx_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (historyListViewEx.SelectedIndices.Count != 1) return;
|
||||
ListViewItem lvi = historyListViewEx.SelectedItems[0];
|
||||
|
||||
if (lvi.Tag is Procedure)
|
||||
{
|
||||
(new ProcedureDlg(lvi.Tag as Procedure, new List<string>(), ProcedureDlg.Mode.PermanentlyLocked)).ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user