//написати callback для синхронізацї лотів в селлера та байера public void DeleteLot(ServerLotDTO serverLotDTO, ServerSellerDTO serverSellerDTO) { tempSellersOnline.FirstOrDefault(x => x.Name == serverSellerDTO.Name && x.Password == serverSellerDTO.Password). SellerLots.Remove(serverLotDTO); var tempLot = mapperLot.Map <ServerLotDTO, Lots>(serverLotDTO); sellerWrapper.DeleteLot(tempLot); }
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 AddLot(ServerSellerDTO serverSellerDTO, ServerLotDTO serverLotDTO) { tempSellersOnline.FirstOrDefault(x => x.Name == serverSellerDTO.Name && x.Password == serverSellerDTO.Password).SellerLots.Add(serverLotDTO); var tempLot = mapperLot.Map <ServerLotDTO, Lots>(serverLotDTO); var tempSeller = mapperSeller.Map <ServerSellerDTO, Sellers>(serverSellerDTO); sellerWrapper.AddLot(tempLot, tempSeller); //викликати CallBack для баєра // update.buyer }
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 void UpdateLot(ServerLotDTO serverLotDTO, ServerSellerDTO serverSellerDTO) { var tempSeller = tempSellersOnline.FirstOrDefault(x => x.Name == serverSellerDTO.Name && x.Password == serverSellerDTO.Password); }
public void UpdateLot(ServerLotDTO lot) { throw new NotImplementedException(); }