Register new AD user control

Change password control
This commit is contained in:
Stoyan Zlatev 2024-02-13 11:45:50 +01:00
parent 2b85c6877a
commit dc4a3fa73a
29 changed files with 1256 additions and 294 deletions

View File

@ -1,184 +1,43 @@
namespace CommonConsole
{
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
public class Program
{
//[DllImport("GMH3x32E.dll")]
//public static extern Int16 UniversalOpenCom(Int16 ini16COMPortNumber, UInt32 inui32BaudRate, Int16 inui16ConverterType, Int16 ini16Parity, Int16 ini16StoppBits);
//[DllImport("GMH3x32E.dll")]
//public static extern Int16 GMH_CloseCom();
//[DllImport("GMH3x32E.dll")]
//unsafe public static extern Int16 GMH_Transmit(Int16 ini16DeviceAddress, Int16 ini16TransmitCode, Int16* refi16ptrPriority, double* refdblptrFloatValue, Int32* refi32ptrIntegerValue);
private static readonly HttpClient httpClient = new HttpClient();
public static void Main()
{
// UniversalOpenCom(12, 4800, 8, 0, 0);
Task.Factory
.StartNew(async () =>
{
using (var httpRequestMessage = new HttpRequestMessage())
{
httpRequestMessage.Content = new StringContent("{}", Encoding.UTF8, "application/json");
httpRequestMessage.Method = HttpMethod.Post;
httpRequestMessage.RequestUri = new Uri("http://localhost:52822/LaaProductionWeb/api/Login/AD");
// Int16 i16Priority;
// Double dblFloatValue;
// Int32 i32IntergerValue;
using (var httpResponseMessage = await httpClient.SendAsync(httpRequestMessage))
{
Console.WriteLine(httpResponseMessage);
// unsafe
// {
// var i16ErrorCode = GMH_Transmit(1, 0, &i16Priority, &dblFloatValue, &i32IntergerValue);
// }
using (var httpContent = httpResponseMessage.Content)
{
var content = await httpContent.ReadAsStringAsync();
var obj = JsonConvert.DeserializeObject(content);
Console.WriteLine(JsonConvert.SerializeObject(obj, Formatting.Indented));
}
}
}
});
// Console.WriteLine(dblFloatValue);
// GMH_CloseCom();
Console.ReadKey();
}
//public static void Main(string[] args)
//{
// var messurementLines = File.ReadLines(@".\messurements.txt");
// var messurements = new List<Messurement>();
// var parsedData = new List<MessurementData>();
// var us = new CultureInfo("en-US");
// var de = new CultureInfo("de-DE");
// var any = NumberStyles.Any;
// var skipNext = true;
// foreach (var line in messurementLines)
// {
// if (string.IsNullOrWhiteSpace(line))
// {
// if (parsedData.Count > 0)
// {
// messurements.Add(new Messurement
// {
// PcbId = parsedData.First().PcbId,
// Start = parsedData.Min(x => x.Timestamp),
// MinT = parsedData.Min(x => x.CurrentT),
// MinTOF = parsedData.Min(x => x.CurrentTOF),
// AvgT = parsedData.Average(x => x.CurrentT),
// AvgTOF = parsedData.Average(x => x.CurrentTOF),
// MaxT = parsedData.Max(x => x.CurrentT),
// MaxTOF = parsedData.Max(x => x.CurrentTOF),
// End = parsedData.Max(x => x.Timestamp),
// });
// }
// parsedData = new List<MessurementData>();
// skipNext = true;
// continue;
// }
// if (skipNext)
// {
// skipNext = false;
// continue;
// }
// var lineTokens = line.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
// if (lineTokens.Length != 4)
// {
// continue;
// }
// var dateString = lineTokens[0];
// var pcbId = lineTokens[1];
// var temperatureString = lineTokens[2];
// var tofString = lineTokens[3];
// _ = DateTime.TryParse(dateString.Substring(1, dateString.Length - 2), out var timestamp);
// _ = double.TryParse(temperatureString, any, us, out var currentT) || double.TryParse(temperatureString, any, de, out currentT);
// _ = double.TryParse(tofString, any, us, out var currentTOF) || double.TryParse(tofString, any, de, out currentT);
// parsedData.Add(new MessurementData
// {
// PcbId = pcbId,
// CurrentT = currentT,
// CurrentTOF = currentTOF,
// Timestamp = timestamp
// });
// }
// File.WriteAllLines(@".\messurements.csv", messurements.Select(x
// => $"{x.PcbId,10}\t"
// + $"{x.AvgT,5:0.00}\t"
// + $"{x.AvgTOF,12:0.0000000000}\t"
// + $"{x.DifferenceT,5:00.00}\t"
// + $"{x.DifferenceTOF,12:0.0000000000}"));
// Console.WriteLine(Messurement.Header);
// messurements.ForEach(Console.WriteLine);
//}
}
public class MessurementData
{
public string PcbId { get; set; }
public double CurrentT { get; set; }
public double CurrentTOF { get; set; }
public DateTime Timestamp { get; set; }
}
public class Messurement
{
public string PcbId { get; set; }
public DateTime Start { get; set; }
public double MinTOF { get; set; }
public double MinT { get; set; }
public double AvgTOF { get; set; }
public double AvgT { get; set; }
public double MaxTOF { get; set; }
public double MaxT { get; set; }
public DateTime End { get; set; }
public double DifferenceT => Math.Abs(this.MaxT - this.MinT);
public double DifferenceTOF => Math.Abs(this.MaxTOF - this.MinTOF);
public override String ToString()
=> $"{this.PcbId,10}\t"
+ $"{this.Start,21:yyyy-MM-dd hh:mm:ss}\t"
+ $"{this.MinT,5:0.00}\t"
+ $"{this.MinTOF,12:0.0000000000}\t"
+ $"{this.AvgT,5:0.00}\t"
+ $"{this.AvgTOF,12:0.0000000000}\t"
+ $"{this.MaxT,5:0.00}\t"
+ $"{this.MaxTOF,12:0.0000000000}\t"
+ $"{this.End,21:yyyy-MM-dd hh:mm:ss}\t"
+ $"{this.DifferenceT,5:00.00}\t"
+ $"{this.DifferenceTOF,12:0.0000000000}";
public static string Header
=> $"{"PcbId",10}\t"
+ $"{"Start",21}\t"
+ $"{"Min T",5}\t"
+ $"{"Min TOF",12}\t"
+ $"{"Avg T",5}\t"
+ $"{"Avg TOF",12}\t"
+ $"{"Max T",5}\t"
+ $"{"Max TOF",12}\t"
+ $"{"End",21}\t"
+ $"{"Dif T",5}\t"
+ $"{"Dif TOF",12}";
}
}

