public static List <Auction> getUserAuctionListByID(int id) { AuctionTableGateway DataGateway = new AuctionTableGateway(); DataTable TableData = DataGateway.FindByUserID(id); List <Auction> tmp = new List <Auction>(); foreach (DataRow row in TableData.Rows) { tmp.Add(map(row)); } return(tmp); }
public static Auction GetByCarID(int id) { try { AuctionTableGateway DataGateway = new AuctionTableGateway(); DataTable TableData = DataGateway.FindByCarID(id); DataRow row = TableData.Rows[0]; return(map(row)); } catch { return(null); } }
public bool increaseBid(User user, int bid) { if (user.ID != this.user.ID) { Car car = Car.getCarByID(ID_car); if (car.user.ID != user.ID) { if (DateTime.Now < EndDate) { if (bid > CurrentBid * 1.02) { Console.WriteLine("Zvyseno"); AuctionTableGateway DataGateway = new AuctionTableGateway(); DataGateway.updateByID(ID, user.ID, DateTime.Now, bid); return(true); } } } } return(false); }