исправление ошибки привязки 2 балла из-за нее потерял ААААААА
This commit is contained in:
parent
6ae1f4a9e7
commit
0de4faadaa
@ -296,23 +296,8 @@ namespace CarServiceWebApp.Controllers
|
||||
}
|
||||
[HttpPost]
|
||||
public IActionResult Attachment(int id, int selecteditem, int count)
|
||||
{
|
||||
var existingAttachment = _itemForRepairLogic.ReadElement(new() { ItemId = selecteditem });
|
||||
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}");
|
||||
}
|
||||
[HttpGet]
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user