Пример #1
0
        public JsonResult AddOffer(AuctionOfferViewModel viewModel)
        {
            if (!ModelState.IsValid)
                return Json(new { success = false });

            var auctionOffer = TypeAdapter.Adapt<AuctionOfferViewModel, AuctionOffer>(viewModel);
            auctionOffer.UserId = User.Identity.GetUserId();

            try
            {
                _auctionOfferService.AddAuctionOffer(auctionOffer);

                var auctionProgress = Hubs.AuctionProgress.AuctionProgress.Instance;
                auctionProgress.BroadcastAuctionProgress(viewModel);

                return Json(new { success = true });
            }
            catch (Exception e)
            {
                Logger.Error(e);
                return Json(new { success = false });
            }
        }
Пример #2
0
 public void BroadcastAuctionProgress(AuctionOfferViewModel auctionOffer)
 {
     _clients.All.addOffer(auctionOffer);
 }