public async Task <IViewComponentResult> InvokeAsync()
        {
            var userId = UserClaimsPrincipal.FindFirst(ClaimTypes.NameIdentifier).Value;
            var dto    = _itemService.GetShortMyAuctions(userId);

            return(View(dto));
        }
Exemplo n.º 2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var userId = UserClaimsPrincipal.FindFirst(ClaimTypes.NameIdentifier).Value;
            var dto    = await _itemService.GetShortCustomerBestBidsAsync(userId);

            return(View(dto));
        }
Exemplo n.º 3
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var userId = UserClaimsPrincipal.FindFirst(ClaimTypes.NameIdentifier).Value;
            var dto    = _customerService.GetContact(userId);
            var model  = _mapper.Map <ContactDTO, ContactViewModel> (dto);

            return(View(model));
        }
Exemplo n.º 4
0
        public async System.Threading.Tasks.Task <IViewComponentResult> InvokeAsync()
        {
            int orderNum = 0;

            if (HttpContext.User.Identity.IsAuthenticated)
            {
                orderNum = await httpClientService.CountUserOrderDetailAsync(UserClaimsPrincipal.FindFirst(ClaimTypes.NameIdentifier).Value);
            }
            return(View(orderNum));
        }
Exemplo n.º 5
0
        private UserViewModel GetUser(int id)
        {
            var user = new UserViewModel
            {
                Name  = User.Identity.Name,
                Email = UserClaimsPrincipal.FindFirst(c => c.Type == ClaimTypes.Email).Value
            };

            return(user);
        }
Exemplo n.º 6
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            if (User.Identity.IsAuthenticated)
            {
                var    userEmailClaim = UserClaimsPrincipal.FindFirst(ClaimTypes.Email);
                string userEmail      = userEmailClaim.Value;

                return(View("LoggedIn", userEmail));
            }

            return(View());
        }
Exemplo n.º 7
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            string userId = UserClaimsPrincipal.FindFirst(ClaimTypes.NameIdentifier)?.Value;

            if (userId != null)
            {
                ApplicationUser currentUser = await _userManager.FindByIdAsync(userId);

                Patron p = _db.Patrons.Include(x => x.User).FirstOrDefault(x => x.User.Id == currentUser.Id);

                return(View(p.Id));
            }
            else
            {
                return(View(0));
            }
        }
Exemplo n.º 8
0
        private async Task <IList <DashboardSideMenu> > GetSideMenu()
        {
            SideMenuManager mgr       = new SideMenuManager();
            string          UserRoles = UserClaimsPrincipal.FindFirst(ClaimTypes.Role)?.Value;

            string[] currentRoles = UserRoles.Split(",");
            IList <DashboardSideMenu> listitem;

            if (Array.IndexOf(currentRoles, "Super Admin") > -1)// do not check permission for erp admin super roles.
            {
                listitem = await mgr.GetAllSideMenu(null, 0);
            }
            else
            {
                listitem = await mgr.GetSideMenuByRole(UserRoles, 0);
            }
            return(listitem);
        }