some fixes in program.cs + form login/register
This commit is contained in:
parent
5ec0741a12
commit
8e2b4503b0
@ -12,11 +12,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace BeautyStudioBusinessLogic.BusinessLogics
|
||||
{
|
||||
public class LaborCostsLogic : ILaborCostLogic
|
||||
public class LaborCostLogic : ILaborCostLogic
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly ILaborCostStorage _laborCostsStorage;
|
||||
public LaborCostsLogic(ILogger<LaborCostsLogic> logger, ILaborCostStorage laborCostsStorage)
|
||||
public LaborCostLogic(ILogger<LaborCostLogic> logger, ILaborCostStorage laborCostsStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_laborCostsStorage = laborCostsStorage;
|
119
BeautyStudio/BeautyStudioView/FormLogin.Designer.cs
generated
Normal file
119
BeautyStudio/BeautyStudioView/FormLogin.Designer.cs
generated
Normal file
@ -0,0 +1,119 @@
|
||||
namespace BeautyStudioView
|
||||
{
|
||||
partial class FormLogin
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelPassword = new Label();
|
||||
labelLogin = new Label();
|
||||
textBoxPassword = new TextBox();
|
||||
textBoxLogin = new TextBox();
|
||||
buttonReg = new Button();
|
||||
buttonLogin = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelPassword
|
||||
//
|
||||
labelPassword.AutoSize = true;
|
||||
labelPassword.Location = new Point(23, 51);
|
||||
labelPassword.Name = "labelPassword";
|
||||
labelPassword.Size = new Size(52, 15);
|
||||
labelPassword.TabIndex = 22;
|
||||
labelPassword.Text = "Пароль:";
|
||||
//
|
||||
// labelLogin
|
||||
//
|
||||
labelLogin.AutoSize = true;
|
||||
labelLogin.Location = new Point(23, 15);
|
||||
labelLogin.Name = "labelLogin";
|
||||
labelLogin.Size = new Size(44, 15);
|
||||
labelLogin.TabIndex = 20;
|
||||
labelLogin.Text = "Логин:";
|
||||
//
|
||||
// textBoxPassword
|
||||
//
|
||||
textBoxPassword.Location = new Point(98, 48);
|
||||
textBoxPassword.Name = "textBoxPassword";
|
||||
textBoxPassword.PasswordChar = '*';
|
||||
textBoxPassword.Size = new Size(301, 23);
|
||||
textBoxPassword.TabIndex = 19;
|
||||
//
|
||||
// textBoxLogin
|
||||
//
|
||||
textBoxLogin.Location = new Point(98, 12);
|
||||
textBoxLogin.Name = "textBoxLogin";
|
||||
textBoxLogin.Size = new Size(301, 23);
|
||||
textBoxLogin.TabIndex = 17;
|
||||
//
|
||||
// buttonReg
|
||||
//
|
||||
buttonReg.Location = new Point(12, 131);
|
||||
buttonReg.Name = "buttonReg";
|
||||
buttonReg.Size = new Size(129, 23);
|
||||
buttonReg.TabIndex = 15;
|
||||
buttonReg.Text = "Регистрация";
|
||||
buttonReg.UseVisualStyleBackColor = true;
|
||||
buttonReg.Click += RegButt_Click;
|
||||
//
|
||||
// buttonLogin
|
||||
//
|
||||
buttonLogin.Location = new Point(324, 131);
|
||||
buttonLogin.Name = "buttonLogin";
|
||||
buttonLogin.Size = new Size(75, 23);
|
||||
buttonLogin.TabIndex = 1;
|
||||
buttonLogin.Text = "Логин";
|
||||
buttonLogin.UseVisualStyleBackColor = true;
|
||||
buttonLogin.Click += ButtonLogin_Click;
|
||||
//
|
||||
// FormLogin
|
||||
//
|
||||
AcceptButton = buttonLogin;
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(413, 168);
|
||||
Controls.Add(buttonLogin);
|
||||
Controls.Add(labelPassword);
|
||||
Controls.Add(labelLogin);
|
||||
Controls.Add(textBoxPassword);
|
||||
Controls.Add(textBoxLogin);
|
||||
Controls.Add(buttonReg);
|
||||
Name = "FormLogin";
|
||||
Text = "Логин";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelPassword;
|
||||
private Label labelLogin;
|
||||
private TextBox textBoxPassword;
|
||||
private TextBox textBoxLogin;
|
||||
private Button buttonReg;
|
||||
private Button buttonLogin;
|
||||
}
|
||||
}
|
57
BeautyStudio/BeautyStudioView/FormLogin.cs
Normal file
57
BeautyStudio/BeautyStudioView/FormLogin.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using BeautyStudioContracts.BusinessLogicContracts;
|
||||
using BeautyStudioContracts.SearchModels;
|
||||
using BeautyStudioContracts.ViewModels;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BeautyStudioView
|
||||
{
|
||||
public partial class FormLogin : Form
|
||||
{
|
||||
private readonly IStoreKeeperLogic _storekeeperLogic;
|
||||
|
||||
public StoreKeeperViewModel? LoggedInStoreKeeper { get; private set; }
|
||||
|
||||
public FormLogin(IStoreKeeperLogic storekeeperLogic)
|
||||
{
|
||||
InitializeComponent();
|
||||
_storekeeperLogic = storekeeperLogic;
|
||||
}
|
||||
|
||||
private void ButtonLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
var storekeeper = _storekeeperLogic.ReadElement(new StoreKeeperSearchModel
|
||||
{
|
||||
StoreKeeperLogin = textBoxLogin.Text,
|
||||
StoreKeeperPassword = textBoxPassword.Text
|
||||
});
|
||||
|
||||
if (storekeeper != null)
|
||||
{
|
||||
LoggedInStoreKeeper = storekeeper;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Неверный логин или пароль", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
private void RegButt_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormRegister));
|
||||
if (service is FormRegister form)
|
||||
{
|
||||
form.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
BeautyStudio/BeautyStudioView/FormLogin.resx
Normal file
120
BeautyStudio/BeautyStudioView/FormLogin.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
184
BeautyStudio/BeautyStudioView/FormRegister.Designer.cs
generated
Normal file
184
BeautyStudio/BeautyStudioView/FormRegister.Designer.cs
generated
Normal file
@ -0,0 +1,184 @@
|
||||
namespace BeautyStudioView
|
||||
{
|
||||
partial class FormRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
buttonReg = new Button();
|
||||
buttonBack = new Button();
|
||||
textBoxLogin = new TextBox();
|
||||
textBoxEmail = new TextBox();
|
||||
textBoxPassword = new TextBox();
|
||||
labelLogin = new Label();
|
||||
labelEmail = new Label();
|
||||
labelPassword = new Label();
|
||||
labelPhone = new Label();
|
||||
textBoxPhone = new TextBox();
|
||||
labelFIO = new Label();
|
||||
textBoxFIO = new TextBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonReg
|
||||
//
|
||||
buttonReg.Location = new Point(119, 176);
|
||||
buttonReg.Name = "buttonReg";
|
||||
buttonReg.Size = new Size(129, 23);
|
||||
buttonReg.TabIndex = 7;
|
||||
buttonReg.Text = "Зарегистрироваться";
|
||||
buttonReg.UseVisualStyleBackColor = true;
|
||||
buttonReg.Click += ButtonRegister_Click;
|
||||
//
|
||||
// buttonBack
|
||||
//
|
||||
buttonBack.Location = new Point(254, 176);
|
||||
buttonBack.Name = "buttonBack";
|
||||
buttonBack.Size = new Size(75, 23);
|
||||
buttonBack.TabIndex = 8;
|
||||
buttonBack.Text = "Назад";
|
||||
buttonBack.UseVisualStyleBackColor = true;
|
||||
buttonBack.Click += LoginButt_Click;
|
||||
//
|
||||
// textBoxLogin
|
||||
//
|
||||
textBoxLogin.Location = new Point(94, 74);
|
||||
textBoxLogin.Name = "textBoxLogin";
|
||||
textBoxLogin.Size = new Size(235, 23);
|
||||
textBoxLogin.TabIndex = 9;
|
||||
//
|
||||
// textBoxEmail
|
||||
//
|
||||
textBoxEmail.Location = new Point(94, 103);
|
||||
textBoxEmail.Name = "textBoxEmail";
|
||||
textBoxEmail.Size = new Size(235, 23);
|
||||
textBoxEmail.TabIndex = 10;
|
||||
//
|
||||
// textBoxPassword
|
||||
//
|
||||
textBoxPassword.Location = new Point(94, 132);
|
||||
textBoxPassword.Name = "textBoxPassword";
|
||||
textBoxPassword.Size = new Size(235, 23);
|
||||
textBoxPassword.TabIndex = 11;
|
||||
//
|
||||
// labelLogin
|
||||
//
|
||||
labelLogin.AutoSize = true;
|
||||
labelLogin.Location = new Point(19, 77);
|
||||
labelLogin.Name = "labelLogin";
|
||||
labelLogin.Size = new Size(44, 15);
|
||||
labelLogin.TabIndex = 12;
|
||||
labelLogin.Text = "Логин:";
|
||||
//
|
||||
// labelEmail
|
||||
//
|
||||
labelEmail.AutoSize = true;
|
||||
labelEmail.Location = new Point(19, 106);
|
||||
labelEmail.Name = "labelEmail";
|
||||
labelEmail.Size = new Size(44, 15);
|
||||
labelEmail.TabIndex = 13;
|
||||
labelEmail.Text = "Почта:";
|
||||
//
|
||||
// labelPassword
|
||||
//
|
||||
labelPassword.AutoSize = true;
|
||||
labelPassword.Location = new Point(19, 135);
|
||||
labelPassword.Name = "labelPassword";
|
||||
labelPassword.Size = new Size(52, 15);
|
||||
labelPassword.TabIndex = 14;
|
||||
labelPassword.Text = "Пароль:";
|
||||
//
|
||||
// labelPhone
|
||||
//
|
||||
labelPhone.AutoSize = true;
|
||||
labelPhone.Location = new Point(19, 48);
|
||||
labelPhone.Name = "labelPhone";
|
||||
labelPhone.Size = new Size(104, 15);
|
||||
labelPhone.TabIndex = 16;
|
||||
labelPhone.Text = "Номер телефона:";
|
||||
//
|
||||
// textBoxPhone
|
||||
//
|
||||
textBoxPhone.Location = new Point(129, 45);
|
||||
textBoxPhone.Name = "textBoxPhone";
|
||||
textBoxPhone.Size = new Size(200, 23);
|
||||
textBoxPhone.TabIndex = 15;
|
||||
//
|
||||
// labelFIO
|
||||
//
|
||||
labelFIO.AutoSize = true;
|
||||
labelFIO.Location = new Point(19, 19);
|
||||
labelFIO.Name = "labelFIO";
|
||||
labelFIO.Size = new Size(37, 15);
|
||||
labelFIO.TabIndex = 18;
|
||||
labelFIO.Text = "ФИО:";
|
||||
//
|
||||
// textBoxFIO
|
||||
//
|
||||
textBoxFIO.Location = new Point(94, 16);
|
||||
textBoxFIO.Name = "textBoxFIO";
|
||||
textBoxFIO.Size = new Size(235, 23);
|
||||
textBoxFIO.TabIndex = 17;
|
||||
//
|
||||
// FormRegister
|
||||
//
|
||||
AcceptButton = buttonReg;
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(352, 209);
|
||||
Controls.Add(labelFIO);
|
||||
Controls.Add(textBoxFIO);
|
||||
Controls.Add(labelPhone);
|
||||
Controls.Add(textBoxPhone);
|
||||
Controls.Add(labelPassword);
|
||||
Controls.Add(labelEmail);
|
||||
Controls.Add(labelLogin);
|
||||
Controls.Add(textBoxPassword);
|
||||
Controls.Add(textBoxEmail);
|
||||
Controls.Add(textBoxLogin);
|
||||
Controls.Add(buttonBack);
|
||||
Controls.Add(buttonReg);
|
||||
Name = "FormRegister";
|
||||
Text = "Регистрация";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonReg;
|
||||
private Button buttonBack;
|
||||
private TextBox textBoxLogin;
|
||||
private TextBox textBoxEmail;
|
||||
private TextBox textBoxPassword;
|
||||
private Label labelLogin;
|
||||
private Label labelEmail;
|
||||
private Label labelPassword;
|
||||
private Label labelPhone;
|
||||
private TextBox textBoxPhone;
|
||||
private Label labelFIO;
|
||||
private TextBox textBoxFIO;
|
||||
}
|
||||
}
|
68
BeautyStudio/BeautyStudioView/FormRegister.cs
Normal file
68
BeautyStudio/BeautyStudioView/FormRegister.cs
Normal file
@ -0,0 +1,68 @@
|
||||
using BeautyStudioContracts.BindingModels;
|
||||
using BeautyStudioContracts.BusinessLogicContracts;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BeautyStudioView
|
||||
{
|
||||
public partial class FormRegister : Form
|
||||
{
|
||||
private readonly IStoreKeeperLogic _storekeeperLogic;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public FormRegister(IStoreKeeperLogic storekeeperLogic, ILogger<FormRegister> logger)
|
||||
{
|
||||
InitializeComponent();
|
||||
_storekeeperLogic = storekeeperLogic;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private void ButtonRegister_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(textBoxFIO.Text) || string.IsNullOrEmpty(textBoxPhone.Text) || string.IsNullOrEmpty(textBoxLogin.Text) || string.IsNullOrEmpty(textBoxPassword.Text) || string.IsNullOrEmpty(textBoxEmail.Text))
|
||||
{
|
||||
MessageBox.Show("Заполните все поля", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var model = new StoreKeeperBindingModel
|
||||
{
|
||||
StoreKeeperFIO = textBoxFIO.Text,
|
||||
StoreKeeperPhone = textBoxPhone.Text,
|
||||
StoreKeeperLogin = textBoxLogin.Text,
|
||||
StoreKeeperPassword = textBoxPassword.Text,
|
||||
StoreKeeperEmail = textBoxEmail.Text
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
if (_storekeeperLogic.Create(model))
|
||||
{
|
||||
MessageBox.Show("Регистрация прошла успешно", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Ошибка при регистрации", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка регистрации");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
private void LoginButt_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
120
BeautyStudio/BeautyStudioView/FormRegister.resx
Normal file
120
BeautyStudio/BeautyStudioView/FormRegister.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
@ -35,21 +35,28 @@ namespace BeautyStudioView
|
||||
option.SetMinimumLevel(LogLevel.Information);
|
||||
option.AddNLog("nlog.config");
|
||||
});
|
||||
//services.AddTransient<IComponentStorage, ComponentStorage>();
|
||||
//services.AddTransient<IComputerStorage, ComputerStorage>();
|
||||
//services.AddTransient<IOrderStorage, OrderStorage>();
|
||||
services.AddTransient<ICosmeticStorage, CosmeticStorage>();
|
||||
services.AddTransient<ILaborCostStorage, LaborCostStorage>();
|
||||
services.AddTransient<IOrderStorage, OrderStorage>();
|
||||
services.AddTransient<IProcedureStorage, ProcedureStorage>();
|
||||
services.AddTransient<IServiceStorage, ServiceStorage>();
|
||||
services.AddTransient<IStoreKeeperStorage, StoreKeeperStorage>();
|
||||
|
||||
//services.AddTransient<IComponentLogic, ComponentLogic>();
|
||||
//services.AddTransient<IComputerLogic, ComputerLogic>();
|
||||
//services.AddTransient<IOrderLogic, OrderLogic>();
|
||||
services.AddTransient<ICosmeticLogic, CosmeticLogic>();
|
||||
services.AddTransient<ILaborCostLogic, LaborCostLogic>();
|
||||
services.AddTransient<IOrderLogic, OrderLogic>();
|
||||
services.AddTransient<IProcedureLogic, ProcedureLogic>();
|
||||
services.AddTransient<IServiceLogic, ServiceLogic>();
|
||||
services.AddTransient<IStoreKeeperLogic, StoreKeeperLogic>();
|
||||
//services.AddTransient<IReportLogic, ReportLogic>();
|
||||
//services.AddTransient<IWorkProcess, WorkModeling>();
|
||||
|
||||
////services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
||||
////services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
||||
////services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
||||
|
||||
//services.AddTransient<FormMain>();
|
||||
services.AddTransient<FormMain>();
|
||||
services.AddTransient<FormRegister>();
|
||||
services.AddTransient<FormLogin>();
|
||||
//services.AddTransient<FormCosmetics>();
|
||||
//services.AddTransient<FormCreateCosmetic>();
|
||||
//services.AddTransient<FormCreateOrder>();
|
||||
|
Loading…
Reference in New Issue
Block a user