мелкая правка
This commit is contained in:
parent
d256b76957
commit
90535a3315
@ -83,15 +83,15 @@ namespace AbstractLawFirmFileImplement.Implements
|
||||
|
||||
public bool SellDocument(IDocumentModel model, int count)
|
||||
{
|
||||
var car = source.Documents.FirstOrDefault(x => x.Id == model.Id);
|
||||
var document = source.Documents.FirstOrDefault(x => x.Id == model.Id);
|
||||
|
||||
if (car == null)
|
||||
if (document == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var shopDocuments = source.Shops.SelectMany(shop => shop.ShopDocuments.Where(c => c.Value.Item1.Id == car.Id));
|
||||
var shopDocuments = source.Shops.SelectMany(shop => shop.ShopDocuments.Where(c => c.Value.Item1.Id == document.Id));
|
||||
|
||||
int countStore = 0;
|
||||
|
||||
@ -105,7 +105,7 @@ namespace AbstractLawFirmFileImplement.Implements
|
||||
{
|
||||
var documents = shop.ShopDocuments;
|
||||
|
||||
foreach (var c in documents.Where(x => x.Value.Item1.Id == car.Id))
|
||||
foreach (var c in documents.Where(x => x.Value.Item1.Id == document.Id))
|
||||
{
|
||||
int min = Math.Min(c.Value.Item2, count);
|
||||
documents[c.Value.Item1.Id] = (c.Value.Item1, c.Value.Item2 - min);
|
||||
|
Loading…
Reference in New Issue
Block a user