Agliullov D. A. Lab Work 6 Base #17

Closed
d.agliullov wants to merge 34 commits from Lab6_Base into Lab5_Base
Showing only changes of commit 2a4d859356 - Show all commits

View File

@ -82,7 +82,14 @@ namespace ConfectioneryListImplement
public ImplementerViewModel? Insert(ImplementerBindingModel model)
{
model.Id = _source.Implementers.Count > 0 ? _source.Implementers.Max(x => x.Id) + 1 : 1;
model.Id = 1;
foreach (var implementer in _source.Implementers)
{
if (model.Id <= implementer.Id)
{
model.Id = implementer.Id + 1;
}
}
var res = Implementer.Create(model);
if (res != null)
{