ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №3 усложненная #11

Closed
Zakharov_Rostislav wants to merge 12 commits from lab-3-hard into lab-2-hard
2 changed files with 0 additions and 8 deletions
Showing only changes of commit 08d8b3e6c5 - Show all commits

View File

@ -27,7 +27,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
}
return null;
}
public ShopViewModel? GetElement(ShopSearchModel model)
{
if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue)
@ -41,7 +40,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
.FirstOrDefault(x => model.Id.HasValue && x.Id == model.Id)
?.GetViewModel;
}
public List<ShopViewModel> GetFilteredList(ShopSearchModel model)
{
if (string.IsNullOrEmpty(model.ShopName))
@ -56,7 +54,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
.Where(x => x.ShopName.Contains(model.ShopName ?? string.Empty))
.ToList();
}
public List<ShopViewModel> GetFullList()
{
using var context = new BlacksmithWorkshopDataBase();
@ -66,7 +63,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
.Select(x => x.GetViewModel)
.ToList();
}
public ShopViewModel? Insert(ShopBindingModel model)
{
using var context = new BlacksmithWorkshopDataBase();
@ -90,7 +86,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
throw;
}
}
public ShopViewModel? Update(ShopBindingModel model)
{
using var context = new BlacksmithWorkshopDataBase();

View File

@ -57,7 +57,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
}).ToList()
};
}
public void Update(ShopBindingModel? model)
{
if (model == null)
@ -69,7 +68,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
OpeningDate = model.OpeningDate;
MaxCapacity = model.MaxCapacity;
}
public ShopViewModel GetViewModel => new()
{
Id = Id,
@ -79,7 +77,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
ShopManufactures = ShopManufactures,
MaxCapacity = MaxCapacity
};
public void UpdateManufactures(BlacksmithWorkshopDataBase context, ShopBindingModel model)
{
var ShopManufacture = context.ShopManufactures.Where(rec =>