Начало работ.

This commit is contained in:
Programmist73 2023-05-09 15:00:49 +04:00
parent a10ef889f9
commit 324a621815
9 changed files with 482 additions and 403 deletions

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TransportCompamyMongoDBImplementer
{
public class DBMSContext
{
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyContracts",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyBusinessLogic", "TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj", "{5FD7F1C8-0B2C-4AD4-91FD-A4475274FD3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransportCompanyDatabaseImplements", "TransportCompanyDatabaseImplements\TransportCompanyDatabaseImplements.csproj", "{E421890B-5501-4A4D-931A-1B8139FDDB24}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyDatabaseImplements", "TransportCompanyDatabaseImplements\TransportCompanyDatabaseImplements.csproj", "{E421890B-5501-4A4D-931A-1B8139FDDB24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransportCompamyMongoDBImplementer", "TransportCompamyMongoDBImplementer\TransportCompamyMongoDBImplementer.csproj", "{5315CD03-FC5D-4ECB-9973-38989C1B02EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -39,6 +41,10 @@ Global
{E421890B-5501-4A4D-931A-1B8139FDDB24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E421890B-5501-4A4D-931A-1B8139FDDB24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E421890B-5501-4A4D-931A-1B8139FDDB24}.Release|Any CPU.Build.0 = Release|Any CPU
{5315CD03-FC5D-4ECB-9973-38989C1B02EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5315CD03-FC5D-4ECB-9973-38989C1B02EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5315CD03-FC5D-4ECB-9973-38989C1B02EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5315CD03-FC5D-4ECB-9973-38989C1B02EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="connectToDb" value="Host=192.168.56.101;Port=6000;Database=elegev;Username=elegev;Password=user"/>
<add key="connectToDb" value="Host=192.168.56.103;Port=6000;Database=sit;Username=elegev;Password=user"/>
</appSettings>
</configuration>

View File

@ -40,12 +40,13 @@
generationClientsToolStripMenuItem = new ToolStripMenuItem();
generationTruckingsToolStripMenuItem = new ToolStripMenuItem();
testTimeGetDataToolStripMenuItem = new ToolStripMenuItem();
testComplexQueriesToolStripMenuItem = new ToolStripMenuItem();
buttonUpdate = new Button();
comboBoxEmails = new ComboBox();
label1 = new Label();
checkBoxSorted = new CheckBox();
checkBoxForFilterMode = new CheckBox();
testComplexQueriesToolStripMenuItem = new ToolStripMenuItem();
createJsonFilesToolStripMenuItem = new ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
menuStrip.SuspendLayout();
SuspendLayout();
@ -73,7 +74,7 @@
// menuStrip
//
menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, rndGenerationToolStripMenuItem, testTimeGetDataToolStripMenuItem, testComplexQueriesToolStripMenuItem });
menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, rndGenerationToolStripMenuItem, testTimeGetDataToolStripMenuItem, testComplexQueriesToolStripMenuItem, createJsonFilesToolStripMenuItem });
menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip";
menuStrip.Padding = new Padding(6, 3, 0, 3);
@ -144,6 +145,13 @@
testTimeGetDataToolStripMenuItem.Text = "Тест скорости чтения данных";
testTimeGetDataToolStripMenuItem.Click += TestTimeGetDataToolStripMenuItem_Click;
//
// testComplexQueriesToolStripMenuItem
//
testComplexQueriesToolStripMenuItem.Name = "testComplexQueriesToolStripMenuItem";
testComplexQueriesToolStripMenuItem.Size = new Size(188, 24);
testComplexQueriesToolStripMenuItem.Text = "Тест сложных запросов";
testComplexQueriesToolStripMenuItem.Click += TestComplexQueriesToolStripMenuItem_Click;
//
// buttonUpdate
//
buttonUpdate.Location = new Point(1014, 138);
@ -193,12 +201,12 @@
checkBoxForFilterMode.Text = "Включить режим фильтра";
checkBoxForFilterMode.UseVisualStyleBackColor = true;
//
// testComplexQueriesToolStripMenuItem
// createJsonFilesToolStripMenuItem
//
testComplexQueriesToolStripMenuItem.Name = "testComplexQueriesToolStripMenuItem";
testComplexQueriesToolStripMenuItem.Size = new Size(188, 24);
testComplexQueriesToolStripMenuItem.Text = "Тест сложных запросов";
testComplexQueriesToolStripMenuItem.Click += TestComplexQueriesToolStripMenuItem_Click;
createJsonFilesToolStripMenuItem.Name = "createJsonFilesToolStripMenuItem";
createJsonFilesToolStripMenuItem.Size = new Size(209, 24);
createJsonFilesToolStripMenuItem.Text = "Сформировать json файлы";
createJsonFilesToolStripMenuItem.Click += CreateJsonFilesToolStripMenuItem_Click;
//
// FormTrucking
//
@ -257,5 +265,6 @@
private CheckBox checkBoxForFilterMode;
private ToolStripMenuItem testTimeGetDataToolStripMenuItem;
private ToolStripMenuItem testComplexQueriesToolStripMenuItem;
private ToolStripMenuItem createJsonFilesToolStripMenuItem;
}
}

