lab-3-hard some minor fixes

This commit is contained in:
Zakharov_Rostislav 2024-03-25 22:13:44 +04:00
parent aeea01acb8
commit 08d8b3e6c5
2 changed files with 0 additions and 8 deletions

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 =>