Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
        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();
            }
        }