// GET: PublisherController
        public async Task <ActionResult> Index(int id)
        {
            //ServiceGroupListbyID
            var congPublishers = await _userManager.GetApplicationUsersbyCongregation(id);

            //Map data to view model
            var viewModel = _mapper.Map <IEnumerable <PublisherViewModel> >(congPublishers);

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        // GET: PublisherServiceGroupController
        public async Task <ActionResult> IndexAsync()
        {
            //Get user Data
            var userData = HttpContext.Session.GetObjectFromJson <LoginPassedDataViewModel>("userCredentials");
            //Get All Service Groups by Congregation ID
            var serviceGroupsList = _serviceGroup.GetServiceGroupsbyCongAsync(userData.CongregationId);
            //Get All Publishers by Congregation
            var publisherGroupList = _userManager.GetApplicationUsersbyCongregation(userData.CongregationId);

            //Attach information to viewModel
            var viewModel = new PublisherServiceGroupViewModel()
            {
                ServiceGroups   = await serviceGroupsList,
                ApplicationUser = await publisherGroupList
            };

            return(View(viewModel));
        }
        // GET: UserRoles
        public async Task <ActionResult> IndexAsync()
        {
            //Get user Data
            var userData = HttpContext.Session.GetObjectFromJson <LoginPassedDataViewModel>("userCredentials");
            //Get all Roles except Admin Role
            var userRoles = _userRole.GetAllRolesCongregtionLevelandBelow();
            //Get All Publishers by Congregation
            var publisherGroupList = _userManager.GetApplicationUsersbyCongregation(userData.CongregationId);

            //Attach information to viewModel
            var viewModel = new UserRolesViewModel()
            {
                ApplicationRole = await userRoles,
                ApplicationUser = await publisherGroupList
            };

            return(View(viewModel));
        }