Example #1
0
        //написати 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);
        }
Example #2
0
        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);
        }
Example #3
0
        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
        }
Example #4
0
        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;
        }
Example #5
0
 //подумати чи дійсно цей метод нам треба???
 public void UpdateLot(ServerLotDTO serverLotDTO, ServerSellerDTO serverSellerDTO)
 {
     var tempSeller = tempSellersOnline.FirstOrDefault(x => x.Name == serverSellerDTO.Name && x.Password == serverSellerDTO.Password);
 }
Example #6
0
 public void UpdateLot(ServerLotDTO lot)
 {
     throw new NotImplementedException();
 }