Beispiel #1
0
        public async Task <IActionResult> Update(int dealerId)
        {
            DealerController dealerController = this;
            AppUser          byIdAsync        = await dealerController._userManager.FindByIdAsync(dealerId.ToString());

            return((IActionResult)dealerController.View((object)new ListDealerResponse()
            {
                CompanyName = byIdAsync.CompanyName,
                Email = byIdAsync.Email,
                Phone = byIdAsync.PhoneNumber,
                Address = byIdAsync.Address,
                Authorized = byIdAsync.AuthorizedPerson,
                Id = byIdAsync.Id
            }));
        }
Beispiel #2
0
        public async Task <IActionResult> List()
        {
            DealerController dealerController = this;
            IList <AppUser>  list             = (IList <AppUser>)(await dealerController._userManager.GetUsersInRoleAsync("Bayi")).Where <AppUser>((Func <AppUser, bool>)(p => p.IsActive)).ToList <AppUser>();

            System.Collections.Generic.List <ListDealerResponse> listDealerResponseList = new System.Collections.Generic.List <ListDealerResponse>();
            foreach (AppUser appUser in (IEnumerable <AppUser>)list)
            {
                listDealerResponseList.Add(new ListDealerResponse()
                {
                    Id          = appUser.Id,
                    CompanyName = appUser.CompanyName,
                    Email       = appUser.Email,
                    Address     = appUser.Address,
                    Phone       = appUser.PhoneNumber,
                    Authorized  = appUser.AuthorizedPerson
                });
            }
            return((IActionResult)dealerController.View((object)listDealerResponseList));
        }