public void Delete(BllLot bllLot) { //Проверка на существование? IEnumerable<BllBid> bids = bidService.GetByPredicate(b => b.LotId == bllLot.Id).ToList(); foreach (var bid in bids) { bidService.Delete(bid); } lotRepository.Delete(bllLot.ToDalLot()); uow.Commit(); }
public BllLot Update(BllLot bllLot) { DalLot oldLot = lotRepository.Update(bllLot.ToDalLot()); uow.Commit(); return oldLot == null ? null : oldLot.ToBll(); }
public BllLot Create(BllLot bllLot) { BllLot newLot = lotRepository.Create(bllLot.ToDalLot()).ToBll(); uow.Commit(); return newLot; }
private BllLot setCurrentPrice(BllLot lot) { BllBid bllLastBid = bidService.GetByPredicate(bid => bid.LotId == lot.Id).OrderBy(bid => bid.DateTime).LastOrDefault(); if (bllLastBid == null) { lot.CurrentPrice = lot.StartPrice; } else { lot.CurrentPrice = bllLastBid.Sum; } return lot; }