More Users.CurrentUser related changes (IPERL)
This commit is contained in:
@@ -139,7 +139,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
|||||||
/// Only a release version registers a workplace
|
/// Only a release version registers a workplace
|
||||||
TracingDB.DB.RegisterWorkplace(session,
|
TracingDB.DB.RegisterWorkplace(session,
|
||||||
workplace,
|
workplace,
|
||||||
Users.GlobalData.GetCurrentUserName(),
|
Users.CurrentUser.UserName(),
|
||||||
(ipAddress != null) ? ipAddress.ToString() : "1.2.3.4",
|
(ipAddress != null) ? ipAddress.ToString() : "1.2.3.4",
|
||||||
"<multiple>",
|
"<multiple>",
|
||||||
WorkstepName,
|
WorkstepName,
|
||||||
|
|||||||
@@ -2408,6 +2408,12 @@
|
|||||||
<DependentUpon>PicturesTabPageCtrl.cs</DependentUpon>
|
<DependentUpon>PicturesTabPageCtrl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UI\Constants.cs" />
|
<Compile Include="UI\Constants.cs" />
|
||||||
|
<Compile Include="UI\DummyDlg.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UI\DummyDlg.Designer.cs">
|
||||||
|
<DependentUpon>DummyDlg.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="UI\Item\EditDouble.cs" />
|
<Compile Include="UI\Item\EditDouble.cs" />
|
||||||
<Compile Include="UI\Item\EditEnum.cs" />
|
<Compile Include="UI\Item\EditEnum.cs" />
|
||||||
<Compile Include="UI\Item\EditFloat.cs" />
|
<Compile Include="UI\Item\EditFloat.cs" />
|
||||||
|
|||||||
Generated
+38
@@ -0,0 +1,38 @@
|
|||||||
|
namespace TBF.UI
|
||||||
|
{
|
||||||
|
partial class DummyDlg
|
||||||
|
{
|
||||||
|
/// <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.components = new System.ComponentModel.Container();
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Text = "DummyDlg";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 TBF.UI
|
||||||
|
{
|
||||||
|
public partial class DummyDlg : Form
|
||||||
|
{
|
||||||
|
public DummyDlg()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
/// Copyright (c) 2016-2022 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using Common;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
|
|
||||||
namespace TBF.UI.ResultsMI
|
namespace TBF.UI.ResultsMI
|
||||||
@@ -22,7 +23,7 @@ namespace TBF.UI.ResultsMI
|
|||||||
public int FailedCount;
|
public int FailedCount;
|
||||||
public bool Sent;
|
public bool Sent;
|
||||||
|
|
||||||
protected PreviousResultCtrl()
|
PreviousResultCtrl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
@@ -106,13 +107,15 @@ namespace TBF.UI.ResultsMI
|
|||||||
else if (mode == PreviousResultsMode.Fix)
|
else if (mode == PreviousResultsMode.Fix)
|
||||||
{
|
{
|
||||||
/// Access only to thise who manage production tracing
|
/// Access only to thise who manage production tracing
|
||||||
Common.GID[] rqrdGroupMembership = new Common.GID[] { Common.GID.TraceabilityManagement };
|
GID[] rqrdGroupMembership = new GID[] { GID.TraceabilityManagement };
|
||||||
|
|
||||||
if ((new Users.Forms.LoginDlg(Users.GlobalData.CurrentUser.UserName, rqrdGroupMembership)).ShowDialog() != DialogResult.OK)
|
if ((new Users.Forms.LoginDlg(Users.CurrentUser.UserName(), rqrdGroupMembership, parent)).ShowDialog() != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Program.MainWnd.UpdateUser();
|
||||||
|
|
||||||
parent.OnReloadAndFix(this, new PreviousResultIdEventArgs(BatchNr));
|
parent.OnReloadAndFix(this, new PreviousResultIdEventArgs(BatchNr));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+12
-11
@@ -35,13 +35,13 @@
|
|||||||
this.vertSplitContainer = new System.Windows.Forms.SplitContainer();
|
this.vertSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||||
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||||
this.filterGroupBox = new System.Windows.Forms.GroupBox();
|
this.filterGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.reloadButton = new System.Windows.Forms.Button();
|
||||||
this.procedureTextBox = new System.Windows.Forms.TextBox();
|
this.procedureTextBox = new System.Windows.Forms.TextBox();
|
||||||
this.procedureLabel = new System.Windows.Forms.Label();
|
this.procedureLabel = new System.Windows.Forms.Label();
|
||||||
this.toLabel = new System.Windows.Forms.Label();
|
this.toLabel = new System.Windows.Forms.Label();
|
||||||
this.fromLabel = new System.Windows.Forms.Label();
|
this.fromLabel = new System.Windows.Forms.Label();
|
||||||
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
|
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
|
||||||
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
|
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
|
||||||
this.reloadButton = new System.Windows.Forms.Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.vertSplitContainer)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.vertSplitContainer)).BeginInit();
|
||||||
this.vertSplitContainer.Panel1.SuspendLayout();
|
this.vertSplitContainer.Panel1.SuspendLayout();
|
||||||
this.vertSplitContainer.Panel2.SuspendLayout();
|
this.vertSplitContainer.Panel2.SuspendLayout();
|
||||||
@@ -154,6 +154,16 @@
|
|||||||
this.filterGroupBox.TabStop = false;
|
this.filterGroupBox.TabStop = false;
|
||||||
this.filterGroupBox.Text = "Filter";
|
this.filterGroupBox.Text = "Filter";
|
||||||
//
|
//
|
||||||
|
// reloadButton
|
||||||
|
//
|
||||||
|
this.reloadButton.Location = new System.Drawing.Point(1005, 23);
|
||||||
|
this.reloadButton.Name = "reloadButton";
|
||||||
|
this.reloadButton.Size = new System.Drawing.Size(37, 23);
|
||||||
|
this.reloadButton.TabIndex = 0;
|
||||||
|
this.reloadButton.Text = "@";
|
||||||
|
this.reloadButton.UseVisualStyleBackColor = true;
|
||||||
|
this.reloadButton.Click += new System.EventHandler(this.reloadButton_Click);
|
||||||
|
//
|
||||||
// procedureTextBox
|
// procedureTextBox
|
||||||
//
|
//
|
||||||
this.procedureTextBox.Location = new System.Drawing.Point(460, 25);
|
this.procedureTextBox.Location = new System.Drawing.Point(460, 25);
|
||||||
@@ -206,16 +216,6 @@
|
|||||||
this.fromDateTimePicker.Size = new System.Drawing.Size(82, 20);
|
this.fromDateTimePicker.Size = new System.Drawing.Size(82, 20);
|
||||||
this.fromDateTimePicker.TabIndex = 17;
|
this.fromDateTimePicker.TabIndex = 17;
|
||||||
//
|
//
|
||||||
// reloadButton
|
|
||||||
//
|
|
||||||
this.reloadButton.Location = new System.Drawing.Point(1005, 23);
|
|
||||||
this.reloadButton.Name = "reloadButton";
|
|
||||||
this.reloadButton.Size = new System.Drawing.Size(37, 23);
|
|
||||||
this.reloadButton.TabIndex = 0;
|
|
||||||
this.reloadButton.Text = "@";
|
|
||||||
this.reloadButton.UseVisualStyleBackColor = true;
|
|
||||||
this.reloadButton.Click += new System.EventHandler(this.reloadButton_Click);
|
|
||||||
//
|
|
||||||
// PreviousResultsDlg
|
// PreviousResultsDlg
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -228,6 +228,7 @@
|
|||||||
this.Name = "PreviousResultsDlg";
|
this.Name = "PreviousResultsDlg";
|
||||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||||
this.Text = "Previous results";
|
this.Text = "Previous results";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PreviousResultsDlg_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.PreviousResultsDlg_Load);
|
this.Load += new System.EventHandler(this.PreviousResultsDlg_Load);
|
||||||
this.vertSplitContainer.Panel1.ResumeLayout(false);
|
this.vertSplitContainer.Panel1.ResumeLayout(false);
|
||||||
this.vertSplitContainer.Panel2.ResumeLayout(false);
|
this.vertSplitContainer.Panel2.ResumeLayout(false);
|
||||||
|
|||||||
@@ -398,5 +398,10 @@ namespace TBF.UI.ResultsMI
|
|||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
Redraw();
|
Redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PreviousResultsDlg_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
if (Users.CurrentUser.Restore(this)) Program.MainWnd.UpdateUser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using Common;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.UiBridge;
|
using TBF.UiBridge;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
@@ -180,12 +181,11 @@ namespace TBF.UI.Shared
|
|||||||
|
|
||||||
string oriTestName = testComboBox.Text;
|
string oriTestName = testComboBox.Text;
|
||||||
|
|
||||||
IList<Procedure> procedures = TBF.DB.CreateSession(Program.MainWnd.SelectedProcedure.IsRemote ?
|
IList<Procedure> procedures = TBF.DB.CreateSession(Program.MainWnd.SelectedProcedure.IsRemote ? DBKind.RemoteConfig : DBKind.Config)
|
||||||
Common.DBKind.RemoteConfig : Common.DBKind.Config)
|
.QueryOver<Procedure>()
|
||||||
.QueryOver<Procedure>()
|
.Where(x => (x.ProcedureState == ProcedureState.Active))
|
||||||
.Where(x => (x.ProcedureState == Common.ProcedureState.Active))
|
.And(x => (x.Name == Program.MainWnd.SelectedProcedure.Name))
|
||||||
.And(x => (x.Name == Program.MainWnd.SelectedProcedure.Name))
|
.List();
|
||||||
.List();
|
|
||||||
if (procedures.Count != 1)
|
if (procedures.Count != 1)
|
||||||
{
|
{
|
||||||
testComboBox.Text = string.Empty;
|
testComboBox.Text = string.Empty;
|
||||||
@@ -277,13 +277,14 @@ namespace TBF.UI.Shared
|
|||||||
{
|
{
|
||||||
#if TURA_IPERL || TURA_IPERL_NEW
|
#if TURA_IPERL || TURA_IPERL_NEW
|
||||||
/// Prevent 'Stop draining' by password
|
/// Prevent 'Stop draining' by password
|
||||||
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Common.GID.TestingSpecialists))
|
if (drain1Highlighted && !Users.CurrentUser.IsMemberOf(GID.TestingSpecialists))
|
||||||
{
|
{
|
||||||
if ((new Users.Forms.LoginDlg(new Common.GID[] { Common.GID.TestingSpecialists })).ShowDialog() != DialogResult.OK)
|
var dlg = new DummyDlg();
|
||||||
|
if ((new Users.Forms.LoginDlg(new GID[] { GID.TestingSpecialists }, dlg)).ShowDialog() != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
|
|
||||||
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank1);
|
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank1);
|
||||||
|
Users.CurrentUser.Restore(dlg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -294,13 +295,14 @@ namespace TBF.UI.Shared
|
|||||||
{
|
{
|
||||||
#if TURA_IPERL || TURA_IPERL_NEW
|
#if TURA_IPERL || TURA_IPERL_NEW
|
||||||
/// Prevent 'Stop draining' by password
|
/// Prevent 'Stop draining' by password
|
||||||
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Common.GID.TestingSpecialists))
|
if (drain1Highlighted && !Users.CurrentUser.IsMemberOf(GID.TestingSpecialists))
|
||||||
{
|
{
|
||||||
if ((new Users.Forms.LoginDlg(new Common.GID[] { Common.GID.TestingSpecialists })).ShowDialog() != DialogResult.OK)
|
var dlg = new DummyDlg();
|
||||||
|
if ((new Users.Forms.LoginDlg(new GID[] { GID.TestingSpecialists }, dlg)).ShowDialog() != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
|
|
||||||
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank2);
|
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank2);
|
||||||
|
Users.CurrentUser.Restore(dlg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -311,13 +313,14 @@ namespace TBF.UI.Shared
|
|||||||
{
|
{
|
||||||
#if TURA_IPERL || TURA_IPERL_NEW
|
#if TURA_IPERL || TURA_IPERL_NEW
|
||||||
/// Prevent 'Stop draining' by password
|
/// Prevent 'Stop draining' by password
|
||||||
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Common.GID.TestingSpecialists))
|
if (drain1Highlighted && !Users.CurrentUser.IsMemberOf(GID.TestingSpecialists))
|
||||||
{
|
{
|
||||||
if ((new Users.Forms.LoginDlg(new Common.GID[] { Common.GID.TestingSpecialists })).ShowDialog() != DialogResult.OK)
|
var dlg = new DummyDlg();
|
||||||
|
if ((new Users.Forms.LoginDlg(new GID[] { GID.TestingSpecialists }, dlg)).ShowDialog() != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
|
|
||||||
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank3);
|
Bridge.Ui2Bench(UI2BenchCmd.StopDrainingTank3);
|
||||||
|
Users.CurrentUser.Restore(dlg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user