Legalizator (= 2nd user) support, ver. 2.16.667
This commit is contained in:
parent
fb1db6df1c
commit
18dac8fb72
@ -167,9 +167,12 @@ namespace Results
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
|
||||
TableRowNr, /// 151
|
||||
TableColumnNr, /// 152
|
||||
WMRemark,
|
||||
Table_row_nr, /// 151
|
||||
Table_column_nr, /// 152
|
||||
WMRemark, /// 153
|
||||
|
||||
User_description, /// 154
|
||||
Legalizator,
|
||||
|
||||
Count,
|
||||
}
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.16.645.0")]
|
||||
[assembly: AssemblyFileVersion("2.16.645.0")]
|
||||
[assembly: AssemblyVersion("2.16.667.0")]
|
||||
[assembly: AssemblyFileVersion("2.16.667.0")]
|
||||
|
||||
18
Results/Resources/Strings.Designer.cs
generated
18
Results/Resources/Strings.Designer.cs
generated
@ -411,6 +411,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Legalizator.
|
||||
/// </summary>
|
||||
internal static string Legalizator {
|
||||
get {
|
||||
return ResourceManager.GetString("Legalizator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to main.
|
||||
/// </summary>
|
||||
@ -1410,6 +1419,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User description.
|
||||
/// </summary>
|
||||
internal static string User_description {
|
||||
get {
|
||||
return ResourceManager.GetString("User_description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User nr..
|
||||
/// </summary>
|
||||
|
||||
@ -630,4 +630,10 @@
|
||||
<data name="Error_flags" xml:space="preserve">
|
||||
<value>Error flags</value>
|
||||
</data>
|
||||
<data name="Legalizator" xml:space="preserve">
|
||||
<value>Legalizator</value>
|
||||
</data>
|
||||
<data name="User_description" xml:space="preserve">
|
||||
<value>User description</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -316,9 +316,11 @@ namespace Results
|
||||
/// Batch info
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.TestBenchId.ToString()));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.ProgramVersion));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.UserName));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.Batch.UserNumber.ToString()));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.WatermetersStr));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.Batch.UserNumber.ToString()));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => Users.Entities.User.EncodedStrToUserName(w.Batch.UserName)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => Users.Entities.User.EncodedStrToFullName(w.Batch.UserName)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Legalizator, Strings.Legalizator, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => Users.Entities.User.EncodedStrToLegalizator(w.Batch.UserName)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.WatermetersStr));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Protocol_title, Strings.Protocol, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.ProtocolTitle));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
|
||||
@ -364,8 +366,8 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x4000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x8000) != 0) ? Strings.Yes : Strings.No));
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TableRowNr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TableColumnNr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.WMRemark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.Remark));
|
||||
}
|
||||
|
||||
|
||||
@ -1349,7 +1349,7 @@ namespace TBF.BenchControl.Sequences
|
||||
/// Prepare empty results
|
||||
return Results.BatchResults.NewFromProcedure(newBatchNr,
|
||||
(BenchInfo != null) ? BenchInfo.TestBenchId : 1,
|
||||
Users.GlobalData.CurrentUser.UserName,
|
||||
Users.GlobalData.CurrentUser.ToEncodedStr(),
|
||||
Users.GlobalData.CurrentUser.Number,
|
||||
Program.Version,
|
||||
StateMachine.Procedure,
|
||||
|
||||
@ -15,16 +15,18 @@ namespace TBF.Forms
|
||||
/// </summary>
|
||||
public partial class LoginDlgWithBenchSelection : Form
|
||||
{
|
||||
// Private fields
|
||||
/// Private fields
|
||||
string alias;
|
||||
string password;
|
||||
string benchName = null;
|
||||
string legalizator;
|
||||
|
||||
// Readonly public properties to do the authorization.
|
||||
/// Readonly public properties to do the authorization.
|
||||
public string Alias { get { return alias; } }
|
||||
public string Password { get { return password; } }
|
||||
public string BenchName { get { return benchName; } }
|
||||
public Users.Entities.LoginMethod Method;
|
||||
public string Legalizator { get { return legalizator; } }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
@ -41,10 +43,37 @@ namespace TBF.Forms
|
||||
: this()
|
||||
{
|
||||
benchName = predefinedBench;
|
||||
|
||||
#if LANG_PL
|
||||
Height = 156;
|
||||
EnableAndPrepareLegalizatorCombo(legalizatorComboBox);
|
||||
#else
|
||||
legalizator = string.Empty;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e)
|
||||
{
|
||||
/// <summary>
|
||||
/// Load Legalizator order combo box items from the LocalSettings LastLegalizators array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Legalizator ComboBox</param>
|
||||
void EnableAndPrepareLegalizatorCombo(ComboBox comboBox)
|
||||
{
|
||||
legalizatorLabel.Visible = true;
|
||||
legalizatorComboBox.Visible = true;
|
||||
legalizatorComboBox.Enabled = true;
|
||||
|
||||
for (int i = 0; i < Program.LocalSettings.LastLegalizatorsCount; i++)
|
||||
{
|
||||
comboBox.Items.Add(Program.LocalSettings.LastLegalizators[i]);
|
||||
}
|
||||
|
||||
legalizator = (comboBox.Items.Count > 0) ? Program.LocalSettings.LastLegalizators[0] : string.Empty;
|
||||
comboBox.Text = legalizator;
|
||||
}
|
||||
|
||||
|
||||
private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
#if DEBUG
|
||||
userNameTextBox.Text = "milan";
|
||||
@ -68,6 +97,7 @@ namespace TBF.Forms
|
||||
testBenchLabel.Text = Strings.Test_bench;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
legalizatorLabel.Text = Strings.Legalizator;
|
||||
}
|
||||
|
||||
string GetAliasLabel()
|
||||
@ -84,6 +114,7 @@ namespace TBF.Forms
|
||||
/// <summary>
|
||||
/// OK clicked (authorization is done outside this dialog).
|
||||
/// </summary>
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (testBenchComboBox.SelectedItem != null)
|
||||
@ -91,6 +122,11 @@ namespace TBF.Forms
|
||||
alias = userNameTextBox.Text;
|
||||
password = passwordTextBox.Text;
|
||||
benchName = testBenchComboBox.SelectedItem.ToString();
|
||||
if (legalizatorComboBox.Enabled)
|
||||
{
|
||||
legalizator = legalizatorComboBox.Text;
|
||||
Program.LocalSettings.UpdateHistory(legalizator, ref Program.LocalSettings.LastLegalizators);
|
||||
}
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
||||
@ -31,92 +31,104 @@ namespace TBF.Forms
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection));
|
||||
this.aliasLabel = new System.Windows.Forms.Label();
|
||||
this.passwordLabel = new System.Windows.Forms.Label();
|
||||
this.testBenchLabel = new System.Windows.Forms.Label();
|
||||
this.testBenchComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.passwordTextBox = new System.Windows.Forms.TextBox();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.userNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// aliasLabel
|
||||
//
|
||||
resources.ApplyResources(this.aliasLabel, "aliasLabel");
|
||||
this.aliasLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.aliasLabel.Name = "aliasLabel";
|
||||
this.aliasLabel.Click += new System.EventHandler(this.aliasLabel_Click);
|
||||
//
|
||||
// passwordLabel
|
||||
//
|
||||
resources.ApplyResources(this.passwordLabel, "passwordLabel");
|
||||
this.passwordLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.passwordLabel.Name = "passwordLabel";
|
||||
//
|
||||
// testBenchLabel
|
||||
//
|
||||
resources.ApplyResources(this.testBenchLabel, "testBenchLabel");
|
||||
this.testBenchLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.testBenchLabel.Name = "testBenchLabel";
|
||||
//
|
||||
// testBenchComboBox
|
||||
//
|
||||
resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox");
|
||||
this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.testBenchComboBox.FormattingEnabled = true;
|
||||
this.testBenchComboBox.Name = "testBenchComboBox";
|
||||
//
|
||||
// passwordTextBox
|
||||
//
|
||||
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
|
||||
this.passwordTextBox.Name = "passwordTextBox";
|
||||
this.passwordTextBox.UseSystemPasswordChar = true;
|
||||
this.passwordTextBox.TextChanged += new System.EventHandler(this.passwordTextBox_TextChanged);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
resources.ApplyResources(this.cancelButton, "cancelButton");
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.okButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// userNameTextBox
|
||||
//
|
||||
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
|
||||
this.userNameTextBox.Name = "userNameTextBox";
|
||||
this.userNameTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.userNameTextBox_KeyPress);
|
||||
//
|
||||
// LoginDlgWithBenchSelection
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.userNameTextBox);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.passwordTextBox);
|
||||
this.Controls.Add(this.testBenchComboBox);
|
||||
this.Controls.Add(this.testBenchLabel);
|
||||
this.Controls.Add(this.passwordLabel);
|
||||
this.Controls.Add(this.aliasLabel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Name = "LoginDlgWithBenchSelection";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection));
|
||||
this.aliasLabel = new System.Windows.Forms.Label();
|
||||
this.passwordLabel = new System.Windows.Forms.Label();
|
||||
this.testBenchLabel = new System.Windows.Forms.Label();
|
||||
this.testBenchComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.passwordTextBox = new System.Windows.Forms.TextBox();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.userNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.legalizatorComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.legalizatorLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// aliasLabel
|
||||
//
|
||||
resources.ApplyResources(this.aliasLabel, "aliasLabel");
|
||||
this.aliasLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.aliasLabel.Name = "aliasLabel";
|
||||
//
|
||||
// passwordLabel
|
||||
//
|
||||
resources.ApplyResources(this.passwordLabel, "passwordLabel");
|
||||
this.passwordLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.passwordLabel.Name = "passwordLabel";
|
||||
//
|
||||
// testBenchLabel
|
||||
//
|
||||
resources.ApplyResources(this.testBenchLabel, "testBenchLabel");
|
||||
this.testBenchLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.testBenchLabel.Name = "testBenchLabel";
|
||||
//
|
||||
// testBenchComboBox
|
||||
//
|
||||
resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox");
|
||||
this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.testBenchComboBox.FormattingEnabled = true;
|
||||
this.testBenchComboBox.Name = "testBenchComboBox";
|
||||
//
|
||||
// passwordTextBox
|
||||
//
|
||||
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
|
||||
this.passwordTextBox.Name = "passwordTextBox";
|
||||
this.passwordTextBox.UseSystemPasswordChar = true;
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
resources.ApplyResources(this.cancelButton, "cancelButton");
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.okButton.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// userNameTextBox
|
||||
//
|
||||
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
|
||||
this.userNameTextBox.Name = "userNameTextBox";
|
||||
//
|
||||
// legalizatorComboBox
|
||||
//
|
||||
resources.ApplyResources(this.legalizatorComboBox, "legalizatorComboBox");
|
||||
this.legalizatorComboBox.FormattingEnabled = true;
|
||||
this.legalizatorComboBox.Name = "legalizatorComboBox";
|
||||
//
|
||||
// legalizatorLabel
|
||||
//
|
||||
resources.ApplyResources(this.legalizatorLabel, "legalizatorLabel");
|
||||
this.legalizatorLabel.ImageKey = global::TBF.Resources.Strings.Closing_the_tank;
|
||||
this.legalizatorLabel.Name = "legalizatorLabel";
|
||||
//
|
||||
// LoginDlgWithBenchSelection
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.legalizatorComboBox);
|
||||
this.Controls.Add(this.legalizatorLabel);
|
||||
this.Controls.Add(this.userNameTextBox);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.passwordTextBox);
|
||||
this.Controls.Add(this.testBenchComboBox);
|
||||
this.Controls.Add(this.testBenchLabel);
|
||||
this.Controls.Add(this.passwordLabel);
|
||||
this.Controls.Add(this.aliasLabel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Name = "LoginDlgWithBenchSelection";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
@ -130,5 +142,7 @@ namespace TBF.Forms
|
||||
private System.Windows.Forms.ComboBox testBenchComboBox;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.ComboBox legalizatorComboBox;
|
||||
private System.Windows.Forms.Label legalizatorLabel;
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>aliasLabel.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="passwordLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@ -171,7 +171,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>passwordLabel.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="testBenchLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@ -198,14 +198,14 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>testBenchLabel.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="testBenchComboBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="testBenchComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>150, 67</value>
|
||||
<value>148, 67</value>
|
||||
</data>
|
||||
<data name="testBenchComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 21</value>
|
||||
@ -223,13 +223,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>testBenchComboBox.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="passwordTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>150, 41</value>
|
||||
<value>148, 41</value>
|
||||
</data>
|
||||
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 20</value>
|
||||
@ -247,13 +247,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>passwordTextBox.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="cancelButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>336, 48</value>
|
||||
<value>334, 48</value>
|
||||
</data>
|
||||
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>105, 28</value>
|
||||
@ -274,13 +274,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cancelButton.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="okButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>336, 14</value>
|
||||
<value>334, 14</value>
|
||||
</data>
|
||||
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>105, 28</value>
|
||||
@ -301,13 +301,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>okButton.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="userNameTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>150, 15</value>
|
||||
<value>148, 15</value>
|
||||
</data>
|
||||
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 20</value>
|
||||
@ -325,8 +325,68 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>userNameTextBox.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="legalizatorComboBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="legalizatorComboBox.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>148, 95</value>
|
||||
</data>
|
||||
<data name="legalizatorComboBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 21</value>
|
||||
</data>
|
||||
<data name="legalizatorComboBox.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="legalizatorComboBox.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name=">>legalizatorComboBox.Name" xml:space="preserve">
|
||||
<value>legalizatorComboBox</value>
|
||||
</data>
|
||||
<data name=">>legalizatorComboBox.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>legalizatorComboBox.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>legalizatorComboBox.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>11, 98</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>58, 13</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.Text" xml:space="preserve">
|
||||
<value>Legalizator</value>
|
||||
</data>
|
||||
<data name="legalizatorLabel.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name=">>legalizatorLabel.Name" xml:space="preserve">
|
||||
<value>legalizatorLabel</value>
|
||||
</data>
|
||||
<data name=">>legalizatorLabel.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>legalizatorLabel.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>legalizatorLabel.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@ -334,7 +394,7 @@
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>456, 102</value>
|
||||
<value>454, 102</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
|
||||
@ -198,6 +198,11 @@ namespace TBF
|
||||
public bool PrintOrderOnlyGoodResult;
|
||||
public bool PrintOrderOnlyLastResult;
|
||||
|
||||
/// Legalizator history
|
||||
public string[] LastLegalizators;
|
||||
[XmlIgnore]
|
||||
public int LastLegalizatorsCount { get { return (LastLegalizators != null) ? LastLegalizators.Length : 0; } }
|
||||
|
||||
/// Configuration of results
|
||||
public Config.Entities.MetersArrangement ResultsConfigMeters;
|
||||
public Config.Entities.TestsArrangement ResultsConfigTests;
|
||||
|
||||
@ -215,7 +215,7 @@ namespace TBF
|
||||
GlobalData.RemoteUsersDB = LocalSettings.TestBenches[i].UsersDBSettings;
|
||||
GlobalData.LocalUsersDB = LocalSettings.TestBenches[i].ProceduresDBSettings;
|
||||
|
||||
Users.IUser loadedUser = null;
|
||||
Users.Entities.User loadedUser = null;
|
||||
try
|
||||
{
|
||||
bool authorized = false;
|
||||
@ -275,7 +275,8 @@ namespace TBF
|
||||
|
||||
if (authorized)
|
||||
{
|
||||
Users.GlobalData.AuthorizedAs = authorizedAs;
|
||||
loadedUser.SetLegalizator(loginDlgBench.Legalizator);
|
||||
Users.GlobalData.AuthorizedAs = authorizedAs;
|
||||
|
||||
LocalSettings.LoginMethod = loginDlgBench.Method; /// Save the login method actually used
|
||||
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.16.661.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.661.1")]
|
||||
[assembly: AssemblyVersion("2.16.667.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.667.1")]
|
||||
|
||||
9
TestBenchFramework/Resources/Strings.Designer.cs
generated
9
TestBenchFramework/Resources/Strings.Designer.cs
generated
@ -1968,6 +1968,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Legalizator.
|
||||
/// </summary>
|
||||
internal static string Legalizator {
|
||||
get {
|
||||
return ResourceManager.GetString("Legalizator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Less.
|
||||
/// </summary>
|
||||
|
||||
@ -1626,4 +1626,7 @@
|
||||
<data name="Short_dercription" xml:space="preserve">
|
||||
<value>Krótki opis</value>
|
||||
</data>
|
||||
<data name="Legalizator" xml:space="preserve">
|
||||
<value>Legalizator</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -1792,4 +1792,7 @@
|
||||
<data name="At_temperature" xml:space="preserve">
|
||||
<value>At temperature</value>
|
||||
</data>
|
||||
<data name="Legalizator" xml:space="preserve">
|
||||
<value>Legalizator</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -65,7 +65,7 @@ namespace TBF.UiControls
|
||||
|
||||
public Users.Grp.GID RequiredGroupMembership;
|
||||
|
||||
Users.IUser originalUser;
|
||||
Users.Entities.User originalUser;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
|
||||
@ -9,19 +9,23 @@ using log4net;
|
||||
|
||||
namespace Users.Entities
|
||||
{
|
||||
public class User : IUser
|
||||
public class User
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(User));
|
||||
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string UserName { get; set; } /// = name, alias, abbreviation
|
||||
public virtual string FullName { get; set; } /// = description
|
||||
public virtual string UserName { get; set; } /// = name, alias, abbreviation
|
||||
public virtual string FullName { get; set; } /// = description
|
||||
public virtual int Number { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual DateTime LastPwChange { get; set; }
|
||||
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
|
||||
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
|
||||
|
||||
private bool powerUser; /// true for built-in users, power users have full access even with empty Groups list
|
||||
private bool powerUser; /// true for built-in users, power users have full access even with empty Groups list
|
||||
|
||||
private string legalizator; /// Not mapped to a database !!!, 2nd user entered in a logging dialog
|
||||
public virtual void SetLegalizator(string value) { legalizator = value; }
|
||||
public virtual string GetLegalizator() { return legalizator; }
|
||||
|
||||
public User()
|
||||
{
|
||||
@ -36,7 +40,7 @@ namespace Users.Entities
|
||||
Number = number;
|
||||
this.powerUser = powerUser;
|
||||
Groups = new List<Group>();
|
||||
FullName = powerUser ? "Power user" : string.Empty;
|
||||
FullName = powerUser ? "Power User" : string.Empty;
|
||||
}
|
||||
|
||||
public virtual void AddGroup(Group group)
|
||||
@ -55,9 +59,10 @@ namespace Users.Entities
|
||||
{
|
||||
User newUser = new User(UserName, Number, false);
|
||||
newUser.FullName = FullName;
|
||||
newUser.Number = Number;
|
||||
newUser.Password = Password;
|
||||
newUser.LastPwChange = LastPwChange;
|
||||
return newUser;
|
||||
return newUser;
|
||||
}
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
@ -401,6 +406,31 @@ namespace Users.Entities
|
||||
return hashString;
|
||||
}
|
||||
|
||||
|
||||
public virtual string ToEncodedStr()
|
||||
{
|
||||
return string.Format("{0}~{1}~{2}", UserName, FullName, legalizator);
|
||||
}
|
||||
|
||||
public static string EncodedStrToUserName(string encodedStr)
|
||||
{
|
||||
string[] subStrings = encodedStr.Split(new char[] { '~' });
|
||||
return (subStrings.Length >= 1) ? subStrings[0] : string.Empty;
|
||||
}
|
||||
|
||||
public static string EncodedStrToFullName(string encodedStr)
|
||||
{
|
||||
string[] subStrings = encodedStr.Split(new char[] { '~' });
|
||||
return (subStrings.Length >= 2) ? subStrings[1] : string.Empty;
|
||||
}
|
||||
|
||||
public static string EncodedStrToLegalizator(string encodedStr)
|
||||
{
|
||||
string[] subStrings = encodedStr.Split(new char[] { '~' });
|
||||
return (subStrings.Length >= 3) ? subStrings[2] : string.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns 'true' when authentication data are valid for a power user.
|
||||
/// </summary>
|
||||
|
||||
@ -7,7 +7,7 @@ namespace Users
|
||||
public static DBSettings RemoteUsersDB = null;
|
||||
public static DBSettings LocalUsersDB = null;
|
||||
|
||||
public static IUser CurrentUser;
|
||||
public static Entities.User CurrentUser;
|
||||
public static Entities.AuthorizedAs AuthorizedAs;
|
||||
public static DateTime LastAuthorization = DateTime.Now;
|
||||
}
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace Users
|
||||
{
|
||||
public interface IUser
|
||||
{
|
||||
string UserName { get; }
|
||||
string FullName { get; }
|
||||
int Number { get; }
|
||||
|
||||
bool IsMemberOf(Grp.GID group);
|
||||
|
||||
bool Authorize(string userName, string password);
|
||||
bool Authorize(string userName, string password, Grp.GID requiredGroup);
|
||||
|
||||
bool AuthorizeFullName(string fullName, string password);
|
||||
bool AuthorizeFullName(string fullName, string password, Grp.GID requiredGroup);
|
||||
|
||||
bool AuthorizeNumber(int number, string password);
|
||||
bool AuthorizeNumber(int number, string password, Grp.GID requiredGroup);
|
||||
|
||||
//IUser LoadUserByName(string username, DBSettings dbSettings);
|
||||
//IUser LoadUserByFullName(string alias, DBSettings dbSettings);
|
||||
//IUser LoadUserByNumber(int number, DBSettings dbSettings);
|
||||
}
|
||||
}
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.12.499.0")]
|
||||
[assembly: AssemblyFileVersion("2.12.499.0")]
|
||||
[assembly: AssemblyVersion("2.16.667.0")]
|
||||
[assembly: AssemblyFileVersion("2.16.667.0")]
|
||||
|
||||
@ -82,7 +82,6 @@
|
||||
<DependentUpon>LoginDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Grp.cs" />
|
||||
<Compile Include="IUser.cs" />
|
||||
<Compile Include="Mappings\GroupMap.cs" />
|
||||
<Compile Include="Mappings\UserMap.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user