public void Save(Bid bid) { DAL.Bid pd = new DAL.Bid(); pd.BidderId = bid.User.Id; pd.AuctionId = bid.AuctionId; pd.Amount = bid.Amount; db.Bids.InsertOnSubmit(pd); db.SubmitChanges(); }
public void DeleteBid(int id) { DAL.Bid p = db.Bids.Where(x => x.Id == id).FirstOrDefault(); if (p != null) { db.Bids.DeleteOnSubmit(p); db.SubmitChanges(); } }
public void UpdateBid(Bid bid) { DAL.Bid pd = db.Bids.Where(x => x.Id == bid.Id).FirstOrDefault(); if (pd != null) { pd.Id = bid.Id; pd.BidderId = bid.User.Id; pd.AuctionId = bid.AuctionId; pd.Amount = bid.Amount; db.SubmitChanges(); } }