public void AddCashForBuyer(ServerBuyerDTO serverBuyerDTO) { tempBuyersOnline.FirstOrDefault(x => x.Name == serverBuyerDTO.Name && x.Password == serverBuyerDTO.Password).Cash = serverBuyerDTO.Cash; Buyers temp = mapperBuyer.Map <ServerBuyerDTO, Buyers>(serverBuyerDTO); buyerWrapper.AddCashForBuyer(temp); }
public void BoughtLot(ServerBuyerDTO serverBuyerDTO, ServerLotDTO serverLotDTO) { tempBuyersOnline.FirstOrDefault(x => x.Name == serverBuyerDTO.Name && x.Password == serverBuyerDTO.Password). BuyerBoughtLots.Add(serverLotDTO); Lots tempLotF = mapperLot.Map <ServerLotDTO, Lots>(serverLotDTO); Buyers tempBuyerF = mapperBuyer.Map <ServerBuyerDTO, Buyers>(serverBuyerDTO); buyerWrapper.BoughtLot(tempLotF, tempBuyerF); }
public void MakeBet(ServerLotDTO serverLotDTO, ServerBuyerDTO serverBuyerDTO, decimal newPrice) { tempBuyersOnline.FirstOrDefault(x => x.Name == serverBuyerDTO.Name && x.Password == serverBuyerDTO.Password).Cash -= newPrice; var tempLot = templotsBuyer.FirstOrDefault(x => x.BuyerName == serverLotDTO.BuyerName); if (tempLot != null) { tempBuyersOnline.FirstOrDefault(x => x.Name == tempLot.BuyerName).Cash += tempLot.StartPrice; } templotsBuyer.FirstOrDefault(x => x.BuyerName == serverLotDTO.BuyerName).StartPrice = newPrice; templotsBuyer.FirstOrDefault(x => x.BuyerName == serverLotDTO.BuyerName).BuyerName = serverBuyerDTO.Name; }
public bool ConnectionForBuyer(ServerBuyerDTO serverBuyerDTO) { Buyers temp = mapperBuyer.Map <ServerBuyerDTO, Buyers>(serverBuyerDTO); if (buyerWrapper.DoesItBuyerExist(temp)) { if (tempBuyersOnline.FirstOrDefault(x => x.Name == serverBuyerDTO.Name && x.Password == serverBuyerDTO.Password) == null) { tempBuyersOnline.Add(serverBuyerDTO); return(true); } else { return(false); } } else { buyerWrapper.AddBuyer(temp); tempBuyersOnline.Add(serverBuyerDTO); return(true); } }
//передивитись на предмет дісконнекта, коли баєр уходить що робити з грошима і ставкою public void DisconectionForBuyer(ServerBuyerDTO serverBuyerDTO) { tempBuyersOnline.Remove(serverBuyerDTO); }