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);