Пример #1
0
        public void Save(mod.Bid bid)
        {
            Bid tc = _context.Bids.Find(bid.Id);

            tc.Amount    = (decimal?)bid.BidAmount;
            tc.Timeofbid = bid.TimeOfBid;
            _context.SaveChanges();
        }
Пример #2
0
        public Bid Parse(mod.Bid bid)
        {
            Bid tc = new Bid();

            tc.Amount    = (decimal?)bid.BidAmount;
            tc.Timeofbid = bid.TimeOfBid;
            if (tc.Id == null)
            {
                tc.Id = bid.Id;
            }
            return(tc);
        }
Пример #3
0
 public mod.Bid AddBid(mod.Bid newBid)
 {
     if (Exists(newBid.Id))
     {
         newBid = _mapper.Parse(_context.Bids.Find(newBid.Id));
     }
     else
     {
         _context.Bids.Add(_mapper.Parse(newBid));
         _context.SaveChanges();
     }
     return(newBid);
 }