View File

@ -0,0 +1,211 @@
namespace Xylem.Common.Ui.GenesisToolBox.Ctls
{
partial class ChangePassword
{
/// <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 Component 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.layout = new System.Windows.Forms.TableLayoutPanel();
this.oldPasswordLbl = new System.Windows.Forms.Label();
this.newPasswordLbl = new System.Windows.Forms.Label();
this.confirmPasswordLbl = new System.Windows.Forms.Label();
this.oldPassword = new System.Windows.Forms.TextBox();
this.newPassword = new System.Windows.Forms.TextBox();
this.confirmPassword = new System.Windows.Forms.TextBox();
this.submitBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.ChangePasswordErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
this.layout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ChangePasswordErrorProvider)).BeginInit();
this.SuspendLayout();
//
// layout
//
this.layout.AutoSize = true;
this.layout.ColumnCount = 3;
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.layout.Controls.Add(this.oldPasswordLbl, 1, 1);
this.layout.Controls.Add(this.newPasswordLbl, 1, 4);
this.layout.Controls.Add(this.confirmPasswordLbl, 1, 7);
this.layout.Controls.Add(this.oldPassword, 1, 2);
this.layout.Controls.Add(this.newPassword, 1, 5);
this.layout.Controls.Add(this.confirmPassword, 1, 8);
this.layout.Controls.Add(this.submitBtn, 1, 10);
this.layout.Controls.Add(this.cancelBtn, 1, 12);
this.layout.Dock = System.Windows.Forms.DockStyle.Fill;
this.layout.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.layout.Location = new System.Drawing.Point(0, 0);
this.layout.Name = "layout";
this.layout.RowCount = 14;
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout.Size = new System.Drawing.Size(517, 584);
this.layout.TabIndex = 0;
//
// oldPasswordLbl
//
this.oldPasswordLbl.AutoSize = true;
this.oldPasswordLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.oldPasswordLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.oldPasswordLbl.Location = new System.Drawing.Point(129, 188);
this.oldPasswordLbl.Margin = new System.Windows.Forms.Padding(0);
this.oldPasswordLbl.Name = "oldPasswordLbl";
this.oldPasswordLbl.Size = new System.Drawing.Size(258, 15);
this.oldPasswordLbl.TabIndex = 0;
this.oldPasswordLbl.Text = "Old password";
this.oldPasswordLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// newPasswordLbl
//
this.newPasswordLbl.AutoSize = true;
this.newPasswordLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.newPasswordLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.newPasswordLbl.Location = new System.Drawing.Point(129, 236);
this.newPasswordLbl.Margin = new System.Windows.Forms.Padding(0);
this.newPasswordLbl.Name = "newPasswordLbl";
this.newPasswordLbl.Size = new System.Drawing.Size(258, 15);
this.newPasswordLbl.TabIndex = 1;
this.newPasswordLbl.Text = "New password";
this.newPasswordLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// confirmPasswordLbl
//
this.confirmPasswordLbl.AutoSize = true;
this.confirmPasswordLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.confirmPasswordLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.confirmPasswordLbl.Location = new System.Drawing.Point(129, 284);
this.confirmPasswordLbl.Margin = new System.Windows.Forms.Padding(0);
this.confirmPasswordLbl.Name = "confirmPasswordLbl";
this.confirmPasswordLbl.Size = new System.Drawing.Size(258, 15);
this.confirmPasswordLbl.TabIndex = 2;
this.confirmPasswordLbl.Text = "Confirm password";
this.confirmPasswordLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// oldPassword
//
this.oldPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.oldPassword.Dock = System.Windows.Forms.DockStyle.Fill;
this.oldPassword.Location = new System.Drawing.Point(132, 203);
this.oldPassword.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.oldPassword.Name = "oldPassword";
this.oldPassword.Size = new System.Drawing.Size(255, 23);
this.oldPassword.TabIndex = 3;
//
// newPassword
//
this.newPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.newPassword.Dock = System.Windows.Forms.DockStyle.Fill;
this.newPassword.Location = new System.Drawing.Point(132, 251);
this.newPassword.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.newPassword.Name = "newPassword";
this.newPassword.Size = new System.Drawing.Size(255, 23);
this.newPassword.TabIndex = 4;
//
// confirmPassword
//
this.confirmPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.confirmPassword.Dock = System.Windows.Forms.DockStyle.Fill;
this.confirmPassword.Location = new System.Drawing.Point(132, 299);
this.confirmPassword.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.confirmPassword.Name = "confirmPassword";
this.confirmPassword.Size = new System.Drawing.Size(255, 23);
this.confirmPassword.TabIndex = 5;
//
// submitBtn
//
this.submitBtn.AutoSize = true;
this.submitBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Location = new System.Drawing.Point(132, 332);
this.submitBtn.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.submitBtn.Name = "submitBtn";
this.submitBtn.Size = new System.Drawing.Size(255, 27);
this.submitBtn.TabIndex = 6;
this.submitBtn.Text = "Change password";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.Click += new System.EventHandler(this.OnFormSubmittedClick);
//
// cancelBtn
//
this.cancelBtn.AutoSize = true;
this.cancelBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelBtn.Location = new System.Drawing.Point(132, 369);
this.cancelBtn.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(255, 27);
this.cancelBtn.TabIndex = 7;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
//
// ChangePasswordErrorProvider
//
this.ChangePasswordErrorProvider.ContainerControl = this;
//
// ResetPassword
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layout);
this.Name = "ResetPassword";
this.Size = new System.Drawing.Size(517, 584);
this.layout.ResumeLayout(false);
this.layout.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ChangePasswordErrorProvider)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TableLayoutPanel layout;
private System.Windows.Forms.Label oldPasswordLbl;
private System.Windows.Forms.Label newPasswordLbl;
private System.Windows.Forms.Label confirmPasswordLbl;
private System.Windows.Forms.TextBox oldPassword;
private System.Windows.Forms.TextBox newPassword;
private System.Windows.Forms.TextBox confirmPassword;
private System.Windows.Forms.Button submitBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.ErrorProvider ChangePasswordErrorProvider;
}
}

