Compare commits

..

3 Commits

Author SHA1 Message Date
6b9da32038 Add BindShipment method 2024-05-01 17:59:52 +04:00
972e622cd3 Add ER-diagramm 2024-05-01 17:45:25 +04:00
d1c6f94b00 Add ER-diagramm 2024-05-01 17:44:25 +04:00
5 changed files with 17 additions and 14 deletions

View File

@ -77,7 +77,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics
public bool Delete(ProductBindingModel Model) public bool Delete(ProductBindingModel Model)
{ {
CheckModel(Model, false); CheckModel(Model, false);
_logger.LogInformation("Delete. Id:{Id}", Model.Id); _logger.LogInformation("Delete. Id: {Id}", Model.Id);
if (_productStorage.Delete(Model) is null) if (_productStorage.Delete(Model) is null)
{ {
@ -88,6 +88,17 @@ namespace ComputerShopBusinessLogic.BusinessLogics
return true; return true;
} }
public bool BindShipment(ProductBindingModel Model)
{
if (Model.ShipmentId == null)
{
_logger.LogInformation("Trying to bind null shipment to product with Id: {Id}", Model.Id);
return false;
}
return Update(Model);
}
private void CheckModel(ProductBindingModel Model, bool WithParams = true) private void CheckModel(ProductBindingModel Model, bool WithParams = true)
{ {
if (Model == null) if (Model == null)

View File

@ -15,5 +15,7 @@ namespace ComputerShopContracts.BusinessLogicContracts
bool Update(ProductBindingModel Model); bool Update(ProductBindingModel Model);
bool Delete(ProductBindingModel Model); bool Delete(ProductBindingModel Model);
bool BindShipment(ProductBindingModel Model);
} }
} }

View File

@ -1,13 +0,0 @@
namespace ComputerShopRestApi
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

BIN
ER-diagramm.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -3,3 +3,6 @@
Роли: Роли:
- Исполнитель (9.3) - Чернышев Г.Я. - Исполнитель (9.3) - Чернышев Г.Я.
- Поручитель (9.4) - Шабунов О.А. - Поручитель (9.4) - Шабунов О.А.
## ER-диаграмма
![ER-diagramm](https://git.is.ulstu.ru/ujijrujijr/PIbd-22_Chernyshev_Shabunov_CourseWork/src/branch/main/ER-diagramm.jpg?raw=true)