исправление ошибки привязки 2 балла из-за нее потерял ААААААА
This commit is contained in:
parent
6ae1f4a9e7
commit
0de4faadaa
@ -297,22 +297,7 @@ namespace CarServiceWebApp.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public IActionResult Attachment(int id, int selecteditem, int count)
|
public IActionResult Attachment(int id, int selecteditem, int count)
|
||||||
{
|
{
|
||||||
var existingAttachment = _itemForRepairLogic.ReadElement(new() { ItemId = selecteditem });
|
_itemForRepairLogic.Create(new() { ItemId = selecteditem, RepairRequestId = id, Count = count });
|
||||||
if (existingAttachment == null)
|
|
||||||
{
|
|
||||||
_itemForRepairLogic.Create(new() { ItemId = selecteditem, RepairRequestId = id, Count = count });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
existingAttachment.Count = count;
|
|
||||||
_itemForRepairLogic.Update(new()
|
|
||||||
{
|
|
||||||
Id = existingAttachment.Id,
|
|
||||||
Count = existingAttachment.Count,
|
|
||||||
ItemId = existingAttachment.ItemId,
|
|
||||||
RepairRequestId = existingAttachment.RepairRequestId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Redirect($"~/Home/RepairRequest/{id}");
|
return Redirect($"~/Home/RepairRequest/{id}");
|
||||||
}
|
}
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user