View File

@ -0,0 +1,60 @@
namespace Xylem.Common.Ui.GenesisToolBox.Ctls
{
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Xylem.Common.Ui.GenesisToolBox.Infrastructure;
public partial class ChangePassword : UserControl
{
private readonly Action<ChangePassword> changePasswordSubmitted;
private readonly IDictionary<string, Control> fields;
public ChangePassword()
{
this.InitializeComponent();
this.Dock = DockStyle.Fill;
}
public ChangePassword(Action<ChangePassword> resetPasswordSubmitted) : this()
{
this.changePasswordSubmitted = resetPasswordSubmitted;
this.fields = new Dictionary<string, Control>
{
{ "OldPassword", this.oldPassword },
{ "NewPassword", this.newPassword },
{ "ConfirmPassword", this.confirmPassword },
};
}
public event Action<Control> OnCancellation;
private void OnCancellationClick(Object sender, EventArgs args)
{
this.OnCancellation?.Invoke(this);
}
private void OnFormSubmittedClick(Object sender, EventArgs args)
{
this.ChangePasswordErrorProvider.Clear();
if (!Software.ChangePassword(this.oldPassword.Text, this.newPassword.Text, this.confirmPassword.Text, out var errors))
{
foreach (var kvp in errors)
{
if (this.fields.TryGetValue(kvp.Key, out var control))
{
this.ChangePasswordErrorProvider.SetError(control, kvp.Value);
}
}
}
else
{
this.changePasswordSubmitted?.Invoke(this);
}
}
}
}

View File

@ -0,0 +1,123 @@
<?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>
<metadata name="ChangePasswordErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -37,12 +37,14 @@
this.Username = new System.Windows.Forms.TextBox();
this.PasswordLabel = new System.Windows.Forms.Label();
this.LoginErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
this.cancelBtn = new System.Windows.Forms.Button();
this.LoginFormPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LoginErrorProvider)).BeginInit();
this.SuspendLayout();
//
// LoginFormPanel
//
this.LoginFormPanel.Controls.Add(this.cancelBtn);
this.LoginFormPanel.Controls.Add(this.ErrorMessage);
this.LoginFormPanel.Controls.Add(this.LoginButton);
this.LoginFormPanel.Controls.Add(this.Password);
@ -132,6 +134,19 @@
this.LoginErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
this.LoginErrorProvider.ContainerControl = this;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cancelBtn.Location = new System.Drawing.Point(97, 246);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(266, 23);
this.cancelBtn.TabIndex = 6;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.OnCancelClick);
//
// LoginForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -156,5 +171,6 @@
private System.Windows.Forms.Label PasswordLabel;
private System.Windows.Forms.ErrorProvider LoginErrorProvider;
private System.Windows.Forms.Label ErrorMessage;
private System.Windows.Forms.Button cancelBtn;
}
}

View File

@ -19,6 +19,8 @@
public LoginForm(Action<string, string, object> submittedCallback) : this()
=> this.submittedCallback = submittedCallback;
public event Action<Control> OnCancellation;
private void LoginButtonClick(object sender, EventArgs e)
{
this.ErrorMessage.Text = default(string);
@ -48,5 +50,10 @@
internal void ShowError(string errorMessage)
=> this.ErrorMessage.Text = errorMessage;
private void OnCancelClick(Object sender, EventArgs e)
{
this.OnCancellation?.Invoke(this);
}
}
}

View File

