public void AddBid(Bid bid) { bid.Availible = true; bid.DateCreated = DateTime.Now; bid.DateUpdated = DateTime.Now; bid.IsDeleted = false; bid.BuyerId = _db.Buyers.FirstOrDefault(p => p.UserId == bid.CreatedUserId).BuyerId; _db.Bids.Add(bid); _db.SaveChanges(); }
public void EditBid(Bid bid) { var originalBid = this.FindBid(bid.BidId); originalBid.Amount = bid.Amount; _db.SaveChanges(); }
public void DeleteUserBid(Bid bid) { bid.IsDeleted = true; _db.SaveChanges(); }
public bool DeleteBid(Bid bid) { _repo.DeleteUserBid(bid); return true; }
public bool PutBid(Bid bid) { if (ModelState.IsValid) { string userId = User.Identity.GetUserId(); bid.CreatedUserId = userId; bid.UpdatedUserId = userId; _repo.EditBid(bid); } return true; }