Начало работ.
This commit is contained in:
parent
a10ef889f9
commit
324a621815
@ -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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyContracts",
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyBusinessLogic", "TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj", "{5FD7F1C8-0B2C-4AD4-91FD-A4475274FD3A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyBusinessLogic", "TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj", "{5FD7F1C8-0B2C-4AD4-91FD-A4475274FD3A}"
|
||||||
EndProject
|
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{E421890B-5501-4A4D-931A-1B8139FDDB24}.Release|Any CPU.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<appSettings>
|
<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>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
@ -40,12 +40,13 @@
|
|||||||
generationClientsToolStripMenuItem = new ToolStripMenuItem();
|
generationClientsToolStripMenuItem = new ToolStripMenuItem();
|
||||||
generationTruckingsToolStripMenuItem = new ToolStripMenuItem();
|
generationTruckingsToolStripMenuItem = new ToolStripMenuItem();
|
||||||
testTimeGetDataToolStripMenuItem = new ToolStripMenuItem();
|
testTimeGetDataToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
testComplexQueriesToolStripMenuItem = new ToolStripMenuItem();
|
||||||
buttonUpdate = new Button();
|
buttonUpdate = new Button();
|
||||||
comboBoxEmails = new ComboBox();
|
comboBoxEmails = new ComboBox();
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
checkBoxSorted = new CheckBox();
|
checkBoxSorted = new CheckBox();
|
||||||
checkBoxForFilterMode = new CheckBox();
|
checkBoxForFilterMode = new CheckBox();
|
||||||
testComplexQueriesToolStripMenuItem = new ToolStripMenuItem();
|
createJsonFilesToolStripMenuItem = new ToolStripMenuItem();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
menuStrip.SuspendLayout();
|
menuStrip.SuspendLayout();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -73,7 +74,7 @@
|
|||||||
// menuStrip
|
// menuStrip
|
||||||
//
|
//
|
||||||
menuStrip.ImageScalingSize = new Size(20, 20);
|
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.Location = new Point(0, 0);
|
||||||
menuStrip.Name = "menuStrip";
|
menuStrip.Name = "menuStrip";
|
||||||
menuStrip.Padding = new Padding(6, 3, 0, 3);
|
menuStrip.Padding = new Padding(6, 3, 0, 3);
|
||||||
@ -144,6 +145,13 @@
|
|||||||
testTimeGetDataToolStripMenuItem.Text = "Тест скорости чтения данных";
|
testTimeGetDataToolStripMenuItem.Text = "Тест скорости чтения данных";
|
||||||
testTimeGetDataToolStripMenuItem.Click += TestTimeGetDataToolStripMenuItem_Click;
|
testTimeGetDataToolStripMenuItem.Click += TestTimeGetDataToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
|
// testComplexQueriesToolStripMenuItem
|
||||||
|
//
|
||||||
|
testComplexQueriesToolStripMenuItem.Name = "testComplexQueriesToolStripMenuItem";
|
||||||
|
testComplexQueriesToolStripMenuItem.Size = new Size(188, 24);
|
||||||
|
testComplexQueriesToolStripMenuItem.Text = "Тест сложных запросов";
|
||||||
|
testComplexQueriesToolStripMenuItem.Click += TestComplexQueriesToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
// buttonUpdate
|
// buttonUpdate
|
||||||
//
|
//
|
||||||
buttonUpdate.Location = new Point(1014, 138);
|
buttonUpdate.Location = new Point(1014, 138);
|
||||||
@ -193,12 +201,12 @@
|
|||||||
checkBoxForFilterMode.Text = "Включить режим фильтра";
|
checkBoxForFilterMode.Text = "Включить режим фильтра";
|
||||||
checkBoxForFilterMode.UseVisualStyleBackColor = true;
|
checkBoxForFilterMode.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// testComplexQueriesToolStripMenuItem
|
// createJsonFilesToolStripMenuItem
|
||||||
//
|
//
|
||||||
testComplexQueriesToolStripMenuItem.Name = "testComplexQueriesToolStripMenuItem";
|
createJsonFilesToolStripMenuItem.Name = "createJsonFilesToolStripMenuItem";
|
||||||
testComplexQueriesToolStripMenuItem.Size = new Size(188, 24);
|
createJsonFilesToolStripMenuItem.Size = new Size(209, 24);
|
||||||
testComplexQueriesToolStripMenuItem.Text = "Тест сложных запросов";
|
createJsonFilesToolStripMenuItem.Text = "Сформировать json файлы";
|
||||||
testComplexQueriesToolStripMenuItem.Click += TestComplexQueriesToolStripMenuItem_Click;
|
createJsonFilesToolStripMenuItem.Click += CreateJsonFilesToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// FormTrucking
|
// FormTrucking
|
||||||
//
|
//
|
||||||
@ -257,5 +265,6 @@
|
|||||||
private CheckBox checkBoxForFilterMode;
|
private CheckBox checkBoxForFilterMode;
|
||||||
private ToolStripMenuItem testTimeGetDataToolStripMenuItem;
|
private ToolStripMenuItem testTimeGetDataToolStripMenuItem;
|
||||||
private ToolStripMenuItem testComplexQueriesToolStripMenuItem;
|
private ToolStripMenuItem testComplexQueriesToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem createJsonFilesToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using TransportCompanyContracts.BusinessLogicsContracts;
|
using TransportCompanyContracts.BusinessLogicsContracts;
|
||||||
using TransportCompanyContracts.SearchModels;
|
using TransportCompanyContracts.SearchModels;
|
||||||
@ -16,13 +18,23 @@ namespace TransportCompany
|
|||||||
|
|
||||||
private readonly IClientLogic _clientLogic;
|
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();
|
InitializeComponent();
|
||||||
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_truckingLogic = truckingLogic;
|
_truckingLogic = truckingLogic;
|
||||||
_clientLogic = clientLogic;
|
_clientLogic = clientLogic;
|
||||||
|
_cargoLogic = cargoLogic;
|
||||||
|
_transportLogic = transportLogic;
|
||||||
|
_transportationLogic = transportationLogic;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormMain_Load(object sender, EventArgs e)
|
private void FormMain_Load(object sender, EventArgs e)
|
||||||
@ -187,5 +199,33 @@ namespace TransportCompany
|
|||||||
LoadData();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,6 +22,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\TransportCompamyMongoDBImplementer\TransportCompamyMongoDBImplementer.csproj" />
|
||||||
<ProjectReference Include="..\TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj" />
|
<ProjectReference Include="..\TransportCompanyBusinessLogic\TransportCompanyBusinessLogic.csproj" />
|
||||||
<ProjectReference Include="..\TransportCompanyContracts\TransportCompanyContracts.csproj" />
|
<ProjectReference Include="..\TransportCompanyContracts\TransportCompanyContracts.csproj" />
|
||||||
<ProjectReference Include="..\TransportCompanyDatabaseImplements\TransportCompanyDatabaseImplements.csproj" />
|
<ProjectReference Include="..\TransportCompanyDatabaseImplements\TransportCompanyDatabaseImplements.csproj" />
|
||||||
|
@ -3,6 +3,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TransportCompanyContracts.BindingModels;
|
using TransportCompanyContracts.BindingModels;
|
||||||
using TransportCompanyContracts.BusinessLogicsContracts;
|
using TransportCompanyContracts.BusinessLogicsContracts;
|
||||||
|
@ -154,6 +154,7 @@ public partial class ElegevContext : DbContext
|
|||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.HasColumnName("transportation_type");
|
.HasColumnName("transportation_type");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.HasSequence("seq_cargo");
|
modelBuilder.HasSequence("seq_cargo");
|
||||||
modelBuilder.HasSequence("seq_client");
|
modelBuilder.HasSequence("seq_client");
|
||||||
modelBuilder.HasSequence("seq_trucking");
|
modelBuilder.HasSequence("seq_trucking");
|
||||||
|
Loading…
Reference in New Issue
Block a user