@ -0,0 +1,377 @@
namespace Xylem.Common.Ui.GenesisToolBox.Ctls
{
partial class RegisterLDAPUser
{
/// <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 Component 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.layout = new System.Windows.Forms.TableLayoutPanel();
this.employeeIdLbl = new System.Windows.Forms.Label();
this.employeeId = new System.Windows.Forms.TextBox();
this.firstnameLbl = new System.Windows.Forms.Label();
this.lastnameLbl = new System.Windows.Forms.Label();
this.phoneLbl = new System.Windows.Forms.Label();
this.emailLbl = new System.Windows.Forms.Label();
this.usernameLbl = new System.Windows.Forms.Label();
this.passwordLbl = new System.Windows.Forms.Label();
this.confirmPasswordLbl = new System.Windows.Forms.Label();
this.firstname = new System.Windows.Forms.TextBox();
this.lastname = new System.Windows.Forms.TextBox();
this.phone = new System.Windows.Forms.TextBox();
this.email = new System.Windows.Forms.TextBox();
this.username = new System.Windows.Forms.TextBox();
this.password = new System.Windows.Forms.TextBox();
this.confirmPassword = new System.Windows.Forms.TextBox();
this.submitBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.RegisterErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
this.layout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.RegisterErrorProvider)).BeginInit();
this.SuspendLayout();
//
// layout
//
this.layout.AutoSize = true;
this.layout.ColumnCount = 3;
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.51852F));
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 62.96296F));
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.51852F));
this.layout.Controls.Add(this.employeeIdLbl, 1, 1);
this.layout.Controls.Add(this.employeeId, 1, 2);
this.layout.Controls.Add(this.firstnameLbl, 1, 4);
this.layout.Controls.Add(this.lastnameLbl, 1, 7);
this.layout.Controls.Add(this.phoneLbl, 1, 10);
this.layout.Controls.Add(this.emailLbl, 1, 13);
this.layout.Controls.Add(this.usernameLbl, 1, 16);
this.layout.Controls.Add(this.passwordLbl, 1, 19);
this.layout.Controls.Add(this.confirmPasswordLbl, 1, 22);
this.layout.Controls.Add(this.firstname, 1, 5);
this.layout.Controls.Add(this.lastname, 1, 8);
this.layout.Controls.Add(this.phone, 1, 11);
this.layout.Controls.Add(this.email, 1, 14);
this.layout.Controls.Add(this.username, 1, 17);
this.layout.Controls.Add(this.password, 1, 20);
this.layout.Controls.Add(this.confirmPassword, 1, 23);
this.layout.Controls.Add(this.submitBtn, 1, 25);
this.layout.Controls.Add(this.cancelBtn, 1, 27);
this.layout.Dock = System.Windows.Forms.DockStyle.Fill;
this.layout.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.layout.Location = new System.Drawing.Point(0, 0);
this.layout.Margin = new System.Windows.Forms.Padding(0);
this.layout.Name = "layout";
this.layout.RowCount = 29;
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout.Size = new System.Drawing.Size(371, 545);
this.layout.TabIndex = 1;
//
// employeeIdLbl
//
this.employeeIdLbl.AutoSize = true;
this.employeeIdLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.employeeIdLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.employeeIdLbl.Location = new System.Drawing.Point(68, 66);
this.employeeIdLbl.Margin = new System.Windows.Forms.Padding(0);
this.employeeIdLbl.Name = "employeeIdLbl";
this.employeeIdLbl.Size = new System.Drawing.Size(233, 15);
this.employeeIdLbl.TabIndex = 0;
this.employeeIdLbl.Text = "Employee Id";
this.employeeIdLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// employeeId
//
this.employeeId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.employeeId.Dock = System.Windows.Forms.DockStyle.Fill;
this.employeeId.Location = new System.Drawing.Point(71, 81);
this.employeeId.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.employeeId.Name = "employeeId";
this.employeeId.ReadOnly = true;
this.employeeId.Size = new System.Drawing.Size(230, 23);
this.employeeId.TabIndex = 1;
//
// firstnameLbl
//
this.firstnameLbl.AutoSize = true;
this.firstnameLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.firstnameLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.firstnameLbl.Location = new System.Drawing.Point(68, 109);
this.firstnameLbl.Margin = new System.Windows.Forms.Padding(0);
this.firstnameLbl.Name = "firstnameLbl";
this.firstnameLbl.Size = new System.Drawing.Size(233, 15);
this.firstnameLbl.TabIndex = 2;
this.firstnameLbl.Text = "First name";
this.firstnameLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// lastnameLbl
//
this.lastnameLbl.AutoSize = true;
this.lastnameLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.lastnameLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lastnameLbl.Location = new System.Drawing.Point(68, 152);
this.lastnameLbl.Margin = new System.Windows.Forms.Padding(0);
this.lastnameLbl.Name = "lastnameLbl";
this.lastnameLbl.Size = new System.Drawing.Size(233, 15);
this.lastnameLbl.TabIndex = 3;
this.lastnameLbl.Text = "Last name";
this.lastnameLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// phoneLbl
//
this.phoneLbl.AutoSize = true;
this.phoneLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.phoneLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.phoneLbl.Location = new System.Drawing.Point(68, 195);
this.phoneLbl.Margin = new System.Windows.Forms.Padding(0);
this.phoneLbl.Name = "phoneLbl";
this.phoneLbl.Size = new System.Drawing.Size(233, 15);
this.phoneLbl.TabIndex = 4;
this.phoneLbl.Text = "Phone";
this.phoneLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// emailLbl
//
this.emailLbl.AutoSize = true;
this.emailLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.emailLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.emailLbl.Location = new System.Drawing.Point(68, 238);
this.emailLbl.Margin = new System.Windows.Forms.Padding(0);
this.emailLbl.Name = "emailLbl";
this.emailLbl.Size = new System.Drawing.Size(233, 15);
this.emailLbl.TabIndex = 5;
this.emailLbl.Text = "Email";
this.emailLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// usernameLbl
//
this.usernameLbl.AutoSize = true;
this.usernameLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.usernameLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.usernameLbl.Location = new System.Drawing.Point(68, 281);
this.usernameLbl.Margin = new System.Windows.Forms.Padding(0);
this.usernameLbl.Name = "usernameLbl";
this.usernameLbl.Size = new System.Drawing.Size(233, 15);
this.usernameLbl.TabIndex = 6;
this.usernameLbl.Text = "Username";
this.usernameLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// passwordLbl
//
this.passwordLbl.AutoSize = true;
this.passwordLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.passwordLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.passwordLbl.Location = new System.Drawing.Point(68, 324);
this.passwordLbl.Margin = new System.Windows.Forms.Padding(0);
this.passwordLbl.Name = "passwordLbl";
this.passwordLbl.Size = new System.Drawing.Size(233, 15);
this.passwordLbl.TabIndex = 7;
this.passwordLbl.Text = "Password";
this.passwordLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// confirmPasswordLbl
//
this.confirmPasswordLbl.AutoSize = true;
this.confirmPasswordLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.confirmPasswordLbl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.confirmPasswordLbl.Location = new System.Drawing.Point(68, 367);
this.confirmPasswordLbl.Margin = new System.Windows.Forms.Padding(0);
this.confirmPasswordLbl.Name = "confirmPasswordLbl";
this.confirmPasswordLbl.Size = new System.Drawing.Size(233, 15);
this.confirmPasswordLbl.TabIndex = 8;
this.confirmPasswordLbl.Text = "Confirm password";
this.confirmPasswordLbl.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// firstname
//
this.firstname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.firstname.Dock = System.Windows.Forms.DockStyle.Fill;
this.firstname.Location = new System.Drawing.Point(71, 124);
this.firstname.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.firstname.Name = "firstname";
this.firstname.ReadOnly = true;
this.firstname.Size = new System.Drawing.Size(230, 23);
this.firstname.TabIndex = 9;
//
// lastname
//
this.lastname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lastname.Dock = System.Windows.Forms.DockStyle.Fill;
this.lastname.Location = new System.Drawing.Point(71, 167);
this.lastname.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lastname.Name = "lastname";
this.lastname.ReadOnly = true;
this.lastname.Size = new System.Drawing.Size(230, 23);
this.lastname.TabIndex = 10;
//
// phone
//
this.phone.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.phone.Dock = System.Windows.Forms.DockStyle.Fill;
this.phone.Location = new System.Drawing.Point(71, 210);
this.phone.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.phone.Name = "phone";
this.phone.ReadOnly = true;
this.phone.Size = new System.Drawing.Size(230, 23);
this.phone.TabIndex = 11;
//
// email
//
this.email.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.email.Dock = System.Windows.Forms.DockStyle.Fill;
this.email.Location = new System.Drawing.Point(71, 253);
this.email.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.email.Name = "email";
this.email.ReadOnly = true;
this.email.Size = new System.Drawing.Size(230, 23);
this.email.TabIndex = 12;
//
// username
//
this.username.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.username.Dock = System.Windows.Forms.DockStyle.Fill;
this.username.Location = new System.Drawing.Point(71, 296);
this.username.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.username.Name = "username";
this.username.Size = new System.Drawing.Size(230, 23);
this.username.TabIndex = 13;
//
// password
//
this.password.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.password.Dock = System.Windows.Forms.DockStyle.Fill;
this.password.Location = new System.Drawing.Point(71, 339);
this.password.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.password.Name = "password";
this.password.Size = new System.Drawing.Size(230, 23);
this.password.TabIndex = 14;
//
// confirmPassword
//
this.confirmPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.confirmPassword.Dock = System.Windows.Forms.DockStyle.Fill;
this.confirmPassword.Location = new System.Drawing.Point(71, 382);
this.confirmPassword.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.confirmPassword.Name = "confirmPassword";
this.confirmPassword.Size = new System.Drawing.Size(230, 23);
this.confirmPassword.TabIndex = 15;
//
// submitBtn
//
this.submitBtn.AutoSize = true;
this.submitBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitBtn.Location = new System.Drawing.Point(71, 415);
this.submitBtn.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.submitBtn.Name = "submitBtn";
this.submitBtn.Size = new System.Drawing.Size(230, 27);
this.submitBtn.TabIndex = 16;
this.submitBtn.Text = "Complete Registration";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.Click += new System.EventHandler(this.SubmitBtn_Click);
//
// cancelBtn
//
this.cancelBtn.AutoSize = true;
this.cancelBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelBtn.Location = new System.Drawing.Point(71, 452);
this.cancelBtn.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(230, 27);
this.cancelBtn.TabIndex = 17;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.OnCancellationClick);
//
// RegisterErrorProvider
//
this.RegisterErrorProvider.ContainerControl = this;
//
// RegisterLDAPUser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.layout);
this.Name = "RegisterLDAPUser";
this.Size = new System.Drawing.Size(371, 545);
this.layout.ResumeLayout(false);
this.layout.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.RegisterErrorProvider)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TableLayoutPanel layout;
private System.Windows.Forms.Label employeeIdLbl;
private System.Windows.Forms.TextBox employeeId;
private System.Windows.Forms.Label firstnameLbl;
private System.Windows.Forms.Label lastnameLbl;
private System.Windows.Forms.Label phoneLbl;
private System.Windows.Forms.Label emailLbl;
private System.Windows.Forms.Label usernameLbl;
private System.Windows.Forms.Label passwordLbl;
private System.Windows.Forms.Label confirmPasswordLbl;
private System.Windows.Forms.TextBox firstname;
private System.Windows.Forms.TextBox lastname;
private System.Windows.Forms.TextBox phone;
private System.Windows.Forms.TextBox email;
private System.Windows.Forms.TextBox username;
private System.Windows.Forms.TextBox password;
private System.Windows.Forms.TextBox confirmPassword;
private System.Windows.Forms.Button submitBtn;
private System.Windows.Forms.ErrorProvider RegisterErrorProvider;
private System.Windows.Forms.Button cancelBtn;
}
}

