use of com.cmput301w18t05.taskzilla.request.command.AddBidRequest in project Taskzilla by CMPUT301W18T05.
the class Task method addBid.
/**
* addBid
* Insert into sorted bid list
*
* @author praharen
*/
public void addBid(Bid newbid) {
GetBidsByTaskIdRequest getbidrequest = new GetBidsByTaskIdRequest(this.Id);
RequestManager.getInstance().invokeRequest(getbidrequest);
ArrayList<Bid> bidlist = getbidrequest.getResult();
for (Bid bid : bidlist) {
if (bid.getUserId().equals(newbid.getUserId())) {
RemoveBidRequest removerequest = new RemoveBidRequest(bid);
RequestManager.getInstance().invokeRequest(removerequest);
break;
}
}
AddBidRequest addBidRequest = new AddBidRequest(newbid);
RequestManager.getInstance().invokeRequest(addBidRequest);
}
Aggregations