From b36fe3771c58f87a37017615ef3b2b56495b78d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=AF=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=B2?= Date: Wed, 8 May 2024 08:59:44 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBar/SushiBar/FormCreateTask.cs | 6 +++--- SushiBar/SushiBarMongoDB/Implements/BuyerStorage.cs | 2 +- SushiBar/SushiBarMongoDB/Implements/CookStorage.cs | 2 +- SushiBar/SushiBarMongoDB/Implements/MenuStorage.cs | 2 +- SushiBar/SushiBarMongoDB/Implements/PlaceStorage.cs | 2 +- SushiBar/SushiBarMongoDB/Implements/TaskStorage.cs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SushiBar/SushiBar/FormCreateTask.cs b/SushiBar/SushiBar/FormCreateTask.cs index d009f0a..6acc61c 100644 --- a/SushiBar/SushiBar/FormCreateTask.cs +++ b/SushiBar/SushiBar/FormCreateTask.cs @@ -188,9 +188,9 @@ namespace SushiBarView TaskDate = DateTime.Now, Status = SushiBarDataModels.Enum.TaskStatus.Принят, FullPrice = CalcPrice(), - CookId = comboBoxCook.SelectedIndex, - BuyerId = comboBoxBuyer.SelectedIndex, - PlaceId = comboBoxPlace.SelectedIndex, + CookId = comboBoxCook.SelectedIndex+1, + BuyerId = comboBoxBuyer.SelectedIndex+1, + PlaceId = comboBoxPlace.SelectedIndex+1, TaskMenus = _taskMenu, MenuIds = ids, }; diff --git a/SushiBar/SushiBarMongoDB/Implements/BuyerStorage.cs b/SushiBar/SushiBarMongoDB/Implements/BuyerStorage.cs index 4fb29c3..59b2c81 100644 --- a/SushiBar/SushiBarMongoDB/Implements/BuyerStorage.cs +++ b/SushiBar/SushiBarMongoDB/Implements/BuyerStorage.cs @@ -76,7 +76,7 @@ namespace SushiBarMongoDB.Implements var buyers = context.GetCollection("Buyers"); - model.Id = (int)buyers.CountDocuments(FilterDefinition.Empty); + model.Id = (int)buyers.CountDocuments(FilterDefinition.Empty)+1; var buyer = Buyer.Create(model); buyers.InsertOne(buyer); diff --git a/SushiBar/SushiBarMongoDB/Implements/CookStorage.cs b/SushiBar/SushiBarMongoDB/Implements/CookStorage.cs index 58b5df0..759d8e0 100644 --- a/SushiBar/SushiBarMongoDB/Implements/CookStorage.cs +++ b/SushiBar/SushiBarMongoDB/Implements/CookStorage.cs @@ -80,7 +80,7 @@ namespace SushiBarMongoDB.Implements var cooks = context.GetCollection("Cooks"); - model.Id = (int)cooks.CountDocuments(FilterDefinition.Empty); + model.Id = (int)cooks.CountDocuments(FilterDefinition.Empty) + 1; var cook = Cook.Create(model); cooks.InsertOne(cook); diff --git a/SushiBar/SushiBarMongoDB/Implements/MenuStorage.cs b/SushiBar/SushiBarMongoDB/Implements/MenuStorage.cs index 84e748c..12283b8 100644 --- a/SushiBar/SushiBarMongoDB/Implements/MenuStorage.cs +++ b/SushiBar/SushiBarMongoDB/Implements/MenuStorage.cs @@ -80,7 +80,7 @@ namespace SushiBarMongoDB.Implements var menus = context.GetCollection("Menus"); - model.Id = (int)menus.CountDocuments(FilterDefinition.Empty); + model.Id = (int)menus.CountDocuments(FilterDefinition.Empty) + 1; var menu = Menu.Create(model); menus.InsertOne(menu); diff --git a/SushiBar/SushiBarMongoDB/Implements/PlaceStorage.cs b/SushiBar/SushiBarMongoDB/Implements/PlaceStorage.cs index b7e3a61..7342f2b 100644 --- a/SushiBar/SushiBarMongoDB/Implements/PlaceStorage.cs +++ b/SushiBar/SushiBarMongoDB/Implements/PlaceStorage.cs @@ -79,7 +79,7 @@ namespace SushiBarMongoDB.Implements var places = context.GetCollection("Places"); - model.Id = (int)places.CountDocuments(FilterDefinition.Empty); + model.Id = (int)places.CountDocuments(FilterDefinition.Empty) + 1; var place = Place.Create(model); places.InsertOne(place); diff --git a/SushiBar/SushiBarMongoDB/Implements/TaskStorage.cs b/SushiBar/SushiBarMongoDB/Implements/TaskStorage.cs index edb98a6..03f739d 100644 --- a/SushiBar/SushiBarMongoDB/Implements/TaskStorage.cs +++ b/SushiBar/SushiBarMongoDB/Implements/TaskStorage.cs @@ -55,7 +55,7 @@ namespace SushiBarMongoDB.Implements var tasks = context.GetCollection("Tasks"); - model.Id = (int)tasks.CountDocuments(FilterDefinition.Empty); + model.Id = (int)tasks.CountDocuments(FilterDefinition.Empty) + 1; var newTask = Task.Create(model);