View File

@ -0,0 +1,81 @@
namespace Xylem.Common.Ui.GenesisToolBox.Ctls
{
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Xylem.Common.Ui.GenesisToolBox.Infrastructure;
public partial class RegisterLDAPUser : UserControl
{
private readonly Action<RegisterLDAPUser> initializeFormState;
private readonly IDictionary<string, Control> fields;
public RegisterLDAPUser()
{
this.InitializeComponent();
this.Dock = DockStyle.Fill;
var user = Software.PendingUser;
this.employeeId.Text = user.EmployeeId.ToString();
this.firstname.Text = user.FirstName;
this.lastname.Text = user.LastName;
this.phone.Text = user.Phone;
this.email.Text = user.Email;
this.username.Text = user.Username;
this.password.Text = user.Password;
this.confirmPassword.Text = user.ConfirmPassword;
this.fields = new Dictionary<string, Control>
{
{ nameof(user.EmployeeId), this.employeeId },
{ nameof(user.FirstName), this.firstname },
{ nameof(user.LastName), this.lastname },
{ nameof(user.Phone), this.phone },
{ nameof(user.Email), this.email },
{ nameof(user.Username), this.username },
{ nameof(user.Password), this.password },
{ nameof(user.ConfirmPassword), this.confirmPassword },
};
}
public RegisterLDAPUser(Action<RegisterLDAPUser> initializeFormState) : this()
{
this.initializeFormState = initializeFormState;
}
public event Action<Control> OnCancellation;
private void SubmitBtn_Click(Object sender, EventArgs args)
{
this.RegisterErrorProvider.Clear();
var user = Software.PendingUser;
user.Username = this.username.Text;
user.Password = this.password.Text;
user.ConfirmPassword = this.confirmPassword.Text;
if (!Software.Register(user, out var errors))
{
foreach (var kvp in errors)
{
if (this.fields.TryGetValue(kvp.Key, out var control))
{
this.RegisterErrorProvider.SetError(control, kvp.Value);
}
}
}
else
{
this.initializeFormState?.Invoke(this);
}
}
private void OnCancellationClick(Object sender, EventArgs args)
{
this.OnCancellation?.Invoke(this);
}
}
}

View File

