Пример #1
0
 public ActionResult Create([Bind(Include = "Id,Title,CreationDate,UpdateDate")] MarketplaceViewModel marketplace)
 {
     if (ModelState.IsValid)
     {
         var client   = GlobalWebApiClient.GetClient();
         var response = client.PostAsJsonAsync("/api/marketplaces/save/", marketplace).Result;
         try
         {
             if (response.IsSuccessStatusCode)
             {
                 marketplace = response.Content.ReadAsAsync <MarketplaceViewModel>().Result;
                 TempData["SuccessMessage"] = "Marketplace created successfully";
                 return(RedirectToAction("Details", marketplace));
             }
         }
         catch (Exception ex)
         {
             var result = ex.Message;
         }
     }
     else
     {
         ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator.");
     }
     return(View(marketplace));
 }
Пример #2
0
        public async Task <MarketplaceViewModel> GetAuctions(string chain, int currentPage, int pageSize = AppSettings.PageSize, string tokenSymbol = null)
        {
            var tokenQueries = new TokenQueries(_context);
            var chainQueries = new ChainQueries(_context);
            var tokenList    = tokenQueries.QueryTokens();

            var chains = chainQueries.QueryChains();
            List <AuctionDto> auctions = new List <AuctionDto>();

            var auction = await _phantasmaRpcService.GetAuctions.SendRequestAsync(chain, "", currentPage, pageSize);

            auctions.AddRange(auction.AuctionsList);

            return(MarketplaceViewModel.FromAuctionList(auctions, tokenList));
        }
Пример #3
0
        private void Start()
        {
            _viewModel = ServiceLocator.Default.Resolve <MarketplaceViewModel>();
            _selectors = new List <MarketplaceSelectorButtonView>();

            closeButton.onClick.AddListener(CloseWindow);

            _viewModel.PlayerInGameValue
            .Subscribe(x => { goldValueText.text = x.ToString(); })
            .AddTo(this);

            SetupSelectors();
            SelectFirstSelector();

            SetupMarketplace();

            FillTable();
        }
Пример #4
0
        // GET: Marketplace
        public ActionResult Advertiser()
        {
            MarketplaceViewModel viewModel = new MarketplaceViewModel();
            string userId = User.Identity.GetUserId();

            //Checamos si ya tiene un advertiser profile
            bool existProfile = manager.DoYouHaveProfile(Comun.Enums.ProfilesTypes.Advertiser, userId);

            ////if(existProfile) {
            ////    var profile = manager.GetAdvertiserProfile(userId);
            ////    //Checamos si tiene al menos una audiencia
            ////    var existAudience = manager.DoYouHaveALastOneAudience(profile.Id);
            ////    viewModel.needAudience = !existAudience;
            ////}


            //llenamos el modelo
            viewModel.needProfile = !existProfile;
            return(View(viewModel));
        }
Пример #5
0
        public ActionResult Publisher()
        {
            MarketplaceViewModel viewModel = new MarketplaceViewModel();
            string userId = User.Identity.GetUserId();

            //Checar si ya tiene un publihserProfileMediante el UserId
            bool existProfile = manager.DoYouHaveProfile(Comun.Enums.ProfilesTypes.Publisher, userId);

            if (existProfile)
            {
                var profile = manager.GetPublisherProfile(userId);
                // checamos si tiene al menos una audiencia
                var existAudience = manager.DoYouHaveALastOneAudience(profile.Id);
                viewModel.needAudience = !existAudience;
            }


            //llenamos el model
            viewModel.needProfile = !existProfile;
            return(View(viewModel));
        }