добавила генерацию элементов таблиц и время в нано и милисекундах, все, спаит пора
This commit is contained in:
parent
9d73746078
commit
6fc117f2dd
34
BeautySalon/BeautySalon/FormCheques.Designer.cs
generated
34
BeautySalon/BeautySalon/FormCheques.Designer.cs
generated
@ -32,12 +32,15 @@
|
||||
dataGridView = new DataGridView();
|
||||
buttonUpdate = new Button();
|
||||
buttonCreate = new Button();
|
||||
numericUpDownSize = new NumericUpDown();
|
||||
buttonGenerated = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.Location = new Point(928, 352);
|
||||
buttonDelete.Location = new Point(928, 228);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(147, 56);
|
||||
buttonDelete.TabIndex = 13;
|
||||
@ -56,12 +59,12 @@
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(880, 450);
|
||||
dataGridView.Size = new Size(880, 516);
|
||||
dataGridView.TabIndex = 10;
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.Location = new Point(928, 190);
|
||||
buttonUpdate.Location = new Point(928, 135);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(147, 56);
|
||||
buttonUpdate.TabIndex = 15;
|
||||
@ -79,11 +82,31 @@
|
||||
buttonCreate.UseVisualStyleBackColor = true;
|
||||
buttonCreate.Click += buttonCreate_Click;
|
||||
//
|
||||
// numericUpDownSize
|
||||
//
|
||||
numericUpDownSize.Location = new Point(928, 363);
|
||||
numericUpDownSize.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
|
||||
numericUpDownSize.Name = "numericUpDownSize";
|
||||
numericUpDownSize.Size = new Size(147, 27);
|
||||
numericUpDownSize.TabIndex = 17;
|
||||
//
|
||||
// buttonGenerated
|
||||
//
|
||||
buttonGenerated.Location = new Point(928, 424);
|
||||
buttonGenerated.Name = "buttonGenerated";
|
||||
buttonGenerated.Size = new Size(147, 56);
|
||||
buttonGenerated.TabIndex = 16;
|
||||
buttonGenerated.Text = "Сгенерировать записи";
|
||||
buttonGenerated.UseVisualStyleBackColor = true;
|
||||
buttonGenerated.Click += buttonGenerated_Click;
|
||||
//
|
||||
// FormCheques
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1120, 450);
|
||||
ClientSize = new Size(1120, 516);
|
||||
Controls.Add(numericUpDownSize);
|
||||
Controls.Add(buttonGenerated);
|
||||
Controls.Add(buttonUpdate);
|
||||
Controls.Add(buttonCreate);
|
||||
Controls.Add(buttonDelete);
|
||||
@ -92,6 +115,7 @@
|
||||
Text = "Чеки";
|
||||
Load += FormCheques_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@ -101,5 +125,7 @@
|
||||
private DataGridView dataGridView;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonCreate;
|
||||
private NumericUpDown numericUpDownSize;
|
||||
private Button buttonGenerated;
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Implements;
|
||||
using BeautySalonDBModels.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
@ -98,5 +99,40 @@ namespace BeautySalon
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonGenerated_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = (int)numericUpDownSize.Value;
|
||||
int[] array = new int[size];
|
||||
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
chequeStorage.Add(new Cheque
|
||||
{
|
||||
MasterId = 33,
|
||||
ServiceId = 40,
|
||||
ClientId = i % 2 + 2,
|
||||
Price = i * 10,
|
||||
DateReception = DateTime.Now,
|
||||
});
|
||||
}
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Generate receptions", nano, sec);
|
||||
form.ShowDialog();
|
||||
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
@ -32,7 +33,15 @@ namespace BeautySalon
|
||||
FIO = textBoxFIO.Text,
|
||||
Age = (int)numericUpDownAge.Value,
|
||||
};
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
clientStorage.Update(newClient);
|
||||
sw.Stop();
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
FormTimeOperation form = new FormTimeOperation("Update", nano, sec);
|
||||
form.ShowDialog();
|
||||
if (form.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.OK; Close(); }
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -41,7 +50,15 @@ namespace BeautySalon
|
||||
FIO = textBoxFIO.Text,
|
||||
Age = (int)numericUpDownAge.Value,
|
||||
};
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
clientStorage.Add(newClient);
|
||||
sw.Stop();
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
FormTimeOperation form = new FormTimeOperation("Insert", nano, sec);
|
||||
form.ShowDialog();
|
||||
if (form.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.OK; Close(); }
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
36
BeautySalon/BeautySalon/FormClients.Designer.cs
generated
36
BeautySalon/BeautySalon/FormClients.Designer.cs
generated
@ -32,12 +32,15 @@
|
||||
buttonUpdate = new Button();
|
||||
buttonCreate = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
numericUpDownSize = new NumericUpDown();
|
||||
buttonGenerated = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.Location = new Point(480, 356);
|
||||
buttonDelete.Location = new Point(748, 227);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(147, 56);
|
||||
buttonDelete.TabIndex = 7;
|
||||
@ -47,7 +50,7 @@
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.Location = new Point(480, 186);
|
||||
buttonUpdate.Location = new Point(748, 131);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(147, 56);
|
||||
buttonUpdate.TabIndex = 6;
|
||||
@ -57,7 +60,7 @@
|
||||
//
|
||||
// buttonCreate
|
||||
//
|
||||
buttonCreate.Location = new Point(480, 25);
|
||||
buttonCreate.Location = new Point(748, 33);
|
||||
buttonCreate.Name = "buttonCreate";
|
||||
buttonCreate.Size = new Size(147, 56);
|
||||
buttonCreate.TabIndex = 5;
|
||||
@ -76,14 +79,34 @@
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(417, 450);
|
||||
dataGridView.Size = new Size(688, 514);
|
||||
dataGridView.TabIndex = 4;
|
||||
//
|
||||
// numericUpDownSize
|
||||
//
|
||||
numericUpDownSize.Location = new Point(748, 376);
|
||||
numericUpDownSize.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
|
||||
numericUpDownSize.Name = "numericUpDownSize";
|
||||
numericUpDownSize.Size = new Size(147, 27);
|
||||
numericUpDownSize.TabIndex = 15;
|
||||
//
|
||||
// buttonGenerated
|
||||
//
|
||||
buttonGenerated.Location = new Point(748, 437);
|
||||
buttonGenerated.Name = "buttonGenerated";
|
||||
buttonGenerated.Size = new Size(147, 56);
|
||||
buttonGenerated.TabIndex = 14;
|
||||
buttonGenerated.Text = "Сгенерировать записи";
|
||||
buttonGenerated.UseVisualStyleBackColor = true;
|
||||
buttonGenerated.Click += buttonGenerated_Click;
|
||||
//
|
||||
// FormClients
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(683, 450);
|
||||
ClientSize = new Size(952, 514);
|
||||
Controls.Add(numericUpDownSize);
|
||||
Controls.Add(buttonGenerated);
|
||||
Controls.Add(buttonDelete);
|
||||
Controls.Add(buttonUpdate);
|
||||
Controls.Add(buttonCreate);
|
||||
@ -92,6 +115,7 @@
|
||||
Text = "Клиенты";
|
||||
Load += FormClients_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@ -101,5 +125,7 @@
|
||||
private Button buttonUpdate;
|
||||
private Button buttonCreate;
|
||||
private DataGridView dataGridView;
|
||||
private NumericUpDown numericUpDownSize;
|
||||
private Button buttonGenerated;
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Models;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
@ -22,7 +24,15 @@ namespace BeautySalon
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
var list = clientStorage.GetObjects();
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("LoadData", nano, sec);
|
||||
form.ShowDialog();
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
dataGridView.DataSource = list;
|
||||
@ -70,10 +80,51 @@ namespace BeautySalon
|
||||
if(dataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["ClientId"].Value);
|
||||
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
clientStorage.Remove(id);
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Delete", nano, sec);
|
||||
form.ShowDialog();
|
||||
if (form.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.OK; Close(); }
|
||||
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonGenerated_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = (int)numericUpDownSize.Value;
|
||||
int[] array = new int[size];
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
clientStorage.Add(new Client
|
||||
{
|
||||
FIO = i.ToString(),
|
||||
Age = i,
|
||||
});
|
||||
}
|
||||
LoadData();
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Generate and loadData", nano, sec);
|
||||
form.ShowDialog();
|
||||
if (form.ShowDialog() == DialogResult.OK) { DialogResult = DialogResult.OK; Close(); }
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
8
BeautySalon/BeautySalon/FormMain.Designer.cs
generated
8
BeautySalon/BeautySalon/FormMain.Designer.cs
generated
@ -72,8 +72,8 @@
|
||||
// добавитьToolStripMenuItem1
|
||||
//
|
||||
добавитьToolStripMenuItem1.Name = "добавитьToolStripMenuItem1";
|
||||
добавитьToolStripMenuItem1.Size = new Size(83, 24);
|
||||
добавитьToolStripMenuItem1.Text = "Клиенты";
|
||||
добавитьToolStripMenuItem1.Size = new Size(169, 24);
|
||||
добавитьToolStripMenuItem1.Text = "Регистрация клиента";
|
||||
добавитьToolStripMenuItem1.Click += добавитьToolStripMenuItem1_Click;
|
||||
//
|
||||
// создатьПриемToolStripMenuItem
|
||||
@ -84,8 +84,8 @@
|
||||
// посмотретьЧекиToolStripMenuItem
|
||||
//
|
||||
посмотретьЧекиToolStripMenuItem.Name = "посмотретьЧекиToolStripMenuItem";
|
||||
посмотретьЧекиToolStripMenuItem.Size = new Size(57, 24);
|
||||
посмотретьЧекиToolStripMenuItem.Text = "Чеки";
|
||||
посмотретьЧекиToolStripMenuItem.Size = new Size(172, 24);
|
||||
посмотретьЧекиToolStripMenuItem.Text = "Запись на процедуру";
|
||||
посмотретьЧекиToolStripMenuItem.Click += посмотретьЧекиToolStripMenuItem_Click;
|
||||
//
|
||||
// FormMain
|
||||
|
30
BeautySalon/BeautySalon/FormMasters.Designer.cs
generated
30
BeautySalon/BeautySalon/FormMasters.Designer.cs
generated
@ -32,7 +32,10 @@
|
||||
buttonDelete = new Button();
|
||||
buttonUpdate = new Button();
|
||||
buttonCreate = new Button();
|
||||
numericUpDownSize = new NumericUpDown();
|
||||
buttonGenerated = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
@ -51,7 +54,7 @@
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.Location = new Point(604, 361);
|
||||
buttonDelete.Location = new Point(604, 215);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(147, 56);
|
||||
buttonDelete.TabIndex = 6;
|
||||
@ -61,7 +64,7 @@
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.Location = new Point(604, 191);
|
||||
buttonUpdate.Location = new Point(604, 122);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(147, 56);
|
||||
buttonUpdate.TabIndex = 5;
|
||||
@ -79,11 +82,31 @@
|
||||
buttonCreate.UseVisualStyleBackColor = true;
|
||||
buttonCreate.Click += buttonCreate_Click;
|
||||
//
|
||||
// numericUpDownSize
|
||||
//
|
||||
numericUpDownSize.Location = new Point(604, 310);
|
||||
numericUpDownSize.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
|
||||
numericUpDownSize.Name = "numericUpDownSize";
|
||||
numericUpDownSize.Size = new Size(147, 27);
|
||||
numericUpDownSize.TabIndex = 13;
|
||||
//
|
||||
// buttonGenerated
|
||||
//
|
||||
buttonGenerated.Location = new Point(604, 371);
|
||||
buttonGenerated.Name = "buttonGenerated";
|
||||
buttonGenerated.Size = new Size(147, 56);
|
||||
buttonGenerated.TabIndex = 12;
|
||||
buttonGenerated.Text = "Сгенерировать записи";
|
||||
buttonGenerated.UseVisualStyleBackColor = true;
|
||||
buttonGenerated.Click += buttonGenerated_Click;
|
||||
//
|
||||
// FormMasters
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(numericUpDownSize);
|
||||
Controls.Add(buttonGenerated);
|
||||
Controls.Add(buttonDelete);
|
||||
Controls.Add(buttonUpdate);
|
||||
Controls.Add(buttonCreate);
|
||||
@ -92,6 +115,7 @@
|
||||
Text = "Мастера";
|
||||
Load += FormMasters_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@ -101,5 +125,7 @@
|
||||
private Button buttonDelete;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonCreate;
|
||||
private NumericUpDown numericUpDownSize;
|
||||
private Button buttonGenerated;
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Implements;
|
||||
using BeautySalonDBModels.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
@ -86,5 +87,35 @@ namespace BeautySalon
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void buttonGenerated_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = (int)numericUpDownSize.Value;
|
||||
int[] array = new int[size];
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
masterDb.Add(new Master
|
||||
{
|
||||
FIO = i.ToString(),
|
||||
SpecialisationId = 15,
|
||||
});
|
||||
}
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Generate masters", nano, sec);
|
||||
form.ShowDialog();
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
BeautySalon/BeautySalon/FormServices.Designer.cs
generated
30
BeautySalon/BeautySalon/FormServices.Designer.cs
generated
@ -32,7 +32,10 @@
|
||||
buttonDelete = new Button();
|
||||
buttonUpdate = new Button();
|
||||
buttonCreate = new Button();
|
||||
numericUpDownSize = new NumericUpDown();
|
||||
buttonGenerated = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
@ -51,7 +54,7 @@
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.Location = new Point(553, 365);
|
||||
buttonDelete.Location = new Point(553, 224);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(147, 56);
|
||||
buttonDelete.TabIndex = 9;
|
||||
@ -61,7 +64,7 @@
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.Location = new Point(553, 195);
|
||||
buttonUpdate.Location = new Point(553, 127);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(147, 56);
|
||||
buttonUpdate.TabIndex = 8;
|
||||
@ -79,11 +82,31 @@
|
||||
buttonCreate.UseVisualStyleBackColor = true;
|
||||
buttonCreate.Click += buttonCreate_Click;
|
||||
//
|
||||
// numericUpDownSize
|
||||
//
|
||||
numericUpDownSize.Location = new Point(553, 311);
|
||||
numericUpDownSize.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
|
||||
numericUpDownSize.Name = "numericUpDownSize";
|
||||
numericUpDownSize.Size = new Size(147, 27);
|
||||
numericUpDownSize.TabIndex = 11;
|
||||
//
|
||||
// buttonGenerated
|
||||
//
|
||||
buttonGenerated.Location = new Point(553, 372);
|
||||
buttonGenerated.Name = "buttonGenerated";
|
||||
buttonGenerated.Size = new Size(147, 56);
|
||||
buttonGenerated.TabIndex = 10;
|
||||
buttonGenerated.Text = "Сгенерировать записи";
|
||||
buttonGenerated.UseVisualStyleBackColor = true;
|
||||
buttonGenerated.Click += buttonGenerated_Click;
|
||||
//
|
||||
// FormServices
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(752, 450);
|
||||
Controls.Add(numericUpDownSize);
|
||||
Controls.Add(buttonGenerated);
|
||||
Controls.Add(buttonDelete);
|
||||
Controls.Add(buttonUpdate);
|
||||
Controls.Add(buttonCreate);
|
||||
@ -92,6 +115,7 @@
|
||||
Text = "Услуги";
|
||||
Load += FormServices_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@ -101,5 +125,7 @@
|
||||
private Button buttonDelete;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonCreate;
|
||||
private NumericUpDown numericUpDownSize;
|
||||
private Button buttonGenerated;
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using BeautySalonDBModels.Models;
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Implements;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
@ -85,5 +86,38 @@ namespace BeautySalon
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void buttonGenerated_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = (int)numericUpDownSize.Value;
|
||||
int[] array = new int[size];
|
||||
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
serviceStorage.Add(new Service
|
||||
{
|
||||
ServiceName = i.ToString(),
|
||||
SpecialisationId = 14,
|
||||
Price = i * 10
|
||||
}) ;
|
||||
}
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Generate services", nano, sec);
|
||||
form.ShowDialog();
|
||||
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,10 @@
|
||||
buttonCreate = new Button();
|
||||
buttonDelete = new Button();
|
||||
buttonUpdate = new Button();
|
||||
buttonGenerated = new Button();
|
||||
numericUpDownSize = new NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
@ -46,7 +49,7 @@
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(417, 450);
|
||||
dataGridView.Size = new Size(417, 466);
|
||||
dataGridView.TabIndex = 0;
|
||||
//
|
||||
// buttonCreate
|
||||
@ -61,7 +64,7 @@
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.Location = new Point(476, 362);
|
||||
buttonDelete.Location = new Point(476, 212);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(147, 56);
|
||||
buttonDelete.TabIndex = 3;
|
||||
@ -71,7 +74,7 @@
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.Location = new Point(476, 192);
|
||||
buttonUpdate.Location = new Point(476, 121);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(147, 56);
|
||||
buttonUpdate.TabIndex = 2;
|
||||
@ -79,11 +82,31 @@
|
||||
buttonUpdate.UseVisualStyleBackColor = true;
|
||||
buttonUpdate.Click += buttonUpdate_Click;
|
||||
//
|
||||
// buttonGenerated
|
||||
//
|
||||
buttonGenerated.Location = new Point(476, 382);
|
||||
buttonGenerated.Name = "buttonGenerated";
|
||||
buttonGenerated.Size = new Size(147, 56);
|
||||
buttonGenerated.TabIndex = 4;
|
||||
buttonGenerated.Text = "Сгенерировать записи";
|
||||
buttonGenerated.UseVisualStyleBackColor = true;
|
||||
buttonGenerated.Click += buttonGenerated_Click;
|
||||
//
|
||||
// numericUpDownSize
|
||||
//
|
||||
numericUpDownSize.Location = new Point(476, 321);
|
||||
numericUpDownSize.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 });
|
||||
numericUpDownSize.Name = "numericUpDownSize";
|
||||
numericUpDownSize.Size = new Size(147, 27);
|
||||
numericUpDownSize.TabIndex = 5;
|
||||
//
|
||||
// FormSpecialisations
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(678, 450);
|
||||
ClientSize = new Size(678, 466);
|
||||
Controls.Add(numericUpDownSize);
|
||||
Controls.Add(buttonGenerated);
|
||||
Controls.Add(buttonDelete);
|
||||
Controls.Add(buttonUpdate);
|
||||
Controls.Add(buttonCreate);
|
||||
@ -92,6 +115,7 @@
|
||||
Text = "Специализации";
|
||||
Load += FormSpecialisations_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownSize).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@ -101,5 +125,7 @@
|
||||
private Button buttonCreate;
|
||||
private Button buttonDelete;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonGenerated;
|
||||
private NumericUpDown numericUpDownSize;
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
using BeautySalonDBModels;
|
||||
using BeautySalonDBModels.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeautySalon
|
||||
{
|
||||
public partial class FormSpecialisations : Form
|
||||
{
|
||||
|
||||
private int? _id;
|
||||
public int Id
|
||||
{
|
||||
@ -72,5 +72,36 @@ namespace BeautySalon
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonGenerated_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int size = (int)numericUpDownSize.Value;
|
||||
int[] array = new int[size];
|
||||
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
for(int i = 0; i < array.Length; i++)
|
||||
{
|
||||
specialisationDB.Add(new Specialisation
|
||||
{
|
||||
Name = i.ToString(),
|
||||
});
|
||||
}
|
||||
sw.Stop();
|
||||
long sec = sw.ElapsedMilliseconds;
|
||||
long nano = sw.ElapsedTicks * 1000000000L / Stopwatch.Frequency;
|
||||
FormTimeOperation form = new FormTimeOperation("Generate specialisations", nano, sec);
|
||||
form.ShowDialog();
|
||||
|
||||
LoadData();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
58
BeautySalon/BeautySalon/FormTimeOperation.Designer.cs
generated
Normal file
58
BeautySalon/BeautySalon/FormTimeOperation.Designer.cs
generated
Normal file
@ -0,0 +1,58 @@
|
||||
namespace BeautySalon
|
||||
{
|
||||
partial class FormTimeOperation
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
labelTimeOperation = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelTimeOperation
|
||||
//
|
||||
labelTimeOperation.AutoSize = true;
|
||||
labelTimeOperation.Location = new Point(14, 9);
|
||||
labelTimeOperation.Name = "labelTimeOperation";
|
||||
labelTimeOperation.Size = new Size(28, 20);
|
||||
labelTimeOperation.TabIndex = 1;
|
||||
labelTimeOperation.Text = "0,0";
|
||||
//
|
||||
// FormTimeOperation
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(562, 178);
|
||||
Controls.Add(labelTimeOperation);
|
||||
Name = "FormTimeOperation";
|
||||
Text = "Время выполнения";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label labelTimeOperation;
|
||||
}
|
||||
}
|
21
BeautySalon/BeautySalon/FormTimeOperation.cs
Normal file
21
BeautySalon/BeautySalon/FormTimeOperation.cs
Normal file
@ -0,0 +1,21 @@
|
||||
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 BeautySalon
|
||||
{
|
||||
public partial class FormTimeOperation : Form
|
||||
{
|
||||
public FormTimeOperation(string operation, long nano, long sec)
|
||||
{
|
||||
InitializeComponent();
|
||||
labelTimeOperation.Text = $"Время выполнения операции {operation} \nсоставило '{nano}'\nнаносекунд\nи '{sec}' милисекунд";
|
||||
}
|
||||
}
|
||||
}
|
120
BeautySalon/BeautySalon/FormTimeOperation.resx
Normal file
120
BeautySalon/BeautySalon/FormTimeOperation.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>
|
@ -63,6 +63,8 @@ namespace BeautySalon
|
||||
|
||||
services.AddTransient<FormServices>();
|
||||
services.AddTransient<FormService>();
|
||||
|
||||
services.AddTransient<FormTimeOperation>();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user