@ -0,0 +1,123 @@
<?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>
<metadata name="RegisterErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -216,6 +216,18 @@
<Compile Include="Ctls\LoginForm.Designer.cs">
<DependentUpon>LoginForm.cs</DependentUpon>
</Compile>
<Compile Include="Ctls\RegisterLDAPUser.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Ctls\RegisterLDAPUser.Designer.cs">
<DependentUpon>RegisterLDAPUser.cs</DependentUpon>
</Compile>
<Compile Include="Ctls\ChangePassword.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Ctls\ChangePassword.Designer.cs">
<DependentUpon>ChangePassword.cs</DependentUpon>
</Compile>
<Compile Include="Ctls\TextProgressBar.cs">
<SubType>Component</SubType>
</Compile>
@ -436,10 +448,10 @@
<Compile Include="FrmTempMeter.Designer.cs">
<DependentUpon>FrmTempMeter.cs</DependentUpon>
</Compile>
<Compile Include="Infrastructure\ADLoginModel.cs" />
<Compile Include="Infrastructure\Appsettings.cs" />
<Compile Include="Infrastructure\LDAPLoginModel.cs" />
<Compile Include="Infrastructure\LDAPUser.cs" />
<Compile Include="Infrastructure\Software.cs" />
<Compile Include="Infrastructure\SoftwareUser.cs" />
<Compile Include="Infrastructure\SoftwareVersion.cs" />
<Compile Include="Infrastructure\SoftwareFunctions.cs" />
<Compile Include="Infrastructure\TempMeterModels.cs" />
@ -466,6 +478,12 @@
<EmbeddedResource Include="Ctls\LoginForm.resx">
<DependentUpon>LoginForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Ctls\RegisterLDAPUser.resx">
<DependentUpon>RegisterLDAPUser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Ctls\ChangePassword.resx">
<DependentUpon>ChangePassword.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmCalibrationResults.resx">
<DependentUpon>FrmCalibrationResults.cs</DependentUpon>
</EmbeddedResource>

View File

@ -11,17 +11,5 @@
public int BuildV { get; set; }
public int EmployeeId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Username { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string DomainName { get; set; }
}
}

View File

@ -12,15 +12,23 @@
public int EmployeeId { get; private set; }
public string FirstName { get; private set; }
public string FirstName { get; set; }
public string LastName { get; private set; }
public string LastName { get; set; }
public string Username { get; private set; }
public string Phone { get; set; }
public string Phone { get; private set; }
public string Email { get; set; }
public string Email { get; private set; }
public string Username { get; set; }
public string DomainName { get; private set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
public bool Found { get; private set; }
private void InitializeLDAPUser()
{
@ -97,18 +105,21 @@
{
if (dictionaryEntryValues.Count > 0 && dictionaryEntryValues[0] is string username)
{
this.Username = username.ToLower();
this.DomainName = username.ToLower();
this.Username = this.DomainName;
}
}
}
this.Found = this.EmployeeId > 0;
}
}
}
}
}
catch (Exception e)
catch (Exception)
{
Console.WriteLine(e);
}
}
}

View File

@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
@ -18,50 +19,40 @@
internal static class Software
{
private static String bearer;
private static LDAPUser user;
private static IEnumerable<SoftwareFunctions> softwareFunctions = Array.Empty<SoftwareFunctions>();
public static String UserName;
public static String UserName { get; private set; }
private static Boolean HasUser => !string.IsNullOrWhiteSpace(bearer);
public static Boolean IsRegistrationPending { get; set; } //=> user.Found && string.IsNullOrWhiteSpace(bearer);
public static LDAPUser PendingUser => user;
public static void Initialize()
{
var version = SoftwareVersion.Current;
var user = new LDAPUser();
user = new LDAPUser();
Login(new LDAPLoginModel
{
Assembly = version.AssemblyName.Name,
Email = user.Email,
EmployeeId = user.EmployeeId,
FirstName = user.FirstName,
LastName = user.LastName,
Phone = user.Phone,
Username = user.Username,
MajorV = version.MajorV,
MinorV = version.MinorV,
BuildV = version.BuildV,
});
}
/// <summary>
/// Sends login request and obtains an bearer authorization token.
/// </summary>
/// <param name="model"><see cref="LDAPLoginModel"/> - containing all software and user info required for authentication.</param>
public static void Login(LDAPLoginModel model)
{
var authenticationResponse = LocalWebRequest.PostRequestAndGetResponseAsync(
url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Login/AD",
json: model);
bearer = authenticationResponse
?.Content
?.Trim()
?.Trim('"');
softwareFunctions = GetFunctions();
json: user);
if (HasUser)
if (authenticationResponse.StatusCode == HttpStatusCode.Accepted)
{
UserName = $"{model.FirstName} {model.LastName}";
IsRegistrationPending = true;
}
else
{
bearer = authenticationResponse
?.Content
?.Trim()
?.Trim('"');
softwareFunctions = GetFunctions();
if (!string.IsNullOrWhiteSpace(bearer))
{
UserName = $"{user.FirstName} {user.LastName}";
}
}
if (string.IsNullOrWhiteSpace(UserName))
@ -70,6 +61,49 @@
}
}
internal static Boolean ChangePassword(String text1, String text2, String text3, out Dictionary<String, String> errors)
{
errors = new Dictionary<string, string>();
var changePasswordResponse = LocalWebRequest.PostRequestAndGetResponseAsync(
url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Login/AD",
json: user);
if (changePasswordResponse.StatusCode != HttpStatusCode.OK)
{
if (!string.IsNullOrWhiteSpace(changePasswordResponse.Content))
{
errors = JsonConvert.DeserializeObject<Dictionary<string, string>>(changePasswordResponse.Content);
}
}
return changePasswordResponse.StatusCode == HttpStatusCode.OK;
}
internal static Boolean Register(LDAPUser user, out Dictionary<String, String> errors)
{
errors = new Dictionary<string, string>();
var registerLDAPResponse = LocalWebRequest.PostRequestAndGetResponseAsync(
url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Login/AD",
json: user);
if (registerLDAPResponse.StatusCode == HttpStatusCode.OK)
{
bearer = registerLDAPResponse
?.Content
?.Trim()
?.Trim('"');
softwareFunctions = GetFunctions();
}
else if (!string.IsNullOrWhiteSpace(registerLDAPResponse.Content))
{
errors = JsonConvert.DeserializeObject<Dictionary<string, string>>(registerLDAPResponse.Content);
}
return registerLDAPResponse.StatusCode == HttpStatusCode.OK;
}
/// <summary>
/// Sends login request and obtains an bearer authorization token.
/// </summary>
@ -92,21 +126,14 @@
?.Trim('"');
softwareFunctions = GetFunctions();
if (HasUser)
if (!string.IsNullOrWhiteSpace(bearer))
{
try
{
UserName = LocalWebRequest
.GetRequest(
timeoutMs: 1200,
url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Personalization/Login",
header: new Dictionary<String, String> { { "Authorization", $"Bearer {bearer}" } })
.Trim('"');
}
catch (Exception )
{
// ignored
}
UserName = LocalWebRequest
.GetRequest(
timeoutMs: 1200,
url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Personalization/Login",
header: new Dictionary<String, String> { { "Authorization", $"Bearer {bearer}" } })
.Trim('"');
}
if (string.IsNullOrWhiteSpace(UserName))
@ -114,7 +141,7 @@
UserName = "Options";
}
return HasUser;
return !string.IsNullOrWhiteSpace(bearer);
}
public static IEnumerable<SoftwareFunctions> GetFunctions()