View File

@ -1,6 +1,8 @@
using Microsoft.Extensions.Logging;
using System.ComponentModel;
using System.Reflection;
using System.Text;
using System.Text.Json;
using System.Windows.Forms;
using TransportCompanyContracts.BusinessLogicsContracts;
using TransportCompanyContracts.SearchModels;
@ -16,13 +18,23 @@ namespace TransportCompany
private readonly IClientLogic _clientLogic;
public FormTrucking(ILogger<FormTrucking> logger, ITruckingLogic truckingLogic, IClientLogic clientLogic)
private readonly ICargoLogic _cargoLogic;
private readonly ITransportLogic _transportLogic;
private readonly ITransportationLogic _transportationLogic;
public FormTrucking(ILogger<FormTrucking> logger, ITruckingLogic truckingLogic, IClientLogic clientLogic,
ICargoLogic cargoLogic, ITransportLogic transportLogic, ITransportationLogic transportationLogic)
{
InitializeComponent();
_logger = logger;
_truckingLogic = truckingLogic;
_clientLogic = clientLogic;
_cargoLogic = cargoLogic;
_transportLogic = transportLogic;
_transportationLogic = transportationLogic;
}
private void FormMain_Load(object sender, EventArgs e)
@ -187,5 +199,33 @@ namespace TransportCompany
LoadData();
}
}
private void CreateJsonFilesToolStripMenuItem_Click(object sender, EventArgs e)
{
var listTrucking = _truckingLogic.ReadList(null);
var listClients = _clientLogic.ReadList(null);
var listCargos = _cargoLogic.ReadList(null);
var listTransport = _transportLogic.ReadList(null);
var listTransportation = _transportationLogic.ReadList(null);
string jsonList = JsonSerializer.Serialize(listClients).ToString();
string path = @"C:\Users\Programmist73\Desktop\JSON\"; // ïóòü ê ôàéëó
string realPath;
for(int i = 0; i < listClients.Count; i++)
{
realPath = path + "json" + i.ToString() + ".json";
File.Create(realPath).Close();
StreamWriter writetext = new StreamWriter(realPath);
writetext.WriteLine("{\n\t" + "\"client\" : " + "{\n\t" + "\t\"Name\" : " + "\"" + listClients[i].Name + "\"" + "\n\t}\n}");
writetext.Close();
}
}
}
}

View File

@ -22,6 +22,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TransportCompamyMongoDBImplementer\TransportCompamyMongoDBImplementer.csproj" />
<ProjectReference Include="..\TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj" />
<ProjectReference Include="..\TransportCompanyContracts\TransportCompanyContracts.csproj" />
<ProjectReference Include="..\TransportCompanyDatabaseImplements\TransportCompanyDatabaseImplements.csproj" />

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using TransportCompanyContracts.BindingModels;
using TransportCompanyContracts.BusinessLogicsContracts;

View File

@ -154,6 +154,7 @@ public partial class ElegevContext : DbContext
.HasMaxLength(255)
.HasColumnName("transportation_type");
});
modelBuilder.HasSequence("seq_cargo");
modelBuilder.HasSequence("seq_client");
modelBuilder.HasSequence("seq_trucking");