This commit is contained in:
Danil Markov 2023-05-02 14:11:28 +04:00
parent e6867ecc4c
commit 453ed01e98
2 changed files with 7 additions and 7 deletions

View File

@ -50,14 +50,14 @@ namespace LawFirmFileImplement.Implements
}
public DocumentViewModel? Update(DocumentBindingModel model)
{
var ship = source.Documents.FirstOrDefault(x => x.Id == model.Id);
if (ship == null)
var document = source.Documents.FirstOrDefault(x => x.Id == model.Id);
if (document == null)
{
return null;
}
ship.Update(model);
document.Update(model);
source.SaveDocuments();
return ship.GetViewModel;
return document.GetViewModel;
}
public DocumentViewModel? Delete(DocumentBindingModel model)
{

View File

@ -49,10 +49,10 @@ namespace LawFirmFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
var ship = _source.Documents.FirstOrDefault(x => x.Id == order.DocumentId);
if (ship != null)
var document = _source.Documents.FirstOrDefault(x => x.Id == order.DocumentId);
if (document != null)
{
viewModel.DocumentName = ship.DocumentName;
viewModel.DocumentName = document.DocumentName;
}
return viewModel;
}