View File

@ -9,7 +9,7 @@
public int MinorV { get; set; }
public int BuildV { get; set; }
public string Username { get; set; }
public string Password { get; set; }

View File

@ -2,7 +2,6 @@
{
using System;
using System.Windows.Forms;
using Xylem.Common.Ui.GenesisToolBox.Infrastructure;
internal static class Program

View File

@ -54,7 +54,7 @@
this.optionsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loginMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.logoutMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.registerMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resetPasswordMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gpGerneral.SuspendLayout();
this.gpLAA.SuspendLayout();
this.gbDeveloper.SuspendLayout();
@ -262,7 +262,7 @@
//
// btnLowLevelTools
//
this.btnLowLevelTools.Location = new System.Drawing.Point(4, 153);
this.btnLowLevelTools.Location = new System.Drawing.Point(4, 162);
this.btnLowLevelTools.Name = "btnLowLevelTools";
this.btnLowLevelTools.Size = new System.Drawing.Size(157, 40);
this.btnLowLevelTools.TabIndex = 22;
@ -278,9 +278,9 @@
this.gbDeveloper.Controls.Add(this.btnFiles);
this.gbDeveloper.Controls.Add(this.btnLegacyTestApp);
this.gbDeveloper.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gbDeveloper.Location = new System.Drawing.Point(186, 293);
this.gbDeveloper.Location = new System.Drawing.Point(186, 278);
this.gbDeveloper.Name = "gbDeveloper";
this.gbDeveloper.Size = new System.Drawing.Size(168, 193);
this.gbDeveloper.Size = new System.Drawing.Size(168, 208);
this.gbDeveloper.TabIndex = 21;
this.gbDeveloper.TabStop = false;
this.gbDeveloper.Text = "Developer";
@ -289,7 +289,7 @@
// BtnFileSplit
//
this.BtnFileSplit.Enabled = false;
this.BtnFileSplit.Location = new System.Drawing.Point(4, 111);
this.BtnFileSplit.Location = new System.Drawing.Point(4, 118);
this.BtnFileSplit.Name = "BtnFileSplit";
this.BtnFileSplit.Size = new System.Drawing.Size(157, 40);
this.BtnFileSplit.TabIndex = 18;
@ -301,7 +301,7 @@
// btnFiles
//
this.btnFiles.Enabled = false;
this.btnFiles.Location = new System.Drawing.Point(4, 65);
this.btnFiles.Location = new System.Drawing.Point(4, 72);
this.btnFiles.Name = "btnFiles";
this.btnFiles.Size = new System.Drawing.Size(157, 40);
this.btnFiles.TabIndex = 16;
@ -312,7 +312,7 @@
// btnLegacyTestApp
//
this.btnLegacyTestApp.Enabled = false;
this.btnLegacyTestApp.Location = new System.Drawing.Point(4, 19);
this.btnLegacyTestApp.Location = new System.Drawing.Point(4, 27);
this.btnLegacyTestApp.Name = "btnLegacyTestApp";
this.btnLegacyTestApp.Size = new System.Drawing.Size(157, 40);
this.btnLegacyTestApp.TabIndex = 15;
@ -336,7 +336,7 @@
this.optionsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.loginMenuItem,
this.logoutMenuItem,
this.registerMenuItem});
this.resetPasswordMenuItem});
this.optionsMenuItem.Name = "optionsMenuItem";
this.optionsMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsMenuItem.Text = "Options";
@ -356,12 +356,12 @@
this.logoutMenuItem.Text = "Logout";
this.logoutMenuItem.Click += new System.EventHandler(this.OnLogoutClick);
//
// registerMenuItem
// resetPasswordMenuItem
//
this.registerMenuItem.Name = "registerMenuItem";
this.registerMenuItem.Size = new System.Drawing.Size(180, 22);
this.registerMenuItem.Text = "Register";
this.registerMenuItem.Click += new System.EventHandler(this.OnRegisterClick);
this.resetPasswordMenuItem.Name = "resetPasswordMenuItem";
this.resetPasswordMenuItem.Size = new System.Drawing.Size(180, 22);
this.resetPasswordMenuItem.Text = "Change Password";
this.resetPasswordMenuItem.Click += new System.EventHandler(this.OnChangePasswordClick);
//
// FrmMainForm
//
@ -419,7 +419,7 @@
private System.Windows.Forms.ToolStripMenuItem optionsMenuItem;
private System.Windows.Forms.ToolStripMenuItem loginMenuItem;
private System.Windows.Forms.ToolStripMenuItem logoutMenuItem;
private System.Windows.Forms.ToolStripMenuItem registerMenuItem;
private System.Windows.Forms.ToolStripMenuItem resetPasswordMenuItem;
}
}

View File

