Работающие тесты?
This commit is contained in:
parent
1d8fc2ccac
commit
526bd53521
@ -159,7 +159,7 @@ public partial class NewdbContext : DbContext
|
|||||||
.HasComment("Уникальный идентификатор")
|
.HasComment("Уникальный идентификатор")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
entity.Property(e => e.Name)
|
entity.Property(e => e.Name)
|
||||||
.HasMaxLength(40)
|
.HasMaxLength(100)
|
||||||
.HasComment("Название")
|
.HasComment("Название")
|
||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
entity.Property(e => e.Price)
|
entity.Property(e => e.Price)
|
||||||
|
16
BeautySaloon/BeautySaloonView/FormMain.Designer.cs
generated
16
BeautySaloon/BeautySaloonView/FormMain.Designer.cs
generated
@ -36,6 +36,7 @@
|
|||||||
this.сотрудникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.сотрудникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.buttonUpdate = new System.Windows.Forms.Button();
|
this.buttonUpdate = new System.Windows.Forms.Button();
|
||||||
|
this.buttonTest = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@ -103,7 +104,7 @@
|
|||||||
//
|
//
|
||||||
// buttonUpdate
|
// buttonUpdate
|
||||||
//
|
//
|
||||||
this.buttonUpdate.Location = new System.Drawing.Point(917, 241);
|
this.buttonUpdate.Location = new System.Drawing.Point(917, 225);
|
||||||
this.buttonUpdate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
this.buttonUpdate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
this.buttonUpdate.Name = "buttonUpdate";
|
this.buttonUpdate.Name = "buttonUpdate";
|
||||||
this.buttonUpdate.Size = new System.Drawing.Size(116, 58);
|
this.buttonUpdate.Size = new System.Drawing.Size(116, 58);
|
||||||
@ -112,11 +113,23 @@
|
|||||||
this.buttonUpdate.UseVisualStyleBackColor = true;
|
this.buttonUpdate.UseVisualStyleBackColor = true;
|
||||||
this.buttonUpdate.Click += new System.EventHandler(this.ButtonRef_Click);
|
this.buttonUpdate.Click += new System.EventHandler(this.ButtonRef_Click);
|
||||||
//
|
//
|
||||||
|
// buttonTest
|
||||||
|
//
|
||||||
|
this.buttonTest.Location = new System.Drawing.Point(917, 287);
|
||||||
|
this.buttonTest.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.buttonTest.Name = "buttonTest";
|
||||||
|
this.buttonTest.Size = new System.Drawing.Size(116, 58);
|
||||||
|
this.buttonTest.TabIndex = 18;
|
||||||
|
this.buttonTest.Text = "Тесты";
|
||||||
|
this.buttonTest.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonTest.Click += new System.EventHandler(this.ButtonTest_Click);
|
||||||
|
//
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(1037, 539);
|
this.ClientSize = new System.Drawing.Size(1037, 539);
|
||||||
|
this.Controls.Add(this.buttonTest);
|
||||||
this.Controls.Add(this.buttonUpdate);
|
this.Controls.Add(this.buttonUpdate);
|
||||||
this.Controls.Add(this.dataGridView);
|
this.Controls.Add(this.dataGridView);
|
||||||
this.Controls.Add(this.menuStrip1);
|
this.Controls.Add(this.menuStrip1);
|
||||||
@ -143,5 +156,6 @@
|
|||||||
private ToolStripMenuItem клиентыToolStripMenuItem;
|
private ToolStripMenuItem клиентыToolStripMenuItem;
|
||||||
private Button buttonUpdate;
|
private Button buttonUpdate;
|
||||||
private Button buttonCreateOrder;
|
private Button buttonCreateOrder;
|
||||||
|
private Button buttonTest;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -72,5 +72,14 @@ namespace BeautySaloonView
|
|||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonTest_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormTest));
|
||||||
|
if (service is FormTest form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
153
BeautySaloon/BeautySaloonView/FormTest.Designer.cs
generated
Normal file
153
BeautySaloon/BeautySaloonView/FormTest.Designer.cs
generated
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
namespace BeautySaloonView
|
||||||
|
{
|
||||||
|
partial class FormTest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.buttonAdd = new System.Windows.Forms.Button();
|
||||||
|
this.comboBoxWhat = new System.Windows.Forms.ComboBox();
|
||||||
|
this.textBoxCount = new System.Windows.Forms.TextBox();
|
||||||
|
this.comboBoxQuery = new System.Windows.Forms.ComboBox();
|
||||||
|
this.labelQuery = new System.Windows.Forms.Label();
|
||||||
|
this.labelWhat = new System.Windows.Forms.Label();
|
||||||
|
this.labelCount = new System.Windows.Forms.Label();
|
||||||
|
this.label = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
this.buttonAdd.Location = new System.Drawing.Point(119, 95);
|
||||||
|
this.buttonAdd.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.buttonAdd.Name = "buttonAdd";
|
||||||
|
this.buttonAdd.Size = new System.Drawing.Size(82, 22);
|
||||||
|
this.buttonAdd.TabIndex = 0;
|
||||||
|
this.buttonAdd.Text = "Добавить";
|
||||||
|
this.buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonAdd.Click += new System.EventHandler(this.ButtonAdd_Click);
|
||||||
|
//
|
||||||
|
// comboBoxWhat
|
||||||
|
//
|
||||||
|
this.comboBoxWhat.FormattingEnabled = true;
|
||||||
|
this.comboBoxWhat.Items.AddRange(new object[] {
|
||||||
|
"Сотрудники",
|
||||||
|
"Клиенты",
|
||||||
|
"Заказы"});
|
||||||
|
this.comboBoxWhat.Location = new System.Drawing.Point(68, 31);
|
||||||
|
this.comboBoxWhat.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.comboBoxWhat.Name = "comboBoxWhat";
|
||||||
|
this.comboBoxWhat.Size = new System.Drawing.Size(133, 23);
|
||||||
|
this.comboBoxWhat.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// textBoxCount
|
||||||
|
//
|
||||||
|
this.textBoxCount.Location = new System.Drawing.Point(68, 6);
|
||||||
|
this.textBoxCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.textBoxCount.Name = "textBoxCount";
|
||||||
|
this.textBoxCount.Size = new System.Drawing.Size(133, 23);
|
||||||
|
this.textBoxCount.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// comboBoxQuery
|
||||||
|
//
|
||||||
|
this.comboBoxQuery.FormattingEnabled = true;
|
||||||
|
this.comboBoxQuery.Items.AddRange(new object[] {
|
||||||
|
"Добавить",
|
||||||
|
"Выбрать"});
|
||||||
|
this.comboBoxQuery.Location = new System.Drawing.Point(68, 56);
|
||||||
|
this.comboBoxQuery.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.comboBoxQuery.Name = "comboBoxQuery";
|
||||||
|
this.comboBoxQuery.Size = new System.Drawing.Size(133, 23);
|
||||||
|
this.comboBoxQuery.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// labelQuery
|
||||||
|
//
|
||||||
|
this.labelQuery.AutoSize = true;
|
||||||
|
this.labelQuery.Location = new System.Drawing.Point(10, 59);
|
||||||
|
this.labelQuery.Name = "labelQuery";
|
||||||
|
this.labelQuery.Size = new System.Drawing.Size(47, 15);
|
||||||
|
this.labelQuery.TabIndex = 5;
|
||||||
|
this.labelQuery.Text = "Запрос";
|
||||||
|
//
|
||||||
|
// labelWhat
|
||||||
|
//
|
||||||
|
this.labelWhat.AutoSize = true;
|
||||||
|
this.labelWhat.Location = new System.Drawing.Point(10, 34);
|
||||||
|
this.labelWhat.Name = "labelWhat";
|
||||||
|
this.labelWhat.Size = new System.Drawing.Size(27, 15);
|
||||||
|
this.labelWhat.TabIndex = 6;
|
||||||
|
this.labelWhat.Text = "Что";
|
||||||
|
//
|
||||||
|
// labelCount
|
||||||
|
//
|
||||||
|
this.labelCount.AutoSize = true;
|
||||||
|
this.labelCount.Location = new System.Drawing.Point(10, 9);
|
||||||
|
this.labelCount.Name = "labelCount";
|
||||||
|
this.labelCount.Size = new System.Drawing.Size(46, 15);
|
||||||
|
this.labelCount.TabIndex = 7;
|
||||||
|
this.labelCount.Text = "Кол-во";
|
||||||
|
//
|
||||||
|
// label
|
||||||
|
//
|
||||||
|
this.label.AutoSize = true;
|
||||||
|
this.label.Location = new System.Drawing.Point(12, 95);
|
||||||
|
this.label.Name = "label";
|
||||||
|
this.label.Size = new System.Drawing.Size(51, 15);
|
||||||
|
this.label.TabIndex = 8;
|
||||||
|
this.label.Text = "Время...";
|
||||||
|
//
|
||||||
|
// FormTest
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(209, 137);
|
||||||
|
this.Controls.Add(this.label);
|
||||||
|
this.Controls.Add(this.labelCount);
|
||||||
|
this.Controls.Add(this.labelWhat);
|
||||||
|
this.Controls.Add(this.labelQuery);
|
||||||
|
this.Controls.Add(this.comboBoxQuery);
|
||||||
|
this.Controls.Add(this.textBoxCount);
|
||||||
|
this.Controls.Add(this.comboBoxWhat);
|
||||||
|
this.Controls.Add(this.buttonAdd);
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.Name = "FormTest";
|
||||||
|
this.Text = "FormTest";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Button buttonAdd;
|
||||||
|
private ComboBox comboBoxWhat;
|
||||||
|
private TextBox textBoxCount;
|
||||||
|
private ComboBox comboBoxQuery;
|
||||||
|
private Label labelQuery;
|
||||||
|
private Label labelWhat;
|
||||||
|
private Label labelCount;
|
||||||
|
private Label label;
|
||||||
|
}
|
||||||
|
}
|
216
BeautySaloon/BeautySaloonView/FormTest.cs
Normal file
216
BeautySaloon/BeautySaloonView/FormTest.cs
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
using BeautySaloonContracts.BindingModels;
|
||||||
|
using BeautySaloonContracts.BusinessLogicsContracts;
|
||||||
|
using BeautySaloonContracts.SearchModels;
|
||||||
|
using BeautySaloonContracts.ViewModels;
|
||||||
|
using BeautySaloonDataModels;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace BeautySaloonView
|
||||||
|
{
|
||||||
|
public partial class FormTest : Form
|
||||||
|
{
|
||||||
|
private readonly IServiceLogic _SLogic;
|
||||||
|
private readonly IPositionLogic _PLogic;
|
||||||
|
private readonly IEmployeeLogic _ELogic;
|
||||||
|
private readonly IClientLogic _CLogic;
|
||||||
|
private readonly IOrderLogic _OLogic;
|
||||||
|
private readonly List<ServiceViewModel>? SList;
|
||||||
|
private readonly List<PositionViewModel>? PList;
|
||||||
|
private List<EmployeeViewModel>? EList;
|
||||||
|
private List<ClientViewModel>? CList;
|
||||||
|
private List<OrderViewModel>? OList;
|
||||||
|
public FormTest(IServiceLogic serviceLogic, IPositionLogic positionLogic,
|
||||||
|
IEmployeeLogic employeeLogic,
|
||||||
|
IClientLogic clientLogic, IOrderLogic orderLogic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_SLogic = serviceLogic;
|
||||||
|
_PLogic = positionLogic;
|
||||||
|
_ELogic = employeeLogic;
|
||||||
|
_CLogic = clientLogic;
|
||||||
|
_OLogic = orderLogic;
|
||||||
|
SList = _SLogic.ReadList(null);
|
||||||
|
PList = _PLogic.ReadList(null);
|
||||||
|
}
|
||||||
|
string[] names = new string[] { "Захар", "Ева", "Сергей", "Максим", "Максимильян", "Лука", "Олег", "Мишель", "София", "Стела", "Аким", "Матвей", "Анисия", "Василий", "Лукьян", "Руслан", "Клара", "Андрей", "Мстислав", "Федот", "Олег", "Аркадий", "Ангелина", "Анжелика", "Стефания", "Мариам", "Дементий", "Андрон", "Даниил", "Адам", "Евдоким", "Валерий", "Дамир", "Фёдор", "Василиса", "Сафина", "Даниэль", "Дарина", "Мир", "Феофан", "Всеслава", "Инна", "Платон", "Ирина", "Рафаэль", "Милана", "Клавдий", "Лейла", "Роза", "Тимофей", "Пимен", "Модест", "Эмма", "Георгий", "Дарья", "Дмитрий", "Эрик", "Филипп", "Владилен", "Евсей", "Даниль", "Ростислав", "Тихон", "Тея", "Наум", "Виолетта", "Анатолий", "Рустам", "Юлия", "Дана", "Самсон", "Ариадна", "Ибрагим", "Светлана", "Инга", "Али", "Виталий", "Алисия", "Оксана", "Тимур", "Аида", "Камиль", "Иннокентий", "Элина", "Виктория", "Анна", "Амелия", "Япсина", "Эвелина", "Кира", "Артур", "Владлена", "Никифор", "Марина", "Артем", "Моисей", "Иван", "Лидия", "Трофим", "Игорь" };
|
||||||
|
string[] surnames = new string[] { "Пищальников", "Яхонтов", "Кочетов", "Ермилова", "Разбойникова", "Окулова", "Дудинова", "Добрынина", "Кучава", "Лазарев", "Егорова", "Ипатьев", "Байдавлетов", "Шалаганов", "Масмехов", "Шентеряков", "Юдачёв", "Дагина", "Лавлинский", "Гунин", "Яшвили", "Шуршалина", "Сомкина", "Бояринов", "Коленко", "Меншикова", "Бойков", "Ябловский", "Любова", "Ямпольский", "Фанина", "Молчанова", "Верещагин", "Окладников", "Чичерина", "Ключников", "Барышев", "Вятт", "Толбугин", "Радченко", "Веселкова", "Щавлева", "Слепынина", "Садков", "Барышников", "Бенедиктов", "Графова", "Мирнова", "Васильев", "Никишина", "Краснов", "Набатников", "Пронин", "Стрельцов", "Булка", "Саврасова", "Элиашева", "Канаев", "Кичеева", "Портнова", "Машарин", "Ларина", "Курганова", "Лапаева", "Яшуков", "Шлыков", "Арнаутова", "Ширяев", "Зуев", "Синдеева", "Трутнев", "Кошечкин", "Логинов", "Колпаков", "Бендлина", "Мурзакова", "Витинский", "Ратаева", "Щедрин", "Овощников", "Язвецова", "Крупин", "Седельников", "Юхтрица", "Лыков", "Смешной", "Пожарский", "Мичуев", "Шлиппенбах", "Татаринов", "Янютин", "Кулагина", "Семёнов", "Зверева", "Ивакин", "Бабинова", "Цейдлерин", "Сагадиев", "Истлентьев", "Деменока" };
|
||||||
|
string[] patronymics = new string[] { "Владимирович(на)", "Олегович(на)", "Александрович(на)", "Алексеевич(на)", "Генадьевич(на)", "Максимович(на)", "Павлович(на)", "Акимович(на)", "Лукьянович(на)", "Матвеевич(на)", "Адреевич(на)", "Федотович(на)", "Аркадий(на)", "Мстиславович(на)", "Федотович(на)", "Даниилович(на)", "Никитьевич(на)", "Евдокимович(на)", "Валерьевич(на)", "Дамирович(на)", "Клавдьевич(на)", "Мирович(на)", "Миронович(на)", "Платонович(на)", "Игоревич(на)", "Антонович(на)", "Валерьевич(на)", "Модестович(на)", "Тимофеевич(на)", "Владленович(на)", "Дмитриевич(на)", "Бенедиктович(на)", "Рустамович(на)", "Ростиславович(на)", "Николаевич(на)", "Данателович(на)", "Ибрагимович(на)", "Анатольевич(на)" };
|
||||||
|
string[] positions = new string[] { "Администратор","Продавец", "Парикмахер", "Мастер ногтевого сервиса", "Мастер по наращиванию ресниц", "Мастер депиляции", "Массажист", "Визажист", "Косметолог", "Мастер перманентного макияжа" };
|
||||||
|
string[] services = new string[] { "Свадебные и вечерние прически", "Завивка и выпрямление волос", "Кератиновое разглаживание", "Долговременная укладка", "Брондирование и колорирование", "Мелирование и блондирование", "Каутеризация", "Ламинирование волос", "Амбре-окрашивание", "Укладки и тонирование", "Цветовой дизайн волос", "Женская, мужская и детская стрижка", "Уход за волосами и лечение волос", "Наращивание и окраска волос", "Биопилинг кожи головы", "Плетение косичек", "Аппаратный", "Классический мужской и детский", "Европейский", "Долгосрочное покрытие гель-лаками(ши-лаками)", "Горячие обвертывания", "Наращивание и коррекция ногтей гелем", "Парафинотерапия", "Артдизайн", "Spa-маникюр", "Отбеливание", "Укрепление натуральных ногтей", "Уход за руками", "Массаж рук", "Лимфодренаж", "Cолярий", "Криодеструкция", "Микродермообразия", "Криотерапия" };
|
||||||
|
Random rd = new Random();
|
||||||
|
Random rand = new Random();
|
||||||
|
string GetRandomTelNo()
|
||||||
|
{
|
||||||
|
StringBuilder telNo = new StringBuilder(11);
|
||||||
|
int number;
|
||||||
|
telNo = telNo.Append('8');
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
number = rand.Next(1, 10);
|
||||||
|
telNo = telNo.Append(number.ToString());
|
||||||
|
}
|
||||||
|
return telNo.ToString();
|
||||||
|
}
|
||||||
|
DateTime RandomDate()
|
||||||
|
{
|
||||||
|
DateTime start = new DateTime(1970, 1, 1);
|
||||||
|
int range = (DateTime.Today - start).Days;
|
||||||
|
return start.AddDays(rd.Next(range)).AddHours(rd.Next(0,24)).AddMinutes(rd.Next(0,60));
|
||||||
|
}
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (SList?.Count == 0)
|
||||||
|
foreach (string service in services)
|
||||||
|
{
|
||||||
|
var model = new ServiceBindingModel
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Name = service,
|
||||||
|
Price = rd.Next(1, 10001)
|
||||||
|
};
|
||||||
|
_SLogic.Create(model);
|
||||||
|
}
|
||||||
|
if (PList?.Count == 0)
|
||||||
|
foreach (string pos in positions)
|
||||||
|
{
|
||||||
|
var model = new PositionBindingModel
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Name = pos
|
||||||
|
};
|
||||||
|
_PLogic.Create(model);
|
||||||
|
}
|
||||||
|
switch (comboBoxQuery.SelectedItem)
|
||||||
|
{
|
||||||
|
case "Добавить":
|
||||||
|
switch (comboBoxWhat.SelectedItem)
|
||||||
|
{
|
||||||
|
case "Сотрудники":
|
||||||
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
|
stopwatch.Start();
|
||||||
|
for (int i = 0; i < Convert.ToInt32(textBoxCount.Text); i++)
|
||||||
|
{
|
||||||
|
var model = new EmployeeBindingModel
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Name = names[rd.Next(0, names.Length - 1)],
|
||||||
|
Surname = surnames[rd.Next(0, surnames.Length - 1)],
|
||||||
|
Patronymic = patronymics[rd.Next(0, patronymics.Length - 1)],
|
||||||
|
Phone = GetRandomTelNo(),
|
||||||
|
PositionId = rd.Next(1, positions.Length)
|
||||||
|
};
|
||||||
|
_ELogic.Create(model);
|
||||||
|
}
|
||||||
|
stopwatch.Stop();
|
||||||
|
TimeSpan ts = stopwatch.Elapsed;
|
||||||
|
|
||||||
|
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts.Hours, ts.Minutes, ts.Seconds,
|
||||||
|
ts.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime);
|
||||||
|
break;
|
||||||
|
case "Клиенты":
|
||||||
|
Stopwatch stopwatch2 = new Stopwatch();
|
||||||
|
stopwatch2.Start();
|
||||||
|
for (int i = 0; i < Convert.ToInt32(textBoxCount.Text); i++)
|
||||||
|
{
|
||||||
|
var model = new ClientBindingModel
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Name = names[rd.Next(0, names.Length - 1)],
|
||||||
|
Surname = surnames[rd.Next(0, surnames.Length - 1)],
|
||||||
|
Patronymic = patronymics[rd.Next(0, patronymics.Length - 1)],
|
||||||
|
Phone = GetRandomTelNo()
|
||||||
|
};
|
||||||
|
_CLogic.Create(model);
|
||||||
|
}
|
||||||
|
stopwatch2.Stop();
|
||||||
|
TimeSpan ts1 = stopwatch2.Elapsed;
|
||||||
|
|
||||||
|
string elapsedTime1 = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts1.Hours, ts1.Minutes, ts1.Seconds,
|
||||||
|
ts1.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime1);
|
||||||
|
break;
|
||||||
|
case "Заказы":
|
||||||
|
|
||||||
|
EList = _ELogic.ReadList(null);
|
||||||
|
CList = _CLogic.ReadList(null);
|
||||||
|
OList = _OLogic.ReadList(null);
|
||||||
|
|
||||||
|
Stopwatch stopwatch1 = new Stopwatch();
|
||||||
|
stopwatch1.Start();
|
||||||
|
|
||||||
|
for (int i = 0; i < Convert.ToInt32(textBoxCount.Text); i++)
|
||||||
|
{
|
||||||
|
int random = rd.Next(1, 29);
|
||||||
|
var elem = _SLogic.ReadElement(new ServiceSearchModel() { Id = random }) as IServiceModel;
|
||||||
|
var model = new OrderBindingModel
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Date = DateOnly.FromDateTime(RandomDate()),
|
||||||
|
Sum = rd.Next(1,10001),
|
||||||
|
ClientId = CList?.ElementAt(rd.Next(1, CList.Count)).Id ?? 1,
|
||||||
|
EmployeeId = EList?.ElementAt(rd.Next(1, EList.Count)).Id ?? 1,
|
||||||
|
OrderServices = new() { { random,
|
||||||
|
(TimeOnly.FromDateTime(RandomDate()),
|
||||||
|
elem, EList?.ElementAt(rd.Next(1, EList.Count)).Id ?? 1) } }
|
||||||
|
};
|
||||||
|
_OLogic.CreateOrder(model);
|
||||||
|
}
|
||||||
|
stopwatch1.Stop();
|
||||||
|
TimeSpan ts2 = stopwatch1.Elapsed;
|
||||||
|
|
||||||
|
|
||||||
|
string elapsedTime2 = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts2.Hours, ts2.Minutes, ts2.Seconds,
|
||||||
|
ts2.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "Выбрать":
|
||||||
|
switch (comboBoxWhat.SelectedItem)
|
||||||
|
{
|
||||||
|
case "Сотрудники":
|
||||||
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
|
stopwatch.Start();
|
||||||
|
var list = _ELogic.ReadList(null);
|
||||||
|
stopwatch.Stop();
|
||||||
|
TimeSpan ts = stopwatch.Elapsed;
|
||||||
|
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts.Hours, ts.Minutes, ts.Seconds,
|
||||||
|
ts.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime);
|
||||||
|
break;
|
||||||
|
case "Клиенты":
|
||||||
|
Stopwatch stopwatch1 = new Stopwatch();
|
||||||
|
stopwatch1.Start();
|
||||||
|
var list1 = _CLogic.ReadList(null);
|
||||||
|
stopwatch1.Stop();
|
||||||
|
TimeSpan ts1 = stopwatch1.Elapsed;
|
||||||
|
string elapsedTime1 = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts1.Hours, ts1.Minutes, ts1.Seconds,
|
||||||
|
ts1.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime1);
|
||||||
|
break;
|
||||||
|
case "Заказы":
|
||||||
|
Stopwatch stopwatch2 = new Stopwatch();
|
||||||
|
stopwatch2.Start();
|
||||||
|
var list2 = _OLogic.ReadList(null);
|
||||||
|
stopwatch2.Stop();
|
||||||
|
TimeSpan ts2 = stopwatch2.Elapsed;
|
||||||
|
string elapsedTime2 = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
ts2.Hours, ts2.Minutes, ts2.Seconds,
|
||||||
|
ts2.Milliseconds / 10);
|
||||||
|
label.Text = ("Время: " + elapsedTime2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
BeautySaloon/BeautySaloonView/FormTest.resx
Normal file
60
BeautySaloon/BeautySaloonView/FormTest.resx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<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>
|
@ -53,6 +53,7 @@ namespace BeautySaloonView
|
|||||||
services.AddTransient<FormPositions>();
|
services.AddTransient<FormPositions>();
|
||||||
services.AddTransient<FormService>();
|
services.AddTransient<FormService>();
|
||||||
services.AddTransient<FormServices>();
|
services.AddTransient<FormServices>();
|
||||||
|
services.AddTransient<FormTest>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user