Compare commits
2 Commits
cd4ced4d54
...
7169347a45
Author | SHA1 | Date | |
---|---|---|---|
|
7169347a45 | ||
|
7a3359aecf |
@ -177,6 +177,14 @@ namespace PersonnelDepartmentDatabaseImplement.Implements
|
|||||||
{
|
{
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
using var context = new PersonnelDepartmentDatabase();
|
using var context = new PersonnelDepartmentDatabase();
|
||||||
|
var listDepartments = context.Departments.Select(x => x.GetViewModel).ToList();
|
||||||
|
var listEmployees = context.Employees.Select(x => x.GetViewModel).ToList();
|
||||||
|
var listPositions = context.Positions.Select(x => x.GetViewModel).ToList();
|
||||||
|
var listTypes = context.Types.Select(x => x.GetViewModel).ToList();
|
||||||
|
if (listDepartments.Count < 1 || listEmployees.Count < 1 || listPositions.Count < 1 || listTypes.Count < 1)
|
||||||
|
{
|
||||||
|
throw new Exception("Недостаточно для генерации!");
|
||||||
|
}
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
context.Deals.Add(Deal.Create(new DealBindingModel
|
context.Deals.Add(Deal.Create(new DealBindingModel
|
||||||
@ -184,10 +192,10 @@ namespace PersonnelDepartmentDatabaseImplement.Implements
|
|||||||
Id = 0,
|
Id = 0,
|
||||||
DateFrom = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc),
|
DateFrom = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc),
|
||||||
DateTo = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc),
|
DateTo = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc),
|
||||||
DepartmentId = 1,
|
DepartmentId = listDepartments[rnd.Next(listDepartments.Count)].Id,
|
||||||
EmployeeId = 1,
|
EmployeeId = listEmployees[rnd.Next(listEmployees.Count)].Id,
|
||||||
TypeId = 1,
|
TypeId = listTypes[rnd.Next(listTypes.Count)].Id,
|
||||||
PositionId = 1
|
PositionId = listPositions[rnd.Next(listPositions.Count)].Id
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
Stopwatch stopwatch = new();
|
Stopwatch stopwatch = new();
|
||||||
|
@ -196,6 +196,7 @@
|
|||||||
Controls.Add(groupBox2);
|
Controls.Add(groupBox2);
|
||||||
Controls.Add(groupBox1);
|
Controls.Add(groupBox1);
|
||||||
Name = "FormGeneration";
|
Name = "FormGeneration";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
Text = "FormGeneration";
|
Text = "FormGeneration";
|
||||||
groupBox1.ResumeLayout(false);
|
groupBox1.ResumeLayout(false);
|
||||||
groupBox1.PerformLayout();
|
groupBox1.PerformLayout();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user