@ -407,7 +407,7 @@
/// </summary>
private void SetSoftwareFunctions()
{
registerMenuItem.Tag = SoftwareFunctions.LAA_ADMIN;
resetPasswordMenuItem.Tag = SoftwareFunctions.LAA_ADMIN;
btnSetup.Tag = SoftwareFunctions.GENERAL_SETUP;
btnAlarm.Tag = SoftwareFunctions.GENERAL_ALARM;
@ -516,11 +516,29 @@
/// Hides all members but the login form if the app is initialized otherwise shows error message.
/// In case that the app is initialized and user is authorized shows all buttons as enabled or disabled depending on the user permissions.
/// </summary>
private void InitializeFormState()
private void InitializeFormState(RegisterLDAPUser registerForm = null)
{
if (registerForm != null)
{
Software.Initialize();
this.Controls.Remove(registerForm);
}
HideContent();
SetSoftwareFunctions();
ShowAvailableSoftwareFunctions();
if (Software.IsRegistrationPending)
{
registerForm = new RegisterLDAPUser(InitializeFormState);
registerForm.OnCancellation += this.OnControlCancellation;
this.Controls.Add(registerForm);
}
else
{
SetSoftwareFunctions();
ShowAvailableSoftwareFunctions();
}
}
private void OnLogoutClick(Object sender, EventArgs e)
@ -558,7 +576,10 @@
if (!hasLoginForm)
{
Controls.Add(new LoginForm(LoginFormSubmitted));
var loginForm = new LoginForm(LoginFormSubmitted);
loginForm.OnCancellation += OnControlCancellation;
Controls.Add(loginForm);
}
}
@ -577,7 +598,6 @@
Controls.Remove(loginForm);
ShowAvailableSoftwareFunctions();
optionsMenuItem.Text = Software.UserName;
}
else
@ -587,6 +607,28 @@
}
}
private void OnChangePasswordClick(Object _, EventArgs _1)
{
this.HideContent();
var control = new ChangePassword(this.OnControlCancellation);
control.OnCancellation += this.OnControlCancellation;
this.Controls.Add(control);
}
private void OnControlCancellation(Control control)
{
if (control != null)
{
Software.Initialize();
this.Controls.Remove(control);
}
this.InitializeFormState();
}
#endregion Form initialization
private void btnQsTool_Click(Object sender, EventArgs e)
@ -596,10 +638,5 @@
form.Closed += Form_Closed;
Hide();
}
private void OnRegisterClick(Object _, EventArgs _1)
{
MessageBox.Show("Register new user");
}
}
}

View File

@ -121,6 +121,6 @@
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>124</value>
</metadata>
</root>

View File

@ -11,7 +11,7 @@
{
public static object Errors(this ModelStateDictionary modelStateDictionary)
{
var errors = new Dictionary<string, string>();
var errors = new Dictionary<string, object>();
foreach (var error in modelStateDictionary)
{

View File

@ -0,0 +1,42 @@
namespace LaaProductionWeb.API
{
using Newtonsoft.Json;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Results;
public class ControllerBase : ApiController
{
protected override BadRequestResult BadRequest()
{
return new BadRequestModelResult(this);
}
}
public class BadRequestModelResult : BadRequestResult
{
private readonly ApiController controller;
public BadRequestModelResult(ApiController controller) : base(controller)
{
this.controller = controller;
}
public override Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
{
var errors = this.controller.ModelState.Errors();
var errorsJson = JsonConvert.SerializeObject(errors);
var httpResponseMessage = new HttpResponseMessage();
httpResponseMessage.Content = new StringContent(errorsJson, Encoding.UTF8, "application/json");
httpResponseMessage.ReasonPhrase = nameof(HttpStatusCode.BadRequest);
httpResponseMessage.RequestMessage = controller.Request;
httpResponseMessage.StatusCode = HttpStatusCode.BadRequest;
return Task.FromResult(httpResponseMessage);
}
}
}

View File

@ -7,9 +7,9 @@
using System.Net;
using System.Web.Http;
[RoutePrefix("api/Login")]
public class LoginController : ApiController
public class LoginController : ControllerBase
{
private readonly IAccountManager accountManager;
@ -31,7 +31,7 @@
{
if (!this.ModelState.IsValid)
{
return this.BadRequest(this.ModelState.ErrorsJson());
return this.BadRequest();
}
var bearer = this.accountManager.Login(model);
@ -45,7 +45,7 @@
{
if (!this.ModelState.IsValid)
{
return this.BadRequest(this.ModelState.ErrorsJson());
return this.BadRequest();
}
var bearer = this.accountManager.Login(model);

View File

@ -1,6 +1,6 @@
namespace LaaProductionWeb.App_Infrastructure
{
using LaaProductionHttp.Interfaces;
using LaaProduction.Http.Interfaces;
using Newtonsoft.Json;

View File

@ -1,7 +1,7 @@
namespace LaaProductionWeb.Areas.Personalization.Controllers
{
using LaaProduction.Personalization;
using LaaProductionHttp.Interfaces;
using LaaProduction.Http.Interfaces;
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.Areas.Personalization.Models.Employees;
using LaaProductionDI;

View File

@ -3,7 +3,7 @@
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.Areas.Personalization.Models.EmployeesRoles;
using LaaProductionDI;
using LaaProductionHttp.Interfaces;
using LaaProduction.Http.Interfaces;
using System;
using System.Collections.Generic;

View File

@ -4,7 +4,7 @@
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.Areas.Personalization.Models.Software;
using LaaProductionDI;
using LaaProductionHttp.Interfaces;
using LaaProduction.Http.Interfaces;
using System;
using System.Collections.Generic;

View File

@ -1,7 +1,7 @@
namespace LaaProductionWeb.Controllers
{
using LaaProduction.Personalization;
using LaaProductionHttp.Interfaces;
using LaaProduction.Http.Interfaces;
using LaaProductionWeb.App_Infrastructure;
using LaaProduction.Services.Interfaces;
using LaaProduction.Services.Models.Search;

View File

@ -5,10 +5,9 @@
using LaaProduction.Services;
using LaaProduction.Services.Interfaces;
using LaaProductionDI;
using LaaProductionHttp;
using LaaProduction.Http;
using LaaProductionSMTP;
using LaaProductionSQL;
using LaaProductionWeb;
using LaaProductionWeb.App_Infrastructure;
using System.Web;

View File

@ -1,17 +0,0 @@
namespace LaaProductionWeb.Hubs
{
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using SIRTBroadcaster.Abstraction;
[HubName(SIRTFixed.SIRT_HUB)]
public class SIRTBroadcasterHub : Hub, ISIRTBroadcaster
{
public void MessageReceived(SIRTMessage message)
=> this.Clients.All.MessageReceived(message);
public void SendMessage(SIRTMessage message)
=> this.Clients.All.SendMessage(message);
}
}

View File

@ -172,6 +172,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="API\APIExtensions.cs" />
<Compile Include="API\ControllerBase.cs" />
<Compile Include="API\LoginController.cs" />
<Compile Include="API\Personalization\EmployeesController.cs" />
<Compile Include="API\Personalization\RolesController.cs" />
@ -220,7 +221,6 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Hubs\SIRTBroadcasterHub.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="App_Start\StartupConfig.cs" />
</ItemGroup>
@ -314,6 +314,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Hubs\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>