From 3428145ff7fabc1887be3d0c39a3625e34cf8671 Mon Sep 17 00:00:00 2001 From: Timourka Date: Wed, 8 May 2024 01:06:22 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D1=8B=20?= =?UTF-8?q?=D0=B8=20=D1=82=D0=B8=D0=BF=D1=8B=20=D0=BA=D1=83=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=20=D1=82=D0=BE=D0=B6=D0=B5=20=D0=B1=D1=83=D0=B4?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=B8=D0=B7=20=D0=BF=D0=BE=D1=81=D1=82=D0=B3?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D0=B0=20=D0=B2=D1=8B=D1=81=D0=B0=D1=81=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBD_Car_rent/Forms/FormMain.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SUBD_Car_rent/Forms/FormMain.cs b/SUBD_Car_rent/Forms/FormMain.cs index a1627d0..e0ab204 100644 --- a/SUBD_Car_rent/Forms/FormMain.cs +++ b/SUBD_Car_rent/Forms/FormMain.cs @@ -102,6 +102,10 @@ namespace Forms ImplementationMongoDB implementationMongoDB = new(); // очищаем всё + foreach (var it in implementationMongoDB.GetStatuses()) + implementationMongoDB.DeleteStatus(it.Id); + foreach (var it in implementationMongoDB.GetBodyTypes()) + implementationMongoDB.DeleteBodyType(it.Id); foreach (var it in implementationMongoDB.GetBranches()) implementationMongoDB.DeleteBranch(it.Id); foreach (var it in implementationMongoDB.GetClients()) @@ -116,6 +120,8 @@ namespace Forms ImplementationPostgres implementationPostgres = new(); // скачиваем из постгреса + var listStatuses = implementationPostgres.GetStatuses(); + var listBodyTypes = implementationPostgres.GetBodyTypes(); var listBranches = implementationPostgres.GetBranches(); var listClients = implementationPostgres.GetClients(); var listCarModels = implementationPostgres.GetCarModels(); @@ -123,6 +129,10 @@ namespace Forms var listRentals = implementationPostgres.GetRentals(); // вливаем данные монго дб + foreach (var it in listStatuses) + implementationMongoDB.AddStatus(it); + foreach (var it in listBodyTypes) + implementationMongoDB.AddBodyType(it); foreach (var it in listBranches) implementationMongoDB.AddBranch(it); foreach (var it in listClients)