Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="proposal"></param>
        /// <param name="audienceChannel">Si se le pasa un audienceChannel este se usara para setear price and productName, sino se consultara uno a la BD</param>
        /// <param name=""></param>
        /// <returns></returns>
        private ProposalReviewListItemViewModel MapToProposalReviewListItemViewModel(ProposalDocument proposal, AudienceChannelDocument audienceChannel = null)
        {
            if (audienceChannel == null)
            {
                audienceChannel = _audienceChannelManager.GetAudienceChannelById(proposal.AudienceChannelId);
            }


            AdvertiserProfileDocument advertiserProfile = _advertiserProfileManager.FindProfileByProfileId(proposal.AdvertiserProfileId);
            ApplicationUser           user    = _identityManager.FindUserByUserId(advertiserProfile.UserId);
            CountryDocument           country = _catalogManager.FindCountryById(advertiserProfile.CountryBusinessInId);


            DateTime registerProposal = Convert.ToDateTime(proposal.RegisterDate);

            string messageDaysAgo = DateUtils.GetTextDaysAgo(registerProposal);


            return(new ProposalReviewListItemViewModel()
            {
                TimeAgoReceived = messageDaysAgo,
                AdvertiserImageSrc = advertiserProfile.IconUrl,
                AdvertiserName = user.Name,
                IdProposal = proposal.Id,
                Location = country != null?country.Name:"",
                Price = audienceChannel.Price.ToString() + " kind",
                ProductName = audienceChannel.Name
            });
        }
Exemplo n.º 2
0
        public Task <TUser> FindByIdAsync(string userId)
        {
            TUser us = null;

            if (user == null)
            {
                us   = (TUser)_cosmosIdentityManage.FindUserByUserId(userId);
                user = us;
                if (user == null)
                {
                    return(Task.FromResult <TUser>(us));
                }
                return(Task.FromResult <TUser>(user));
            }
            else if (user.Id != userId)
            {
                user = (TUser)_cosmosIdentityManage.FindUserByUserId(userId);
            }
            return(Task.FromResult <TUser>(user));
        }
Exemplo n.º 3
0
        // GET: Advertiser Profile
        public new ActionResult Profile()
        {
            string userId = User.Identity.GetUserId();
            AdvertiserProfileViewModel          profile     = manager.FindProfileByUserId(userId);
            List <AdvertiserPreferenceDocument> preferences = manager.FindPreferencesByProfileId(profile.profile.Id);

            ViewBag.Preferences = preferences;
            ApplicationUser appUser = _cosmosIdentityManager.FindUserByUserId(userId);

            ViewBag.Name  = appUser.Name;
            ViewBag.Email = appUser.Email;

            return(View(profile));
        }
Exemplo n.º 4
0
        public string GetUserWalletAddress(string _idusr)
        {
            ApplicationUser _aspNetUser = _cosmosIdentityManage.FindUserByUserId(_idusr);

            return(_aspNetUser.WalletAddress);
        }