Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 public BllLot Update(BllLot bllLot)
 {
     DalLot oldLot = lotRepository.Update(bllLot.ToDalLot());
     uow.Commit();
     return oldLot == null ? null : oldLot.ToBll();
 }
Ejemplo n.º 3
0
 public BllLot Create(BllLot bllLot)
 {
     BllLot newLot = lotRepository.Create(bllLot.ToDalLot()).ToBll();
     uow.Commit();
     return newLot;
 }
Ejemplo n.º 4
0
        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;
        }